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

LTO no longer appears to work with wasm-bindgen #560

Closed
AugmentedFifth opened this issue Jul 26, 2018 · 2 comments
Closed

LTO no longer appears to work with wasm-bindgen #560

AugmentedFifth opened this issue Jul 26, 2018 · 2 comments

Comments

@AugmentedFifth
Copy link

I may just be doing something wrong, but it appears that turning on LTO gives wasm-bindgen a hard time resolving imports. Although I can compile, use wasm-bindgen, wasm-gc, etc. without any warnings or errors, I end up at runtime with messages like Module not found: Error: Can't resolve 'env' with the two offending lines in the resulting .wasm being:

  (import "env" "_ZN4core9panicking18panic_bounds_check17hc53f1bd1a37ebcdeE" (func $core::panicking::panic_bounds_check::hc53f1bd1a37ebcde (type $t8)))
  (import "env" "_ZN4core9panicking5panic17h04cfbe531d9ab9f6E" (func $core::panicking::panic::h04cfbe531d9ab9f6 (type $t1)))

Setting lto = false in Cargo.toml fixes this. However, previous versions (<=0.2.13) seemed to work fine with LTO, so I'm not sure what's up.

@alexcrichton
Copy link
Contributor

Thanks for the report! I think this is due to rust-lang/libm#129 which is being fixed in upstream rust-lang/rust#52724. Unfortunately there's no great workaround for now except lto = false, but it should hopefully be fixed soon!

@alexcrichton
Copy link
Contributor

Alright I'm gonna close this now that fixes should be upstream, just waiting on a new nightly now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants