-stdlib=libc++ added to configure.cxxflags but not configure.ldflags

Ryan Schmidt ryandesign at macports.org
Tue Jan 26 08:27:12 PST 2016


On Jan 26, 2016, at 4:35 AM, René J.V. Bertin wrote:

> I just ran into a situation (building a Qt5 port) where for some reason -stdlib=libc++ was added to configure.cxxflags but not to configure.ldflags . That led to a failing final link.
> 
> I worked around the issue by adding the option myself if it is detected in cxxflags, but I wonder why this isn't an issue more often.
> 
> I'm running "base" 2.3.4 rev. 140804 ; the port in question is https://github.com/RJVB/macstrop/tree/master/devel/xxdiff .

I agree that MacPorts base only adds -stdlib=${configure.cxx_stdlib} to configure.cxxflags, not configure.ldflags, but that's not necessarily wrong, is it? If the build system just wants to link already-compiled objects, it doesn't need compiler flags. If the build system wants to compile and link at the same time, it's the build system's responsibility to add both the compiler flags (CFLAGS or CXXFLAGS) and the linker flags (LDFLAGS) to the compile/link command.




More information about the macports-dev mailing list