This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR target/31868: Non-Linux DWARF EH x86-64 targets have broken crtend.o


The problem was only fixed for Linux. This patch also fixes the other
affected targets. Tested on Linux and cross compile to FreeBSD. OK for
mainline and open branches?


H.J.
-----
2007-05-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/31868
	* config.gcc (x86_64-*-freebsd*): Add i386/t-crtstuff64 to
	tmake_file.
	(x86_64-*-netbsd*): Likewise.
	(x86_64-*-linux*): Likewise.
	(x86_64-*-kfreebsd*-gnu): Likewise.
	(x86_64-*-knetbsd*-gnu): Likewise.
	(i[34567]86-*-solaris2.1[0-9]*): Likewise.

	* config/i386/t-linux64 (CRTSTUFF_T_CFLAGS): Move to ...
	* config/i386/t-crtstuff64: This. New file.

	* config/t-freebsd (CRTSTUFF_T_CFLAGS_S): Add $(CRTSTUFF_T_CFLAGS).
	* config/t-libc-ok (CRTSTUFF_T_CFLAGS_S): Likewise.
	* config/t-lynx (CRTSTUFF_T_CFLAGS_S): Likewise.
	* config/t-netbsd (CRTSTUFF_T_CFLAGS_S): Likewise.
	* config/t-svr4 (CRTSTUFF_T_CFLAGS_S): Likewise.

--- gcc/config.gcc.crtend	2006-11-14 13:26:30.000000000 -0800
+++ gcc/config.gcc	2007-05-08 09:45:01.000000000 -0700
@@ -1011,6 +1011,7 @@ i[34567]86-*-freebsd*)
 	;;
 x86_64-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
+	tmake_file="${tmake_file} i386/t-crtstuff64"
 	;;
 i[34567]86-*-netbsdelf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
@@ -1023,6 +1024,7 @@ i[34567]86-*-netbsd*)
 	;;
 x86_64-*-netbsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
+	tmake_file="${tmake_file} i386/t-crtstuff64"
 	;;
 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
 	tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
@@ -1058,7 +1060,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
 	x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;;
 	x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;;
 	esac
-	tmake_file="${tmake_file} i386/t-linux64 i386/t-crtfm"
+	tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff64 i386/t-crtfm"
 	;;
 i[34567]86-*-gnu*)
 	;;
@@ -1149,7 +1151,7 @@ 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-sol2-10"
+		tmake_file="$tmake_file i386/t-crtstuff64 i386/t-sol2-10"
 		need_64bit_hwint=yes
 		# Solaris 2.10 provides crt1.o, crti.o, crtn.o, and gcrt1.o as 
 		# part of the base system.
--- gcc/config/i386/t-crtstuff64.crtend	2007-05-08 09:39:29.000000000 -0700
+++ gcc/config/i386/t-crtstuff64	2007-05-08 09:39:20.000000000 -0700
@@ -0,0 +1,5 @@
+# The pushl in CTOR initialization interferes with frame pointer elimination.
+# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
+# because then __FRAME_END__ might not be the last thing in .eh_frame
+# section.
+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
--- gcc/config/i386/t-linux64.crtend	2005-11-04 14:13:48.000000000 -0800
+++ gcc/config/i386/t-linux64	2007-05-08 09:40:31.000000000 -0700
@@ -13,9 +13,3 @@ INSTALL_LIBGCC = install-multilib
 
 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \
 		     crtbeginT.o crtfastmath.o
-
-# The pushl in CTOR initialization interferes with frame pointer elimination.
-# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
-# because then __FRAME_END__ might not be the last thing in .eh_frame
-# section.
-CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
--- gcc/config/t-freebsd.crtend	2005-11-01 13:54:26.000000000 -0800
+++ gcc/config/t-freebsd	2007-05-08 09:52:40.000000000 -0700
@@ -1,5 +1,5 @@
 # Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
 
 # Compile libgcc.a with pic.
 TARGET_LIBGCC2_CFLAGS += -fPIC
--- gcc/config/t-libc-ok.crtend	2005-11-01 13:54:26.000000000 -0800
+++ gcc/config/t-libc-ok	2007-05-08 09:52:48.000000000 -0700
@@ -1 +1 @@
-CRTSTUFF_T_CFLAGS_S=-fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
--- gcc/config/t-lynx.crtend	2005-11-01 13:54:26.000000000 -0800
+++ gcc/config/t-lynx	2007-05-08 09:52:55.000000000 -0700
@@ -1,5 +1,5 @@
 # Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
 
 # Compile libgcc2.a with pic.
 TARGET_LIBGCC2_CFLAGS = -fPIC
--- gcc/config/t-netbsd.crtend	2005-11-01 13:54:26.000000000 -0800
+++ gcc/config/t-netbsd	2007-05-08 09:53:01.000000000 -0700
@@ -1,2 +1,2 @@
 # Always build crtstuff with PIC.
-CRTSTUFF_T_CFLAGS = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
--- gcc/config/t-svr4.crtend	2005-11-01 13:54:26.000000000 -0800
+++ gcc/config/t-svr4	2007-05-08 09:53:06.000000000 -0700
@@ -4,7 +4,7 @@
 # we will be doing that, we just always use -fPIC when compiling the
 # routines in crtstuff.c.  Likewise for libgcc2.c.
 
-CRTSTUFF_T_CFLAGS = -fPIC
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
 TARGET_LIBGCC2_CFLAGS = -fPIC
 
 # See all the declarations.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]