diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 44b888e8537..3a8fe7013ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-11-06 David Edelsohn + + PR target/26397 + * config/rs6000/aix.h (LIBSTDCXX_STATIC): Define. + 2008-11-06 Kazu Hirata PR target/35574 diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 48072988f33..4dc2e5034ab 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -155,6 +155,9 @@ #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\ %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}} -lc" +/* Static linking with shared libstdc++ requires libsupc++ as well. */ +#define LIBSTDCXX_STATIC "-lstdc++ -lsupc++" + /* This now supports a natural alignment mode. */ /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */ #define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 55a81ec3f4f..ec7a1aa5263 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2008-11-06 David Edelsohn + + PR target/26397 + * g++spec.c (LIBSTDCXX_STATIC): New. + (lang_spec_driver): Use LIBSTDCXX_STATIC when not + shared_libgcc. + 2008-11-05 Fabien Chene PR c++/35219 diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c index a19a35fa348..c161e99aad2 100644 --- a/gcc/cp/g++spec.c +++ b/gcc/cp/g++spec.c @@ -44,6 +44,9 @@ along with GCC; see the file COPYING3. If not see #ifndef LIBSTDCXX_PROFILE #define LIBSTDCXX_PROFILE LIBSTDCXX #endif +#ifndef LIBSTDCXX_STATIC +#define LIBSTDCXX_STATIC LIBSTDCXX +#endif void lang_specific_driver (int *in_argc, const char *const **in_argv, @@ -315,7 +318,8 @@ 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; + arglist[j] = shared_libgcc == 0 ? LIBSTDCXX_STATIC + : saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX; if (arglist[j][0] != '-' || arglist[j][1] == 'l') added_libraries++; j++;