From b7e163427b70d5c115bd98b1bf94164cff563b2a Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Tue, 9 May 2017 17:47:50 +0000 Subject: [PATCH] [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302558 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChains/WebAssembly.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Driver/ToolChains/WebAssembly.cpp b/lib/Driver/ToolChains/WebAssembly.cpp index 123a1516f1..3471569b68 100644 --- a/lib/Driver/ToolChains/WebAssembly.cpp +++ b/lib/Driver/ToolChains/WebAssembly.cpp @@ -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")); } -- 2.40.0