This website requires JavaScript.
Explore
Help
Register
Sign In
mikros
/
rust
Watch
1
Star
0
Fork
0
You've already forked rust
Code
Issues
Pull Requests
Packages
Projects
Releases
Wiki
Activity
50a46710a9
rust
/
tests
/
run-make
/
wasm-export-all-symbols
/
bar.rs
8 lines
101 B
Rust
Raw
Normal View
History
Unescape
Escape
wasm: Explicitly export all symbols with LLD This commit fixes an oddity on the wasm target where LTO can produce working executables but plain old optimizations doesn't. The compiler already knows what set of symbols it would like to export, but LLD only discovers this list transitively through symbol visibilities. LLD may not, however, always find all the symbols that we'd like to export. For example if you depend on an rlib with a `#[no_mangle]` symbol, then if you don't actually use anything from the rlib then the symbol won't appear in the final artifact! It will appear, however, with LTO. This commit attempts to rectify this situation by ensuring that all symbols rustc would otherwise preserve through LTO are also preserved through the linking process with LLD by default.
2018-10-02 15:49:51 -05:00
#![
crate_type =
"
rlib
"
]
#[
no_mangle
]
pub
extern
fn
foo
(
)
{
}
Add tests for static variables
2020-01-07 12:37:24 -06:00
#[
no_mangle
]
pub
static
FOO
:
u64
=
42
;
Reference in New Issue
Copy Permalink