fix(compiler/rustc_target): set correct linker flags for wasm32v1-none by StackOverflowExcept1on · Pull Request #145539 · rust-lang/rust (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For wasm32v1-none it is maybe not all that relevant given that you probably don't want to enable any extra features, but for wasm32-unknown-unknown or wasm32-wasip1/2 if I use for example -Clinker-plugin-lto -Ctarget-features=+simd128 I would expect all functions to be compiled with simd128 enabled (including standard library functions) even if the leaf crate is empty (and thus nothing otherwise forces simd128 to be enabled). Supporting this requires passing --mllvm=-mcpu= and --mllvm=-mattr= in

fn push_linker_plugin_lto_args(&mut self) {

, at which point wasm32v1-none should behave correctly too without having to change the target spec afaik.