<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>$ bin/clang -target wasm32-unknown-unknown -fuse-ld=wasm-ld -o test.wasm test.cc<br></div><div><div>clang: error: invalid linker name in argument '-fuse-ld=wasm-ld'</div></div><div><br></div><div>This here <a href="http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/ToolChain.cpp#453">http://llvm-cs.pcc.me.uk/tools/clang/lib/Driver/ToolChain.cpp#453</a> makes clang look for "ld.wasm-ld", but the wasm lld symlink is called "wasm-ld". Does the driver need updating? Is the symlink name wrong? Am I doing something wrong?</div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 7, 2018 at 2:56 PM Sam Clegg via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: sbc<br>
Date: Tue Aug 7 11:55:41 2018<br>
New Revision: 339163<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=339163&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=339163&view=rev</a><br>
Log:<br>
[WebAssembly] Remove use of lld -flavor flag<br>
<br>
This flag is deprecated. The preferred way to select the lld<br>
flavor is by calling it by one of its aliases.<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D50395" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50395</a><br>
<br>
Modified:<br>
cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp<br>
cfe/trunk/lib/Driver/ToolChains/WebAssembly.h<br>
cfe/trunk/test/Driver/wasm-toolchain.c<br>
cfe/trunk/test/Driver/wasm-toolchain.cpp<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp?rev=339163&r1=339162&r2=339163&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp?rev=339163&r1=339162&r2=339163&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp Tue Aug 7 11:55:41 2018<br>
@@ -41,8 +41,6 @@ void wasm::Linker::ConstructJob(Compilat<br>
const ToolChain &ToolChain = getToolChain();<br>
const char *Linker = Args.MakeArgString(ToolChain.GetLinkerPath());<br>
ArgStringList CmdArgs;<br>
- CmdArgs.push_back("-flavor");<br>
- CmdArgs.push_back("wasm");<br>
<br>
if (Args.hasArg(options::OPT_s))<br>
CmdArgs.push_back("--strip-all");<br>
<br>
Modified: cfe/trunk/lib/Driver/ToolChains/WebAssembly.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.h?rev=339163&r1=339162&r2=339163&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.h?rev=339163&r1=339162&r2=339163&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Driver/ToolChains/WebAssembly.h (original)<br>
+++ cfe/trunk/lib/Driver/ToolChains/WebAssembly.h Tue Aug 7 11:55:41 2018<br>
@@ -66,9 +66,7 @@ private:<br>
llvm::opt::ArgStringList &CmdArgs) const override;<br>
std::string getThreadModel() const override;<br>
<br>
- const char *getDefaultLinker() const override {<br>
- return "lld";<br>
- }<br>
+ const char *getDefaultLinker() const override { return "wasm-ld"; }<br>
<br>
Tool *buildLinker() const override;<br>
};<br>
<br>
Modified: cfe/trunk/test/Driver/wasm-toolchain.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.c?rev=339163&r1=339162&r2=339163&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.c?rev=339163&r1=339162&r2=339163&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/wasm-toolchain.c (original)<br>
+++ cfe/trunk/test/Driver/wasm-toolchain.c Tue Aug 7 11:55:41 2018<br>
@@ -12,12 +12,12 @@<br>
<br>
// A basic C link command-line.<br>
<br>
-// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=LINK %s<br>
+// RUN: %clang -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK %s<br>
// LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"<br>
-// LINK: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
+// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
<br>
// A basic C link command-line with optimization.<br>
<br>
-// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s<br>
+// RUN: %clang -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK_OPT %s<br>
// LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"<br>
-// LINK_OPT: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
+// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
<br>
Modified: cfe/trunk/test/Driver/wasm-toolchain.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.cpp?rev=339163&r1=339162&r2=339163&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/wasm-toolchain.cpp?rev=339163&r1=339162&r2=339163&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/Driver/wasm-toolchain.cpp (original)<br>
+++ cfe/trunk/test/Driver/wasm-toolchain.cpp Tue Aug 7 11:55:41 2018<br>
@@ -12,12 +12,12 @@<br>
<br>
// A basic C++ link command-line.<br>
<br>
-// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo --stdlib=c++ -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=LINK %s<br>
+// RUN: %clangxx -### -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo --stdlib=c++ -fuse-ld=wasm-ld %s 2>&1 | FileCheck -check-prefix=LINK %s<br>
// LINK: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"<br>
-// LINK: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
+// LINK: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
<br>
// A basic C++ link command-line with optimization.<br>
<br>
-// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s --stdlib=c++ -fuse-ld=lld 2>&1 | FileCheck -check-prefix=LINK_OPT %s<br>
+// RUN: %clangxx -### -O2 -no-canonical-prefixes -target wasm32-unknown-unknown --sysroot=/foo %s --stdlib=c++ -fuse-ld=wasm-ld 2>&1 | FileCheck -check-prefix=LINK_OPT %s<br>
// LINK_OPT: clang{{.*}}" "-cc1" {{.*}} "-o" "[[temp:[^"]*]]"<br>
-// LINK_OPT: lld{{.*}}" "-flavor" "wasm" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
+// LINK_OPT: wasm-ld{{.*}}" "-L/foo/lib" "crt1.o" "[[temp]]" "-lc++" "-lc++abi" "-lc" "{{.*[/\\]}}libclang_rt.builtins-wasm32.a" "-o" "a.out"<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>