This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
4.3/4.4 PATCH: Fix Solaris/x86 bootstrap with Sun ld (PR bootstrap/33100)
- From: Rainer Orth <ro at techfak dot uni-bielefeld dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Oct 2008 16:37:06 +0200 (MEST)
- Subject: 4.3/4.4 PATCH: Fix Solaris/x86 bootstrap with Sun ld (PR bootstrap/33100)
Solaris/x86 bootstrap with Sun ld has long been broken by a bug in Sun ld
which caused link failures for the amd64 libgcc_s.so.1.
The relevant bug
http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6685125
has been fixed in recent versions of OpenSolaris, but there's no backport
to Solaris 10 yet. Therefore I'm offering the following workaround.
A proper fix would require to make the inclusion of i386/t-crtstuff
conditional on the result of an autoconf test, which doesn't seem to be
easily possible in the context of config.gcc. One might remove the
inclusion from config.gcc completely and handle it in libgcc/configure.ac
instead. I might try this if it is deemed worthwhile.
The test would look like this:
* minimal testcase:
.section .eh_frame,"a",@unwind
.zero 4
.section .jcr,"aw",@progbits
.zero 8
* assemble/link with
gcc -m64 -shared -o conftest.so conftest.s
* fails like this:
ld: fatal: unwind table: file /var/tmp//cc9VAy39.o: section .eh_frame: bad cie version 0: offset 0xfffffd7fffdff220
collect2: ld returned 1 exit status
With this patch, it is possible to bootstrap both mainline and the 4.3
branch without problems.
Ok for both?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Fri Oct 10 16:27:14 2008 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR bootstrap/33100
* config.gcc (i[34567]86-*-solaris2*): Include i386/t-crtstuff
only with GNU ld.
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 140759)
+++ gcc/config.gcc (working copy)
@@ -1205,7 +1205,10 @@ i[34567]86-*-solaris2*)
*-*-solaris2.1[0-9]*)
tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h"
tm_defines="${tm_defines} TARGET_BI_ARCH=1"
- tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10"
+ tmake_file="$tmake_file i386/t-sol2-10"
+ if test x$gnu_ld = xyes; then
+ tmake_file="$tmake_file i386/t-crtstuff"
+ fi
need_64bit_hwint=yes
case X"${with_cpu}" in
Xgeneric|Xcore2|Xnocona|Xx86-64|Xamdfam10|Xbarcelona|Xk8|Xopteron|Xathlon64|Xathlon-fx)