[MacPorts] #44596: gmp @6.0.0_0: Autotools incorrectly selects "-undefined suppress" symbol lookup on Yosemite (was: libgcc @4.9.1_0, libgcc-devel @4.10-20140810: Build fails with internal compiler error)
MacPorts
noreply at macports.org
Sat Sep 13 08:24:04 PDT 2014
#44596: gmp @6.0.0_0: Autotools incorrectly selects "-undefined suppress" symbol
lookup on Yosemite
------------------------+----------------------
Reporter: wichert@… | Owner: larryv@…
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords: yosemite
Port: gmp |
------------------------+----------------------
Changes (by larryv@…):
* cc: mcalhoun@… (added)
* version: 2.3.1 =>
* port: libgcc libgcc-devel => gmp
Comment:
The GCC ICE was a red herring. You’ll be unsurprised to hear that this is
Autotools’ fault.
1. We set the `MACOSX_DEPLOYMENT_TARGET` environment variable to “10.10”.
(Homebrew doesn’t set it at all and thus doesn’t start down this road to
perdition.)
2. Libtool (and, by extension, `configure` scripts built with it)
interprets “10.10” as “10.1*”.
3. OS X did not support dynamic lookup of undefined symbols until 10.3.
Since Libtool thinks 10.10 Yosemite is 10.1 Puma, it tells the linker to
ignore undefined symbols.
{{{
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[[012]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined
${wl}suppress' ;;
10.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
}}}
4. GMP binaries contain several unresolved symbols that it no doubt
expects `dyld(1)` to look up later.
5. Thanks to Libtool, `dyld(1)` has no such plans. It makes this very
clear during GMP’s test suite.
{{{
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Error Formulating Crash Report:
Failed to read dyld_all_image_infos: Coudln't get the data
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libdyld.dylib 0x7fff88c64432
stack_not_16_byte_aligned_error + 0
}}}
6. This filters up to anything trying to use GMP. Like, say, GCC trying to
optimize some code.
Marcus, I’m attaching my fix; may I commit it? (I bumped the revision
because this problem only manifests at runtime.)
--
Ticket URL: <https://trac.macports.org/ticket/44596#comment:35>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list