diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2002-02-25 13:25:11 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2002-02-25 13:25:11 +0000 |
commit | 5c1817565f2c0f669634fab893d03cc83c215a4f (patch) | |
tree | 29cb77e79aa665ff931f60954f69d12aa92ba88f /gcc/gcc.c | |
parent | f36bcb2d6bfa52ba2db71bfdff8f247086945fc2 (diff) | |
download | gcc-5c1817565f2c0f669634fab893d03cc83c215a4f.zip gcc-5c1817565f2c0f669634fab893d03cc83c215a4f.tar.gz gcc-5c1817565f2c0f669634fab893d03cc83c215a4f.tar.bz2 |
gcc.c (init_gcc_specs): Get -shared-libgcc along with -shared to link with shared_name only.
* gcc.c (init_gcc_specs): Get -shared-libgcc along with -shared to
link with shared_name only.
* doc/invoke.texi (Link Options): Document new behavior.
From-SVN: r50025
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 34 |
1 files changed, 13 insertions, 21 deletions
@@ -1414,31 +1414,23 @@ init_gcc_specs (obstack, shared_name, static_name, eh_name) const char *static_name; const char *eh_name; { - char buffer[128]; - const char *p; + char *buf; - /* If we see -shared-libgcc, then use the shared version. */ - sprintf (buffer, "%%{shared-libgcc:%s %s}", shared_name, static_name); - obstack_grow (obstack, buffer, strlen (buffer)); - /* If we see -static-libgcc, then use the static version. */ - sprintf (buffer, "%%{static-libgcc:%s %s}", static_name, eh_name); - obstack_grow (obstack, buffer, strlen (buffer)); - /* Otherwise, if we see -shared, then use the shared version - if using EH registration routines or static version without - exception handling routines otherwise. */ - p = "%{!shared-libgcc:%{!static-libgcc:%{shared:"; - obstack_grow (obstack, p, strlen (p)); + buf = concat ("%{!shared:%{!shared-libgcc:", static_name, " ", + eh_name, "}%{shared-libgcc:", shared_name, " ", + static_name, "}}", + "%{shared:%{static-libgcc:", static_name, " ", + eh_name, "}%{!static-libgcc:", #ifdef LINK_EH_SPEC - sprintf (buffer, "%s}}}", static_name); + "%{shared-libgcc:", shared_name, + "}%{!shared-libgcc:", static_name, "}", #else - sprintf (buffer, "%s}}}", shared_name); + shared_name, #endif - obstack_grow (obstack, buffer, strlen (buffer)); - /* Otherwise, use the static version. */ - sprintf (buffer, - "%%{!shared-libgcc:%%{!static-libgcc:%%{!shared:%s %s}}}", - static_name, eh_name); - obstack_grow (obstack, buffer, strlen (buffer)); + "}}", NULL); + + obstack_grow (obstack, buf, strlen (buf)); + free (buf); } #endif /* ENABLE_SHARED_LIBGCC */ |