[cfe-commits] r162075 - in /cfe/trunk: lib/Driver/Tools.cpp test/Driver/Xlinker-args.c

Nick Lewycky nicholas at mxc.ca
Thu Aug 16 20:39:16 PDT 2012


Author: nicholas
Date: Thu Aug 16 22:39:16 2012
New Revision: 162075

URL: http://llvm.org/viewvc/llvm-project?rev=162075&view=rev
Log:
Fix -Wl,--no-demangle to actually pass the flag to the linker on Linux instead
of silently dropping it on the floor.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/Xlinker-args.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=162075&r1=162074&r2=162075&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Aug 16 22:39:16 2012
@@ -5723,6 +5723,9 @@
     CmdArgs.push_back(Args.MakeArgString(Plugin));
   }
 
+  if (Args.hasArg(options::OPT_Z_Xlinker__no_demangle))
+    CmdArgs.push_back("--no-demangle");
+
   AddLinkerInputs(ToolChain, Inputs, Args, CmdArgs);
 
   if (D.CCCIsCXX &&

Modified: cfe/trunk/test/Driver/Xlinker-args.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/Xlinker-args.c?rev=162075&r1=162074&r2=162075&view=diff
==============================================================================
--- cfe/trunk/test/Driver/Xlinker-args.c (original)
+++ cfe/trunk/test/Driver/Xlinker-args.c Thu Aug 16 22:39:16 2012
@@ -4,6 +4,13 @@
 // RUN: %clang -target i386-apple-darwin9 -### \
 // RUN:   -Xlinker one -Xlinker --no-demangle \
 // RUN:   -Wl,two,--no-demangle,three -Xlinker four %s 2> %t
-// RUN: FileCheck < %t %s
+// RUN: FileCheck -check-prefix=DARWIN < %t %s
 //
-// CHECK: "one" "two" "three" "four"
+// RUN: %clang -target x86_64-pc-linux-gnu -### \
+// RUN:   -Xlinker one -Xlinker --no-demangle \
+// RUN:   -Wl,two,--no-demangle,three -Xlinker four %s 2> %t
+// RUN: FileCheck -check-prefix=LINUX < %t %s
+//
+// DARWIN-NOT: --no-demangle
+// DARWIN: "one" "two" "three" "four"
+// LINUX: "--no-demangle" "one" "two" "three" "four"





More information about the cfe-commits mailing list