While the combination of Sun as with GNU ld isn't a recommended configuration on Solaris, it used to work half a year ago, but doesn't right now: stage 1 libgomp fails to link:
/vol/gcc/bin/gld-2.22: .libs/team.o: unrecognized relocation (0xc) in section `.text' /vol/gcc/bin/gld-2.22: final link failed: Bad value collect2: error: ld returned 1 exit status make[5]: *** [libgomp.la] Error 1 where 0xc is R_386_TLS_GD_PLT, which is supported by Sun as and ld, but not (yet) by gas and gld 2.22. The following patch makes sure that both assembler and linker support the relocation (and its companion, R_386_TLS_LDM_PLT) before using it. It allowed the bootstrap to complete successfully, will commit after a as/ld bootstrap to verify it. Rainer 2012-01-07 Rainer Orth <r...@cebitec.uni-bielefeld.de> * configure.ac (gcc_cv_as_ix86_tlsgdplt): Check if linker supports R_386_TLS_GD_PLT reloc. (gcc_cv_as_ix86_tlsldmplt): Check if linker supports R_386_TLS_LDM_PLT reloc. * configure: Regenerate. * config.in: Regenerate.
# HG changeset patch # Parent f01ec6505a7e1cac52ec68541cc2a83ac9858320 Check if linker supports R_386_TLS_GD_PLT, R_386_TLS_LDM_PLT relocs diff --git a/gcc/configure.ac b/gcc/configure.ac --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3674,15 +3674,25 @@ foo: nop gcc_GAS_CHECK_FEATURE([R_386_TLS_GD_PLT reloc], gcc_cv_as_ix86_tlsgdplt,,, - [call tls_gd@tlsgdplt],, + [call tls_gd@tlsgdplt], + [if test x$gcc_cv_ld != x \ + && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then + gcc_cv_as_ix86_tlsgdplt=yes + fi + rm -f conftest], [AC_DEFINE(HAVE_AS_IX86_TLSGDPLT, 1, - [Define if your assembler supports @tlsgdplt.])]) + [Define if your assembler and linker support @tlsgdplt.])]) gcc_GAS_CHECK_FEATURE([R_386_TLS_LDM_PLT reloc], gcc_cv_as_ix86_tlsldmplt,,, - [call tls_ld@tlsldmplt],, + [call tls_ld@tlsldmplt], + [if test x$gcc_cv_ld != x \ + && $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then + gcc_cv_as_ix86_tlsldmplt=yes + fi + rm -f conftest], [AC_DEFINE(HAVE_AS_IX86_TLSLDMPLT, 1, - [Define if your assembler supports @tlsldmplt.])]) + [Define if your assembler and linker support @tlsldmplt.])]) ;;
-- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University