On Thu, Nov 10, 2011 at 11:29:35PM +0000, Iain Sandoe wrote: > > On 10 Nov 2011, at 20:43, Iain Sandoe wrote: >>> The symbol _ITM_malloc is in libitm. Maybe the problem is an extra _ >>> before the _ITM_malloc? >> >> Actually, I think the missing symbol is >> ___emutls_v._ZN3GTM12_gtm_thr_tlsE >> and (although the m32 lib builds OK - the symbol is also missing >> there). >> >> The m64 build fails because of the -Wl,-undefined -Wl,dynamic_lookup > > FAOD, Is there some reason that this library needs to resolve symbols > from some external source at load time? > >> in combination with the missing var. >> the m32 build succeed - but none of the testsuite runs, because the >> emutls var is missing (not resolved at load). >> >> ---- >> >> ... I strongly suspect it might be another manifestation of: >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50598 > > This is confirmed - if I hack around that bug, the library builds.
Iain, I can confirm on x86_64-apple-darwin11 that if I revert r179429... * cgraphunit.c (ipa_passes): Remove unrechable nodes. * lto-streamer-out.c (produce_symtab): Skip unused extern declarations. * ipa.c (cgraph_remove_unreachable_nodes): Do not assume that external functions are reachable when address is taken. * ipa-inline-analysis.c (reset_inline_edge_summary): New * gcc.dg/ipa/ctor-empty-1.c: Update dump file. the linker crash is eliminated when libitm.dylib is linked. Jack > > There are two other issues I can see so far: > > 1/ the symbols generated in sjlj.S are not getting their extra "_" (I > patched that up temporarily manually) ... which allows some of the > testsuite to pass. > > 2/ The section .tm_clone_table doesn't exist for Darwin leading to > assembler errors because ".tm_clone_table" is not a complete section > spec for Darwin > (that's not too hard to fix - but too late for tonight). > > Iain