public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* 4.3/4.4 PATCH: Fix Solaris/x86 bootstrap with Sun ld (PR bootstrap/33100)
@ 2008-10-10 14:53 Rainer Orth
  2008-11-05 16:05 ` Ian Lance Taylor
  0 siblings, 1 reply; 7+ messages in thread
From: Rainer Orth @ 2008-10-10 14:53 UTC (permalink / raw)
  To: gcc-patches

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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-11-19 18:27 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-10 14:53 4.3/4.4 PATCH: Fix Solaris/x86 bootstrap with Sun ld (PR bootstrap/33100) Rainer Orth
2008-11-05 16:05 ` Ian Lance Taylor
2008-11-05 17:12   ` Rainer Orth
2008-11-05 18:32     ` Ian Lance Taylor
2008-11-06 12:45       ` Rainer Orth
2008-11-19 17:41       ` Rainer Orth
2008-11-19 19:27         ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).