From 4afd7f6cc6480b94d169a6f7ec8b8a4ba77900aa Mon Sep 17 00:00:00 2001 From: Geoffrey Keating Date: Mon, 26 Jul 2004 19:24:55 +0000 Subject: g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. (lang_specific_driver): If the C++ or math library options don't start with '-l', don't count them as added libraries. From-SVN: r85201 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/g++spec.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1fb0027..329b12e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-26 Geoffrey Keating + + * g++spec.c (LIBSTDCXX_PROFILE): Default to LIBSTDCXX. + (lang_specific_driver): If the C++ or math library options don't + start with '-l', don't count them as added libraries. + 2004-07-26 Nathan Sidwell * decl.c (xref_basetypes): Adjust base access vector creation. diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 69cf186..286134b 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ #define LIBSTDCXX "-lstdc++" #endif #ifndef LIBSTDCXX_PROFILE -#define LIBSTDCXX_PROFILE "-lstdc++" +#define LIBSTDCXX_PROFILE LIBSTDCXX #endif void @@ -297,15 +297,19 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, /* Add `-lstdc++' if we haven't already done so. */ if (library > 0) { - arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; - added_libraries++; + arglist[j] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; + if (arglist[j][0] != '-' || arglist[j][1] == 'l') + added_libraries++; + j++; } if (saw_math) arglist[j++] = saw_math; else if (library > 0 && need_math) { - arglist[j++] = saw_profile_flag ? MATH_LIBRARY_PROFILE : MATH_LIBRARY; - added_libraries++; + arglist[j] = saw_profile_flag ? MATH_LIBRARY_PROFILE : MATH_LIBRARY; + if (arglist[j][0] != '-' || arglist[j][1] == 'l') + added_libraries++; + j++; } if (saw_libc) arglist[j++] = saw_libc; -- cgit v1.1