From c7e5ac45ecaa5390c683161852b23d74a14673b0 Mon Sep 17 00:00:00 2001 From: dje Date: Tue, 16 Jun 2009 18:51:54 +0000 Subject: [PATCH] * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++. cp/ * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL. (lang_specific_driver): Always allocate extra argument. Add LIBSTDCXX_STATIC to arglist if defined and linking statically. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148546 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/config/rs6000/aix.h | 2 +- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/g++spec.c | 18 +++++++++++++----- 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b73fc346c7..77ec0a1b243 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2009-06-16 David Edelsohn + * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++. + +2009-06-16 David Edelsohn + * doc/install.texi (*-*-aix): Update explanation of XLC bootstrap. GCC can bootstrap on AIX with GNU Binutils 2.20. diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index b9f1bcadb1a..44015a348b7 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -148,7 +148,7 @@ %{p:-L%R/lib/profiled -L%R/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc" /* Static linking with shared libstdc++ requires libsupc++ as well. */ -#define LIBSTDCXX_STATIC "-lstdc++ -lsupc++" +#define LIBSTDCXX_STATIC "-lsupc++" /* This now supports a natural alignment mode. */ /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1366155860c..62f93a98526 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2009-06-16 David Edelsohn + + * g++-spec.c (LIBSTDCXX_STATIC): Default to NULL. + (lang_specific_driver): Always allocate extra argument. + Add LIBSTDCXX_STATIC to arglist if defined and linking + statically. + 2009-06-16 Ian Lance Taylor * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h. diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index 8828573ef54..f49d699c832 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see #define LIBSTDCXX_PROFILE LIBSTDCXX #endif #ifndef LIBSTDCXX_STATIC -#define LIBSTDCXX_STATIC LIBSTDCXX +#define LIBSTDCXX_STATIC NULL #endif void @@ -259,8 +259,9 @@ lang_specific_driver (int *in_argc, const char *const **in_argv, shared_libgcc = 0; #endif - /* Make sure to have room for the trailing NULL argument. */ - num_args = argc + added + need_math + shared_libgcc + (library > 0) + 1; + /* Make sure to have room for the trailing NULL argument. + Add one for shared_libgcc or extra static library. */ + num_args = argc + added + need_math + (library > 0) + 2; arglist = XNEWVEC (const char *, num_args); i = 0; @@ -318,8 +319,15 @@ 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] = shared_libgcc == 0 ? LIBSTDCXX_STATIC - : saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; + arglist[j] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; + if (arglist[j][0] != '-' || arglist[j][1] == 'l') + added_libraries++; + j++; + } + /* Add target-dependent static library, if necessary. */ + if (shared_libgcc == 0 && LIBSTDCXX_STATIC != NULL) + { + arglist[j] = LIBSTDCXX_STATIC; if (arglist[j][0] != '-' || arglist[j][1] == 'l') added_libraries++; j++; -- 2.11.4.GIT