Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set BINARYEN_TRAP_MODE=clamp #55845

Merged
merged 1 commit into from
Nov 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/librustc_target/spec/wasm32_unknown_emscripten.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
use super::{LinkArgs, LinkerFlavor, Target, TargetOptions};

pub fn target() -> Result<Target, String> {
// FIXME(nikic) BINARYEN_TRAP_MODE=clamp is needed to avoid trapping in our
// -Zsaturating-float-casts implementation. This can be dropped if/when
// we have native fpto[su]i.sat intrinsics, or the implementation otherwise
// stops relying on non-trapping fpto[su]i.
let mut post_link_args = LinkArgs::new();
post_link_args.insert(LinkerFlavor::Em,
vec!["-s".to_string(),
"BINARYEN=1".to_string(),
"-s".to_string(),
"ERROR_ON_UNDEFINED_SYMBOLS=1".to_string()]);
"ERROR_ON_UNDEFINED_SYMBOLS=1".to_string(),
"-s".to_string(),
"BINARYEN_TRAP_MODE='clamp'".to_string()]);

let opts = TargetOptions {
dynamic_linking: false,
Expand Down