path: root/.gitmodules
diff options
authorAlex Crichton <>2017-08-26 18:30:12 -0700
committerAlex Crichton <>2018-03-03 20:21:35 -0800
commitd69b24805b5071e5ec9e62d2777a761723644144 (patch)
treef4b8f9d6205f7eb73ddc124457d2bc03f364f292 /.gitmodules
parentAuto merge of #48600 - Mark-Simulacrum:rustbuild-updates-2, r=alexcrichton (diff)
rust: Import LLD for linking wasm objects
This commit imports the LLD project from LLVM to serve as the default linker for the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently removed along with "binaryen linker" support in rustc. Moving to LLD brings with it a number of benefits for wasm code: * LLD is itself an actual linker, so there's no need to compile all wasm code with LTO any more. As a result builds should be *much* speedier as LTO is no longer forcibly enabled for all builds of the wasm target. * LLD is quickly becoming an "official solution" for linking wasm code together. This, I believe at least, is intended to be the main supported linker for native code and wasm moving forward. Picking up support early on should help ensure that we can help LLD identify bugs and otherwise prove that it works great for all our use cases! * Improvements to the wasm toolchain are currently primarily focused around LLVM and LLD (from what I can tell at least), so it's in general much better to be on this bandwagon for bugfixes and new features. * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which means a postprocessor is no longer needed to show off Rust's "small wasm binary size". LLD is added in a pretty standard way to rustc right now. A new rustbuild target was defined for building LLD, and this is executed when a compiler's sysroot is being assembled. LLD is compiled against the LLVM that we've got in tree, which means we're currently on the `release_60` branch, but this may get upgraded in the near future! LLD is placed into rustc's sysroot in a `bin` directory. This is similar to where `gcc.exe` can be found on Windows. This directory is automatically added to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd` linker which implements the interface that `wasm-ld`, LLD's frontend, expects. Like Emscripten the LLD target is currently only enabled for Tier 1 platforms, notably OSX/Windows/Linux, and will need to be installed manually for compiling to wasm on other platforms. LLD is by default turned off in rustbuild, and requires a `config.toml` option to be enabled to turn it on. Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD has a native option for controlling this. [gc]:
Diffstat (limited to '.gitmodules')
1 files changed, 3 insertions, 3 deletions
diff --git a/.gitmodules b/.gitmodules
index 5b7fd48129..55f586389b 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -41,9 +41,6 @@
41[submodule "src/dlmalloc"] 41[submodule "src/dlmalloc"]
42 path = src/dlmalloc 42 path = src/dlmalloc
43 url = 43 url =
44[submodule "src/binaryen"]
45 path = src/binaryen
46 url =
47[submodule "src/doc/rust-by-example"] 44[submodule "src/doc/rust-by-example"]
48 path = src/doc/rust-by-example 45 path = src/doc/rust-by-example
49 url = 46 url =
@@ -53,3 +50,6 @@
53[submodule "src/stdsimd"] 50[submodule "src/stdsimd"]
54 path = src/stdsimd 51 path = src/stdsimd
55 url = 52 url =
53[submodule "src/tools/lld"]
54 path = src/tools/lld
55 url =