diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2012-08-17 03:39:16 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2012-08-17 03:39:16 +0000 |
commit | e276cfc4e30dd3d85e3904ee270e85d5d0e309ad (patch) | |
tree | e24e93892c8b52036dd5cb4d9a4606adb82188a9 | |
parent | 0652c35a303a6186142eea566c88714c59bdc664 (diff) |
Fix -Wl,--no-demangle to actually pass the flag to the linker on Linux instead
of silently dropping it on the floor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162075 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Driver/Tools.cpp | 3 | ||||
-rw-r--r-- | test/Driver/Xlinker-args.c | 11 |
2 files changed, 12 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index b4234cfbc8..ed67f7b9a1 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -5723,6 +5723,9 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA, 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 && diff --git a/test/Driver/Xlinker-args.c b/test/Driver/Xlinker-args.c index b4e5a9b08f..d89d5bad1a 100644 --- a/test/Driver/Xlinker-args.c +++ b/test/Driver/Xlinker-args.c @@ -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" |