rust/src/etc
Alex Crichton d69b24805b 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]: https://reviews.llvm.org/D42511
2018-03-03 20:21:35 -08:00
..
installer fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
natvis *.natvis: Use s8 postfixes to correctly interpret rust strings as UTF-8. 2017-07-21 03:39:56 -07:00
platform-intrinsics fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
test-float-parse fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} 2018-02-10 12:22:57 +01:00
third-party Strip all leading/trailing newlines 2015-03-15 09:08:21 -07:00
cat-and-grep.sh Replace most call to grep in run-make by a script that cat the input. 2017-11-28 23:36:12 +08:00
char_private.py regenerate libcore/char_private.rs 2017-10-26 22:32:24 -07:00
CONFIGS.md Add sublime-rust to CONFIGS.md. 2016-08-22 01:24:01 -04:00
ctags.rust Update the ctags rules and targets. 2015-07-30 06:35:42 +10:00
debugger_pretty_printers_common.py Add compat_str() which works with unicode in both Python 2 and 3 2017-06-09 19:09:02 +03:00
dec2flt_table.py Speed up dec2flt fast path with additional tables. 2016-01-12 22:25:16 +01:00
gdb_load_rust_pretty_printers.py debuginfo: Add a rust-gdb shell script that will start GDB with Rust pretty printers enabled. 2014-12-30 17:26:13 +01:00
gdb_rust_pretty_printing.py Implement display_hint in gdb pretty printers 2017-10-06 13:05:53 -06:00
generate-deriving-span-tests.py Update compile-fail tests for error message deduplication. 2017-10-25 15:02:26 +02:00
generate-keyword-tests.py Fix keyword parsing tests 2016-04-24 21:35:50 +03:00
htmldocck.py let htmldocck.py check for directories 2017-09-30 13:28:09 -05:00
indenter fix some python3 incompatibilities 2017-11-16 13:34:13 -05:00
lldb_batchmode.py debuginfo-test: Fix #45086. 2017-10-08 01:39:34 +08:00
lldb_rust_formatters.py Add pretty printing of unions in debuggers 2017-01-01 19:34:06 +10:00
rust-gdb Rename environment variable GDB_CMD to RUST_GDB to prevent ambiguity 2017-04-20 11:20:33 -04:00
rust-lldb Make rust-lldb warn about unsupported versions of LLDB 2016-07-04 19:37:36 -04:00
rust-windbg.cmd Distribute intrinsic.natvis with the compiler for windows-msvc. 2017-12-17 23:27:40 +01:00
sugarise-doc-comments.py fix some python3 incompatibilities 2017-11-16 13:34:13 -05:00
wasm32-shim.js rust: Import LLD for linking wasm objects 2018-03-03 20:21:35 -08:00
ziggurat_tables.py std: Move rand to librand. 2014-03-12 11:31:05 +11:00