]> git.lizzy.rs Git - rust.git/commit
Auto merge of #39490 - RReverser:em-linker, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 10 Feb 2017 23:50:46 +0000 (23:50 +0000)
committerbors <bors@rust-lang.org>
Fri, 10 Feb 2017 23:50:46 +0000 (23:50 +0000)
commit064a0ee131b3129fcad68570975ccc85d0fb54d0
treed2dd7fe6c3985a6c08e9f1aeca66986467016d7d
parent2425b227742bb9214d60429d1325816e0b93e152
parentf35b598bbf3bb86f70c731b8ef981beada052a08
Auto merge of #39490 - RReverser:em-linker, r=alexcrichton

Add Emscripten-specific linker

Emscripten claims to accept most GNU linker options, but in fact most of `-Wl,...` are useless for it and instead it requires some additional special options which are easier to handle in a separate trait.

Currently added:
 - `export_symbols`: works on executables as special Emscripten case since staticlibs/dylibs aren't compiled to JS, while exports are required to be accessible from JS.
Fixes #39171.
 - `optimize` - translates Rust's optimization level to Emscripten optimization level (whether passed via `-C opt-level=...` or `-O...`).
Fixes #36899.
 - `debuginfo` - translates debug info; Emscripten has 5 debug levels while Rust has 3, so chose to translate `-C debuginfo=1` to `-g3` (preserves whitespace, variable and function names for easy debugging).
Fixes #36901.
 - `no_default_libraries` - tells Emscripten to exclude `memcpy` and co.

TODO (in future PR): dynamic linking via `SIDE_MODULE` / `MAIN_MODULE` mechanism.