re PR bootstrap/31906 ("-Xcompiler" is inserted after "-Xlinker" when building libstdc++)
authorPaul Jarc <prj-bugzilla-gcc@multivac.cwru.edu>
Thu, 20 Sep 2007 10:20:05 +0000 (10:20 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 20 Sep 2007 10:20:05 +0000 (10:20 +0000)
2007-09-20  Paul Jarc  <prj-bugzilla-gcc@multivac.cwru.edu>

PR bootstrap/31906
* libtool-ldflags: Don't prefix arguments with -Xcompiler if
        they're already prefixed.

From-SVN: r128617

ChangeLog
libtool-ldflags

index 9d9940072f956dcede987d22a3ed51b54e9b97a6..e57e59df468d6945dd5361ff6d17e500ed39f78a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-09-20  Paul Jarc  <prj-bugzilla-gcc@multivac.cwru.edu>
+
+       PR bootstrap/31906
+       * libtool-ldflags: Don't prefix arguments with -Xcompiler if
+        they're already prefixed.
+
 2007-09-19  Benjamin Kosnik  <bkoz@redhat.com>
 
        * configure.ac (TOPLEVEL_CONFIGURE_ARGUMENTS): Move libgomp before
index 6321747b4a95b4163d9e847f1b529cef98bae6f7..e32e37bf10dd5a5af7648b64ae648e80bcf44b5f 100755 (executable)
@@ -31,6 +31,7 @@
 # The output of the script.  This string is built up as we process the
 # arguments.
 result=
+prev_arg=
 
 for arg
 do
@@ -43,13 +44,21 @@ do
            # options.  So, we prefix these options with -Xcompiler to
            # make clear to libtool that they are in fact compiler
            # options.
-           result="$result -Xcompiler" 
+           case $prev_arg in
+               -Xpreprocessor|-Xcompiler|-Xlinker)
+                   # This option is already prefixed; don't prefix it again.
+                   ;;
+               *)
+                   result="$result -Xcompiler"
+                   ;;
+           esac
            ;;
        *)
            # We do not want to add -Xcompiler to other options because
            # that would prevent libtool itself from recognizing them.
            ;;
     esac
+    prev_arg=$arg
 
     # If $(LDFLAGS) is (say):
     #   a "b'c d" e