]> granicus.if.org Git - clang/commitdiff
[WebAssembly] Fix location and -flavor when running lld
authorSam Clegg <sbc@chromium.org>
Tue, 9 May 2017 17:47:50 +0000 (17:47 +0000)
committerSam Clegg <sbc@chromium.org>
Tue, 9 May 2017 17:47:50 +0000 (17:47 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302558 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains/WebAssembly.cpp

index 123a1516f1e7e69f1bcc9ae493d5a8d6cc76c3a8..3471569b688494a588ea310cfe1231f15a244fe3 100644 (file)
@@ -42,7 +42,7 @@ void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,
   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, const llvm::Triple &Triple,
   : ToolChain(D, Triple, Args) {
 
   assert(Triple.isArch32Bit() != Triple.isArch64Bit());
+
+  getProgramPaths().push_back(getDriver().getInstalledDir());
+
   getFilePaths().push_back(
       getDriver().SysRoot + "/lib" + (Triple.isArch32Bit() ? "32" : "64"));
 }