[MacPorts] #51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x""
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" -----------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: nss -----------------------------+-------------------------------- This is the failure: {{{ cd google_test; /usr/bin/make libs make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/google_test' if test ! -d Output.OBJD/gtest/src; then rm -rf Output.OBJD/gtest/src; ../../coreconf/nsinstall/Output.OBJD/nsinstall -D Output.OBJD/gtest/src; fi /usr/bin/llvm-g++-4.2 -arch x86_64 -o Output.OBJD/gtest/src/gtest-all.o -c -Os -fPIC -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -Igtest/include/ -Igtest -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/gtest -I../../../dist/private/gtest -std=c++0x gtest/src/gtest-all.cc cc1plus: error: unrecognized command line option "-std=c++0x" make[2]: *** [Output.OBJD/gtest/src/gtest-all.o] Error 1 }}} The error is obviously contained in `../common/gtest.mk`, which is `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/common/gtest.mk` {{{ 34 else 35 CXXFLAGS += -std=c++0x 36 endif }}} because `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/google_test\Makefile` has: {{{ 24 ####################################################################### 25 # (4) Include "local" platform-dependent assignments (OPTIONAL). # 26 ####################################################################### 27 28 include ../common/gtest.mk }}} -- Ticket URL: <https://trac.macports.org/ticket/51196> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): http://gcc.gnu.org/projects/cxx-status.html#cxx11 seems to explain the case, and the report {{{ coreconf/Werror.mk:77: Unable to find gcc 4.8 or greater, disabling -Werror }}} Presumingly this additional compiler option should not be used in this case or GCC4.8 or newer should be use to compile nss. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Trying the patch `std=.patch` allows compilation of `gtest-all.c`. But now a new error arrises: {{{ make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/google_test' cd der_gtest; /usr/bin/make libs make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/der_gtest' if test ! -d Output.OBJD; then rm -rf Output.OBJD; ../../coreconf/nsinstall/Output.OBJD/nsinstall -D Output.OBJD; fi /usr/bin/llvm-g++-4.2 -arch x86_64 -o Output.OBJD/der_getint_unittest.o -c -Os -fPIC -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I../../external_tests/google_test/gtest/include -I../../external_tests/common -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -I../../../dist/public/nspr -I../../../dist/public/nss -I../../../dist/public/libdbm -I../../../dist/public/gtest der_getint_unittest.cc In file included from der_getint_unittest.cc:14: ../../external_tests/common/scoped_ptrs.h:33: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:34: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:35: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:36: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:37: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:38: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:39: error: expected initializer before ‘<’ token make[2]: *** [Output.OBJD/der_getint_unittest.o] Error 1 }}} So it's this block of C++ statements that the used Apple GCC 4.2 does not understand: {{{ 31 #define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x>
Scoped ## x 32 33 SCOPED(PK11SlotInfo); 34 SCOPED(SECItem); 35 SCOPED(PK11SymKey); 36 SCOPED(SECKEYPublicKey); 37 SCOPED(SECKEYPrivateKey); 38 SCOPED(SECAlgorithmID); 39 SCOPED(CERTSubjectPublicKeyInfo); 40 41 #undef SCOPED }}}
I think this means that at least GCC 4.8 has to be used, taking into account also the warning from `coreconf/Werror.mk`… (but I am no C++ expert) -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by ryandesign@…): Note that apple gcc 4.2 is not being used here; llvm-gcc 4.2 is being used. We could try blacklisting llvm-gcc 4.2, if other compilers can compile this. What version of Xcode is being used? llvm-gcc 4.2 would only be used by default on Xcode 4. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:3 ryandesign@…]:
Note that apple gcc 4.2 is not being used here; llvm-gcc 4.2 is being used. We could try blacklisting llvm-gcc 4.2, if other compilers can compile this.
Learned a bit, thought it was part of GCC 4.2 that came with Xcode.
What version of Xcode is being used? llvm-gcc 4.2 would only be used by
default on Xcode 4. I have Xcode 4.2 installed, according System Profiler. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): The same happens on PPC Mac OS X 10.4.11, Tiger: {{{ :info:build /opt/local/bin/g++-apple-4.2 -arch ppc -o Output.OBJD/gtest/src/gtest-all.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -Igtest/include/ -Igtest -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/gtest -I../../../dist/private/gtest -std=c++0x gtest/src/gtest-all.cc :info:build cc1plus: error: unrecognized command line option "-std=c++0x" :info:build make[2]: *** [Output.OBJD/gtest/src/gtest-all.o] Error 1 }}} -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): On Tiger I have Xcode version 2.5 installed, `Using compiler 'MacPorts Apple GCC 4.2'`, i.e. `/opt/local/bin/g++-apple-4.2`. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by hancock@…): Similar problem: Snow Leopard 10.6.8; Xcode 3.2.6; compiler that issues the std=c++0x error is /usr/bin/g++-4.2, which announces itself as i686 -apple-darwin10-g++-4.2.1. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by mojca@…): On 10.7 there is a related problem: {{{ In file included from der_getint_unittest.cc:14: ../../external_tests/common/scoped_ptrs.h:33:1: error: no type named 'unique_ptr' in namespace 'std' SCOPED(PK11SlotInfo); }}} An ugly workaround that worked for me was adding {{{ build.args-append NSS_DISABLE_GTESTS=1 }}} -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:9> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by drjesacco@…): Same problem building on a G4 PowerMac running OS X10.5.8. I managed to get nss to build using the latest versions of macports-gcc-4.8 and macports-gcc-5. In order to use GCC, I had to modify the Portfile, removing "-arch ${arch}" wherever I found it. -Joseph -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:10> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: nss | ------------------------------+-------------------------------- Changes (by devans@…): * status: new => closed * cc: devans@… (added) * resolution: => fixed Comment: Fixes committed * Blacklist old compilers that don't understand -std=c++0x, r148450 * External tests require libc++, disable on platforms where stdlib is libstdc++, r148453 With these fixes, nss builds on 10.6+ as verified by buildbots. 10.5 and earlier not tested. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:11> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:2 Peter_Dyballa@…]:
Trying the patch `std=.patch` allows compilation of `gtest-all.c`. But now a new error arrises:
{{{ make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/google_test' cd der_gtest; /usr/bin/make libs make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/external_tests/der_gtest' if test ! -d Output.OBJD; then rm -rf Output.OBJD; ../../coreconf/nsinstall/Output.OBJD/nsinstall -D Output.OBJD; fi /usr/bin/llvm-g++-4.2 -arch x86_64 -o Output.OBJD/der_getint_unittest.o -c -Os -fPIC -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I../../external_tests/google_test/gtest/include -I../../external_tests/common -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -I../../../dist/public/nspr -I../../../dist/public/nss -I../../../dist/public/libdbm -I../../../dist/public/gtest der_getint_unittest.cc In file included from der_getint_unittest.cc:14: ../../external_tests/common/scoped_ptrs.h:33: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:34: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:35: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:36: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:37: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:38: error: expected initializer before ‘<’ token ../../external_tests/common/scoped_ptrs.h:39: error: expected initializer before ‘<’ token make[2]: *** [Output.OBJD/der_getint_unittest.o] Error 1 }}}
So it's this block of C++ statements that the used Apple GCC 4.2 does not understand:
{{{ 31 #define SCOPED(x) typedef std::unique_ptr<x, ScopedMaybeDelete<x> Scoped ## x 32 33 SCOPED(PK11SlotInfo); 34 SCOPED(SECItem); 35 SCOPED(PK11SymKey); 36 SCOPED(SECKEYPublicKey); 37 SCOPED(SECKEYPrivateKey); 38 SCOPED(SECAlgorithmID); 39 SCOPED(CERTSubjectPublicKeyInfo); 40 41 #undef SCOPED }}}
I think this means that at least GCC 4.8 has to be used, taking into account also the warning from `coreconf/Werror.mk`… (but I am no C++ expert)
-- Ticket URL: <https://trac.macports.org/ticket/51196#comment:12> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Having finally found a patch to make Clang-3.3 build on PPC Tiger, Mac OS X 10.4.11, the build of nss failes again: {{{ /opt/local/bin/clang-mp-3.3 -arch ppc -o Output.OBJD/Darwin_SINGLE_SHLIB/pqg.o -c -Os -fPIC -Dppc -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -Qunused-arguments -Wno- parentheses-equality -Wno-array-bounds -Werror -DXP_UNIX -DSHLIB_SUFFIX=\"dylib\" -DSHLIB_PREFIX=\"lib\" -DSHLIB_VERSION=\"3\" -DSOFTOKEN_SHLIB_VERSION=\"3\" -DRIJNDAEL_INCLUDE_TABLES -UDEBUG -DNDEBUG -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -DMP_API_COMPATIBLE -I/opt/local/include/nspr -I../../../dist/Output.OBJD/include -I../../../dist/public/nss -I../../../dist/private/nss -Impi -Iecl pqg.c pqg.c:339:16: error: comparison of constant 18446744073709551615 with expression of type 'unsigned long' is always true [-Werror,-Wtautological- constant-out-of-range-compare] if (addend < MP_DIGIT_MAX) { ~~~~~~ ^ ~~~~~~~~~~~~ 1 error generated. make[3]: *** [Output.OBJD/Darwin_SINGLE_SHLIB/pqg.o] Error 1 make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_net_nss/nss/work/nss-3.23/nss/lib/freebl' }}} -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:13> MacPorts <https://www.macports.org/> Ports system for OS X
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Replying to [comment:10 drjesacco@…]:
Same problem building on a G4 PowerMac running OS X10.5.8. I managed to get nss to build using the latest versions of macports-gcc-4.8 and macports-gcc-5. In order to use GCC, I had to modify the Portfile, removing "-arch ${arch}" wherever I found it.
Yes, this seems to be the cause for the inadequate assembler output, that cannot be compiled. I "simplified" Portfile – and nss built! QED. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:14> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
#51196: nss 3.23 does not build on Mac Os X 10.6.8, Snow Leopard, because of "unrecognized command line option "-std=c++0x"" ------------------------------+-------------------------------- Reporter: Peter_Dyballa@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: nss | ------------------------------+-------------------------------- Comment (by Peter_Dyballa@…): Meanwhile nss @3.27.1_0 is active. It again failed to build. Removing the `-arch ${build_arch}` additions to build.args allows nss to build. -- Ticket URL: <https://trac.macports.org/ticket/51196#comment:15> MacPorts <https://www.macports.org/> Ports system for the Mac operating system
participants (1)
-
MacPorts