Bug 205818 - devel/ninja fails to compile on my system
Summary: devel/ninja fails to compile on my system
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Grzegorz Blach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-03 06:15 UTC by kenneth.freidank
Modified: 2016-01-03 21:49 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (gblach)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kenneth.freidank 2016-01-03 06:15:02 UTC
The ninja port is configured to compile with g++, not clang.  Clang is the FreeBSD default compiler and sets defines differently than g++.  One error with the default use of clang is use of a g++ deprecated and hence removed /user/include/c++/v1/ext/hash_map file:

src/hash_map.h:91:10: fatal error: 'ext/hash_map' file not found

The port's Makefile correctly uses the gnu replacement for hash_map only if you use g++, and NOT clang.  I tried using "clang-cpp -x c++ -std=c++0x" in place of ${CXX} in the port's Makefile, but I still had additional build errors.

To build the port, I substituted g++ for ${CXX} in the Makefile.

You will not experience this problem if you retained the old include files from earlier g++ distributions!

Pertinent info...

PORTNAME=ninja
PORTVERSION=1.6.0

FreeBSD 10.2-RELEASE-p7 #0....
    root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
# c++ --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: i386-unkown-freebsd10.2
Thread model: posix

# g++ --version
g++ (FreeBSD Ports Collection) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
...
Comment 1 Grzegorz Blach freebsd_committer freebsd_triage 2016-01-03 14:07:26 UTC
Looks like issue on your system.

On fresh FreeBSD 10.2:
- I have no problem with building ninja using clang.
- There is no g++ in base system.
- /usr/include/c++/v1/hash_map should be from LLVM not from GCC nor removed.
Comment 2 kenneth.freidank 2016-01-03 17:45:08 UTC
My system is from a previous release 9 something, upgraded to 10.0, then 10.2 using freebsd-update.

freebsd-update -r 10.2-RELEASE IDS did not report anything wrong with /usr/include

I'm not sure how to proceed.
Comment 3 kenneth.freidank 2016-01-03 21:49:49 UTC
I nuked my system and reinstalled 10.0 from scratch (I have a DVD).  Directory  /usr/include/c++/v1/ext returned.  Have run freebsd-update to 10.2-RELEASE, and the includes are still there.  I have no idea why these includes disappeared in the first place.  Thanks for your patience.