aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/g++spec.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-02-02 17:42:00 +0000
committerMark Mitchell <mark@codesourcery.com>2001-02-02 17:42:00 +0000
commitd6021e42bd30e0c32aa6f43fdc034e7986f4b35c (patch)
tree3e8cc7d5d1480250560533db491107be11d42779 /gcc/cp/g++spec.c
parent4640e87ee030e4753a73f761a1d88120306788cd (diff)
* gcc.c (init_gcc_specs): New function. Make -shared-libgcc
the default when building a shared object. (init_spec): Use it. * testsuite/lib/g++.exp: Include the directory where libgcc is located to the LD_LIBRARY_PATH list. * inovke.texi (-shared-libgcc): Document the cases in which * Make-lang.in (g++spec.o): Add DRIVER_DEFINES to the list of macros used when compiling g++spec.c. * g++spec.c (lang_specific_driver): Link with the shared libgcc by default. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@39408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/g++spec.c')
-rw-r--r--gcc/cp/g++spec.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 1d18a081f96..fec6434351d 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -1,5 +1,5 @@
/* Specific flags and argument handling of the C++ front-end.
- Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -82,6 +82,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* By default, we throw on the math library if we have one. */
int need_math = (MATH_LIBRARY[0] != '\0');
+ /* True if we should add -shared-libgcc to the command-line. */
+ int shared_libgcc = 1;
+
/* The total number of arguments with the new stuff. */
int argc;
@@ -160,6 +163,9 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
library = 0;
added -= 2;
}
+ else if (strcmp (argv[i], "-static-libgcc") == 0
+ || strcmp (argv[i], "-static") == 0)
+ shared_libgcc = 0;
else
/* Pass other options through. */
continue;
@@ -197,8 +203,14 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
return;
}
+ /* There's no point adding -shared-libgcc if we don't have a shared
+ libgcc. */
+#ifndef ENABLE_SHARED_LIBGCC
+ shared_libgcc = 0;
+#endif
+
/* Make sure to have room for the trailing NULL argument. */
- num_args = argc + added + need_math + 1;
+ num_args = argc + added + need_math + shared_libgcc + 1;
arglist = (const char **) xmalloc (num_args * sizeof (char *));
i = 0;
@@ -258,6 +270,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
}
if (saw_libc)
arglist[j++] = saw_libc;
+ if (shared_libgcc)
+ arglist[j++] = "-shared-libgcc";
arglist[j] = NULL;