This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR 14992
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- Date: Thu, 22 Apr 2004 21:39:19 +0930
- Subject: Re: Fix PR 14992
- References: <20040418154702.GH2973@bubble.modra.org>
On Mon, Apr 19, 2004 at 01:17:02AM +0930, Alan Modra wrote:
> PR bootstrap/14992
This is the version I'd like to apply to mainline.
* gcc.c (init_gcc_specs): Test USE_LD_AS_NEEDED, not HAVE_LD_AS_NEEDED.
* config/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/alpha/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/arm/linux-elf.h (USE_LD_AS_NEEDED): Define.
* gcc/config/rs6000/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/rs6000/linux64.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sh/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sparc/linux.h (USE_LD_AS_NEEDED): Define.
* gcc/config/sparc/linux64.h (USE_LD_AS_NEEDED): Define.
Tested i686-linux and powerpc-linux.
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.416
diff -u -p -r1.416 gcc.c
--- gcc/gcc.c 17 Apr 2004 05:53:11 -0000 1.416
+++ gcc/gcc.c 22 Apr 2004 11:45:19 -0000
@@ -1551,7 +1551,7 @@ init_gcc_specs (struct obstack *obstack,
buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name,
"}%{!static:%{!static-libgcc:",
-#ifdef HAVE_LD_AS_NEEDED
+#ifdef USE_LD_AS_NEEDED
"%{!shared-libgcc:", static_name,
" --as-needed ", shared_name, " --no-as-needed}"
"%{shared-libgcc:", shared_name, "%{!shared: ", static_name,
Index: gcc/config/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/linux.h,v
retrieving revision 1.27
diff -u -p -r1.27 linux.h
--- gcc/config/linux.h 29 Nov 2003 03:08:10 -0000 1.27
+++ gcc/config/linux.h 22 Apr 2004 11:45:20 -0000
@@ -1,5 +1,5 @@
/* Definitions for Linux-based GNU systems with ELF format
- Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004
Free Software Foundation, Inc.
Contributed by Eric Youngdale.
Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org).
@@ -116,6 +116,11 @@ Boston, MA 02111-1307, USA. */
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
/* Determine whether the the entire c99 runtime
is present in the runtime library. */
Index: gcc/config/alpha/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/linux.h,v
retrieving revision 1.39
diff -u -p -r1.39 linux.h
--- gcc/config/alpha/linux.h 29 Nov 2003 03:08:09 -0000 1.39
+++ gcc/config/alpha/linux.h 22 Apr 2004 11:45:20 -0000
@@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler,
for Alpha Linux-based GNU systems.
- Copyright (C) 1996, 1997, 1998, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Contributed by Richard Henderson.
This file is part of GCC.
@@ -69,6 +70,11 @@ Boston, MA 02111-1307, USA. */
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
Index: gcc/config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.47
diff -u -p -r1.47 linux-elf.h
--- gcc/config/arm/linux-elf.h 3 Feb 2004 14:44:11 -0000 1.47
+++ gcc/config/arm/linux-elf.h 22 Apr 2004 11:45:20 -0000
@@ -126,3 +126,8 @@
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
Index: gcc/config/rs6000/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux.h,v
retrieving revision 1.45
diff -u -p -r1.45 linux.h
--- gcc/config/rs6000/linux.h 23 Feb 2004 17:02:51 -0000 1.45
+++ gcc/config/rs6000/linux.h 22 Apr 2004 11:45:21 -0000
@@ -66,6 +66,11 @@
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)");
Index: gcc/config/rs6000/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/linux64.h,v
retrieving revision 1.60
diff -u -p -r1.60 linux64.h
--- gcc/config/rs6000/linux64.h 23 Feb 2004 14:54:10 -0000 1.60
+++ gcc/config/rs6000/linux64.h 22 Apr 2004 11:45:21 -0000
@@ -548,6 +548,11 @@ while (0)
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
Index: gcc/config/sh/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sh/linux.h,v
retrieving revision 1.22
diff -u -p -r1.22 linux.h
--- gcc/config/sh/linux.h 12 Jan 2004 02:29:13 -0000 1.22
+++ gcc/config/sh/linux.h 22 Apr 2004 11:45:21 -0000
@@ -112,6 +112,11 @@ do { \
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
/* Output assembler code to STREAM to call the profiler. */
#undef FUNCTION_PROFILER
Index: gcc/config/sparc/linux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux.h,v
retrieving revision 1.60
diff -u -p -r1.60 linux.h
--- gcc/config/sparc/linux.h 1 Apr 2004 16:05:20 -0000 1.60
+++ gcc/config/sparc/linux.h 22 Apr 2004 11:45:25 -0000
@@ -256,6 +256,11 @@ do { \
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
Index: gcc/config/sparc/linux64.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/linux64.h,v
retrieving revision 1.81
diff -u -p -r1.81 linux64.h
--- gcc/config/sparc/linux64.h 1 Apr 2004 16:05:22 -0000 1.81
+++ gcc/config/sparc/linux64.h 22 Apr 2004 11:45:25 -0000
@@ -334,6 +334,11 @@ do { \
#define LINK_GCC_C_SEQUENCE_SPEC \
"%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
+/* Use --as-needed -lgcc_s for eh support. */
+#ifdef HAVE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 1
+#endif
+
/* Do code reading to identify a signal frame, and set the frame
state data appropriately. See unwind-dw2.c for the structs. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre