This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] PR31906


This patch fixes PR 31906, a build problem introduced in 4.2.
Possibly all options that take a separate argument should be handled
this way, although some of them are unlikely to take an argument
starting with "--" or "-f".

I'm not subscribed; Mail-Followup-To set.

	* libtool-ldflags: Don't prefix arguments with -Xcompiler if
	they're already prefixed.
--- /package/host/code.dogmap.org/foreign/gcc-4.2.0/compile/src/gcc-4.2.0/libtool-ldflags	2006-01-02 19:30:04.000000000 -0500
+++ libtool-ldflags	2007-07-05 22:47:29.000000000 -0400
@@ -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 @@
 	    # 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]