r302558 - [WebAssembly] Fix location and -flavor when running lld

Sam Clegg via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 10:47:50 PDT 2017


Author: sbc
Date: Tue May  9 12:47:50 2017
New Revision: 302558

URL: http://llvm.org/viewvc/llvm-project?rev=302558&view=rev
Log:
[WebAssembly] Fix location and -flavor when running lld

Add the toolchain installation directory to the program
path so that lld can be found.

Change -flavor to wasm.  Although this new flavor hasn't
yet landed in upstream lld yet there are no point in
passing wasm objects the gnu flavor.

Differential Revision: https://reviews.llvm.org/D32976

Modified:
    cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp

Modified: cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp?rev=302558&r1=302557&r2=302558&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/WebAssembly.cpp Tue May  9 12:47:50 2017
@@ -42,7 +42,7 @@ void wasm::Linker::ConstructJob(Compilat
   const char *Linker = Args.MakeArgString(ToolChain.GetLinkerPath());
   ArgStringList CmdArgs;
   CmdArgs.push_back("-flavor");
-  CmdArgs.push_back("ld");
+  CmdArgs.push_back("wasm");
 
   // Enable garbage collection of unused input sections by default, since code
   // size is of particular importance. This is significantly facilitated by
@@ -101,6 +101,9 @@ WebAssembly::WebAssembly(const Driver &D
   : ToolChain(D, Triple, Args) {
 
   assert(Triple.isArch32Bit() != Triple.isArch64Bit());
+
+  getProgramPaths().push_back(getDriver().getInstalledDir());
+
   getFilePaths().push_back(
       getDriver().SysRoot + "/lib" + (Triple.isArch32Bit() ? "32" : "64"));
 }




More information about the cfe-commits mailing list