]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aix.h (LIBSTDCXX_STATIC): Remove -lstdc++.
authorDavid Edelsohn <edelsohn@gnu.org>
Tue, 16 Jun 2009 18:51:54 +0000 (18:51 +0000)
committerDavid Edelsohn <dje@gcc.gnu.org>
Tue, 16 Jun 2009 18:51:54 +0000 (14:51 -0400)
        * 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.

From-SVN: r148546

gcc/ChangeLog
gcc/config/rs6000/aix.h
gcc/cp/ChangeLog
gcc/cp/g++spec.c

index 1b73fc346c75f16f70472faa50cd0443b40daa1b..77ec0a1b2435093d98bee1da5210cbed4287ad1f 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-16  David Edelsohn  <edelsohn@gnu.org>
+
+       * config/rs6000/aix.h (LIBSTDCXX_STATIC): Remove -lstdc++.
+
 2009-06-16  David Edelsohn  <edelsohn@gnu.org>
 
        * doc/install.texi (*-*-aix): Update explanation of XLC bootstrap.
index b9f1bcadb1a0a16e81f4b00d17010845423d351c..44015a348b7f8c5fcc0ade5bfb11e118eb170ea0 100644 (file)
 %{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.  */
index 1366155860cb713a409f4e8c4c603c4a4f12780f..62f93a98526b88680492e233a581f0f7c14d5df5 100644 (file)
@@ -1,3 +1,10 @@
+2009-06-16  David Edelsohn  <edelsohn@gnu.org>
+
+       * 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  <iant@google.com>
 
        * Make-lang.in (cp/class.o): Depend upon gt-cp-class.h.
index 8828573ef540cc26e8e54f7f22576a7692690132..f49d699c83281a955eece6bb20306e57872efd27 100644 (file)
@@ -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++;