From f4b4e08db0482a267a6ffe639b99019027bf610c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 21 Dec 2015 23:30:41 +0000 Subject: [PATCH] [WebAssembly] Remove the -target command-line flag from the ld commandline. This flag isn't needed, or permitted, with the "ld" flavor of lld. Also, add a basic ld commandline test. llvm-svn: 256216 --- clang/lib/Driver/Tools.cpp | 2 -- clang/test/Driver/wasm-toolchain.c | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 clang/test/Driver/wasm-toolchain.c diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 5457028..efba28c 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -6516,8 +6516,6 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA, ArgStringList CmdArgs; CmdArgs.push_back("-flavor"); CmdArgs.push_back("ld"); - CmdArgs.push_back("-target"); - CmdArgs.push_back(Args.MakeArgString(getToolChain().getTripleString())); AddLinkerInputs(getToolChain(), Inputs, Args, CmdArgs); CmdArgs.push_back("-o"); CmdArgs.push_back(Output.getFilename()); diff --git a/clang/test/Driver/wasm-toolchain.c b/clang/test/Driver/wasm-toolchain.c new file mode 100644 index 0000000..6e3d84c --- /dev/null +++ b/clang/test/Driver/wasm-toolchain.c @@ -0,0 +1,3 @@ +// RUN: %clang -### -target wasm32-unknown-unknown -x assembler %s 2>&1 | FileCheck -check-prefix=AS_LINK %s +// AS_LINK: clang{{.*}}" "-cc1as" {{.*}} "-o" "[[temp:[^"]*]]" +// AS_LINK: lld" "-flavor" "ld" "[[temp]]" "-o" "a.out" -- 2.7.4