* 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.
From-SVN: r81072
+2004-04-23 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2004-04-22 Per Bothner <per@bothner.com>
* cppinit.c (cpp_read_main_file): Return NULL rather than false.
/* 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.
#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. */
#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
/* 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).
#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. */
#ifndef USE_GNULIBC_1
#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)");
#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. */
#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
#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. */
#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. */
various permutations of -shared-libgcc, -shared, and such. */
#if defined(ENABLE_SHARED_LIBGCC) && !defined(REAL_LIBGCC_SPEC)
+
+#ifndef USE_LD_AS_NEEDED
+#define USE_LD_AS_NEEDED 0
+#endif
+
static void
init_gcc_specs (struct obstack *obstack, const char *shared_name,
const char *static_name, const char *eh_name)
buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name,
"}%{!static:%{!static-libgcc:",
-#ifdef HAVE_LD_AS_NEEDED
+#if USE_LD_AS_NEEDED
"%{!shared-libgcc:", static_name,
" --as-needed ", shared_name, " --no-as-needed}"
"%{shared-libgcc:", shared_name, "%{!shared: ", static_name,