[MacPorts] #59753: gildas @201911b: does not build for the right C++ stdlib (undefined symbols)

MacPorts noreply at macports.org
Sun Nov 24 06:10:50 UTC 2019


#59753: gildas @201911b: does not build for the right C++ stdlib (undefined
symbols)
------------------------+----------------------
 Reporter:  ryandesign  |      Owner:  bardeau
     Type:  defect      |     Status:  assigned
 Priority:  Normal      |  Milestone:
Component:  ports       |    Version:  2.6.2
 Keywords:              |       Port:  gildas
------------------------+----------------------
 gildas fails to build for a C++ standard library that is not the
 compiler's default. For example, ever since MacPorts 2.6.0, this happens
 on Mac OS X 10.6-10.8:

 The error is
 [https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/5602/steps
 /install-port/logs/stdio a bunch of undefined symbols], like this:

 {{{
 (cd ./built/x86_64-darwin-gfortran && /opt/local/bin/gfortran-mp-9
 -dynamiclib   -L/opt/local/lib -Wl,-headerpad_max_install_names -shared -o
 /opt/local/lib/gildas/x86_64-darwin-gfortran/lib/libatm2009.so
 -install_name /opt/local/lib/gildas/x86_64-darwin-
 gfortran/lib/libatm2009.so ATMOpacity.o ATMLength.o ATMInverseLength.o
 ATMPressure.o ATMTemperature.o ATMAngle.o ATMFrequency.o ATMHumidity.o
 ATMMassDensity.o ATMNumberDensity.o ATMPercent.o ATMWaterVaporRadiometer.o
 ATMWVRMeasurement.o ATMType.o ATMProfile.o ATMRefractiveIndex.o
 ATMRefractiveIndexProfile.o ATMSkyStatus.o ATMSpectralGrid.o ATMError.o  \
         -o
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/integ/x86_64-darwin-gfortran/lib/libatm2009.so
 -L/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/integ/x86_64-darwin-gfortran/lib
 -L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib  -lc++
 -lm -ldl -install_name @loader_path/../lib/libatm2009.so)
 Undefined symbols for architecture x86_64:
   "std::basic_string<char, std::char_traits<char>, std::allocator<char>
 >::compare(char const*) const", referenced from:
       atm::Opacity::Opacity(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMOpacity.o
       atm::Opacity::sput(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMOpacity.o
       atm::Opacity::sget(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMOpacity.o
       atm::Opacity::get(std::basic_string<char, std::char_traits<char>,
 std::allocator<char> >) const in ATMOpacity.o
       atm::Length::sput(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMLength.o
       atm::Length::sget(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMLength.o
       atm::InverseLength::sput(double, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >) in ATMInverseLength.o
       ...
 }}}

 This is happening because the port ''is'' supplying the C++ standard
 library flag (`-lc++`) to the Fortran compiler, but ''is not'' supplying
 that flag (or better yet the `-stdlib=libc++` flag) to the C++ compiler,
 so the parts that were built with the C++ compiler were built with the
 default C++ standard library (libstdc++) which is not compatible with
 libc++.

 The Portfile goes to some effort to put the right flags into the build
 system with a bunch of patchfiles and reinplaces, including cflags and
 ldflags. However I note it is ''not'' making any attempt to also do that
 for the cxxflags, which would contain the required stdlib flag. In
 addition, the reinplaces that are supposed to replace the placeholder
 `@STDCXXLIB@` with the real value are failing, because the placeholder
 does not exist in any of the patchfiles. In fact many of the reinplaces
 are failing. Warnings are printed about this, which should have been
 heeded and corrected before the changes were committed:

 {{{
 Warning: reinplace s|@CC@|/usr/bin/clang|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.def
 Warning: reinplace s|@CC@|/usr/bin/clang|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@CC@|/usr/bin/clang|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@CCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@CCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@CCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 Warning: reinplace s|@FC@|/opt/local/bin/gfortran-mp-9|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.def
 Warning: reinplace s|@FC@|/opt/local/bin/gfortran-mp-9|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@FC@|/opt/local/bin/gfortran-mp-9|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@FCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@FCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@FCFLAGS@|-Os|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 Warning: reinplace s|@CXX@|/usr/bin/clang++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.def
 Warning: reinplace s|@CXX@|/usr/bin/clang++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@CXX@|/usr/bin/clang++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@CPP@|/usr/bin/cpp|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@CPP@|/usr/bin/cpp|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@CPPFLAGS@|-I/opt/local/include|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@CPPFLAGS@|-I/opt/local/include|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@CPPFLAGS@|-I/opt/local/include|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 Warning: reinplace s|@LDFLAGS@|-L/opt/local/lib
 -Wl,-headerpad_max_install_names|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@LDFLAGS@|-L/opt/local/lib
 -Wl,-headerpad_max_install_names|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@LDFLAGS@|-L/opt/local/lib
 -Wl,-headerpad_max_install_names|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 Warning: reinplace s|@PYTHON@|/opt/local/bin/python2.7|g didn't change
 anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 Warning: reinplace s|@STDCXXLIB@|-lc++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.def
 Warning: reinplace s|@STDCXXLIB@|-lc++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/Makefile.python
 Warning: reinplace s|@STDCXXLIB@|-lc++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/gildas-env.sh
 Warning: reinplace s|@STDCXXLIB@|-lc++|g didn't change anything in
 /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_gildas/gildas/work
 /gildas-src-nov19a/admin/define-system.sh
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/59753>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list