aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-04-01 16:45:34 +0000
committerJakub Jelinek <jakub@gcc.gnu.org>2004-04-01 18:45:34 +0200
commit765f1bf9e4451e97ccfba21bc2d9dcee8580fb31 (patch)
tree1a3ce88b8909a989116b51749ef3a5f061786ed7 /gcc/gcc.c
parent45dcc026e55601992454c81ff5c171a58a5ac4b9 (diff)
downloadgcc-765f1bf9e4451e97ccfba21bc2d9dcee8580fb31.zip
gcc-765f1bf9e4451e97ccfba21bc2d9dcee8580fb31.tar.gz
gcc-765f1bf9e4451e97ccfba21bc2d9dcee8580fb31.tar.bz2
gcc.c (init_gcc_specs): If HAVE_LD_AS_NEEDED, link with -lgcc --as-needed -lgcc_s --no-as-needed by default.
* gcc.c (init_gcc_specs): If HAVE_LD_AS_NEEDED, link with -lgcc --as-needed -lgcc_s --no-as-needed by default. * configure.ac (HAVE_LD_AS_NEEDED): Check for ld --as-needed. * configure: Rebuilt. * config.in: Rebuilt. * Makefile.in (stage1-start): Copy also libgcc_s*$(SHLIB_EXT). (stage2-start, stage3-start, stage4-start): Likewise. (stageprofile-start, stagefeedback-start): Likewise. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r80302
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 71be65b..d69d78a 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -1533,6 +1533,12 @@ init_gcc_specs (struct obstack *obstack, const char *shared_name,
buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name,
"}%{!static:%{!static-libgcc:",
+#ifdef HAVE_LD_AS_NEEDED
+ "%{!shared-libgcc:", static_name,
+ " --as-needed ", shared_name, " --no-as-needed}"
+ "%{shared-libgcc:", shared_name, "%{!shared: ", static_name,
+ "}",
+#else
"%{!shared:%{!shared-libgcc:", static_name, " ",
eh_name, "}%{shared-libgcc:", shared_name, " ",
static_name, "}}%{shared:",
@@ -1542,6 +1548,7 @@ init_gcc_specs (struct obstack *obstack, const char *shared_name,
#else
shared_name,
#endif
+#endif
"}}}", NULL);
obstack_grow (obstack, buf, strlen (buf));