]> git.lizzy.rs Git - rust.git/commitdiff
Compile WASM as WASM instead of asm.js
authorChristopher Serr <cryze92@gmail.com>
Fri, 14 Apr 2017 17:17:03 +0000 (19:17 +0200)
committerGitHub <noreply@github.com>
Fri, 14 Apr 2017 17:17:03 +0000 (19:17 +0200)
Looks like the LinkerFlavor change introduced in #40018 accidentally uses GCC for the WebAssembly target, causing Rust to never actually pass the post link args to emscripten. This then causes the code to be compiled as asm.js instead of WebAssembly, because the Binaryen tools never run due to the missing linker argument.

src/librustc_back/target/wasm32_unknown_emscripten.rs

index a51f59d6ff1925e9222fce68a01ef378c92dec12..f5fb63038e9172926db0c7e34da47a489e0bc14e 100644 (file)
@@ -14,7 +14,7 @@
 
 pub fn target() -> Result<Target, String> {
     let mut post_link_args = LinkArgs::new();
-    post_link_args.insert(LinkerFlavor::Gcc,
+    post_link_args.insert(LinkerFlavor::Em,
                           vec!["-s".to_string(),
                                "BINARYEN=1".to_string(),
                                "-s".to_string(),