summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2017-05-09 17:47:50 +0000
committerSam Clegg <sbc@chromium.org>2017-05-09 17:47:50 +0000
commit27ea1567a4d0ae5e42cb1a5e96367e9fc1208574 (patch)
tree48b72bba07f883c7ceedacc079d7e22c00560e26
parent7855510ae3728dbbfc65e119f5e8460c91510820 (diff)
downloadbcm5719-llvm-27ea1567a4d0ae5e42cb1a5e96367e9fc1208574.tar.gz
bcm5719-llvm-27ea1567a4d0ae5e42cb1a5e96367e9fc1208574.zip
[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 llvm-svn: 302558
-rw-r--r--clang/lib/Driver/ToolChains/WebAssembly.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Driver/ToolChains/WebAssembly.cpp b/clang/lib/Driver/ToolChains/WebAssembly.cpp
index 123a1516f1e..3471569b688 100644
--- a/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ b/clang/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"));
}
OpenPOWER on IntegriCloud