Files
rust/src/librustc_target/spec/asmjs_unknown_emscripten.rs
T
Thomas Lively 9a55103b98 Upgrade Emscripten targets to use upstream LLVM backend
- Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the incorrect wasm32 C call ABI with the old asmjs
   version, which is correct for both wasm32 and JS.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Temporarily makes Emscripten targets use panic=abort by default
   because supporting unwinding will require an LLVM patch.
2019-10-04 00:47:21 -07:00

11 lines
335 B
Rust

use super::{LinkerFlavor, Target, wasm32_unknown_emscripten};
pub fn target() -> Result<Target, String> {
let mut target = wasm32_unknown_emscripten::target()?;
target.options.post_link_args
.entry(LinkerFlavor::Em)
.or_default()
.extend(vec!["-s".to_string(), "WASM=0".to_string()]);
Ok(target)
}