[MacPorts] #55733: lz4 fails to build on Snow Leopard
MacPorts
noreply at macports.org
Tue Jan 23 00:09:34 UTC 2018
#55733: lz4 fails to build on Snow Leopard
-------------------------+---------------------------------------
Reporter: grumpybozo | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Resolution: | Keywords: haspatch snowleopard i386
Port: lz4 |
-------------------------+---------------------------------------
Comment (by kencu):
By the way, although it's certainly great to fix up these ports one by one
to send the right `-stdlib` to the compiler, the reason they stay broken
for so long is that nobody on newer systems would ever notice this.
So if you ever get tired of fixing this particular issue on these older
systems, it's really quite easy to change clang on your system to return
the default `stdlib` you want (in your case, you want it to default to
libc++). There is one function found in each version of clang that
controls this. For clang-5.0 it lives here in:
{{{
tools/clang/lib/Driver/ToolChains/Darwin.cpp
}}}
{{{
ToolChain::CXXStdlibType Darwin::GetDefaultCXXStdlibType() const {
// Default to use libc++ on OS X 10.9+ and iOS 7+.
if ((isTargetMacOS() && !isMacosxVersionLT(10, 9)) ||
(isTargetIOSBased() && !isIPhoneOSVersionLT(7, 0)) ||
isTargetWatchOSBased())
return ToolChain::CST_Libcxx;
return ToolChain::CST_Libstdcxx;
}
}}}
I just change that
{{{
if ((isTargetMacOS() && !isMacosxVersionLT(10, 9))
}}}
to
{{{
if ((isTargetMacOS() && !isMacosxVersionLT(10, 4))
}}}
and then you get `-stdlib=libc++` added by default on all systems, which
is what you want.
--
Ticket URL: <https://trac.macports.org/ticket/55733#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list