rustc fails when including some C++ libs because of wasm32 linker fatal warnings #61846
Labels
A-linkage
Area: linking into static, shared libraries and binaries
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
C-bug
Category: This is a bug.
O-wasm
Target: WASM (WebAssembly), http://webassembly.org/
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
rustc is now passing the argument
--fatal-warnings
to lld on wasm32 (wasm-ld). This appears to have been added in #54258While I agree with the sentiment in the comment "Rust code should never have warnings, and warnings are often indicative of bugs, let's prevent them", unfortunately the same cannot apparently be said of C++ code.
I am currently getting bitten by "harmless" warnings due to a bug in LLVM: https://bugs.llvm.org/show_bug.cgi?id=40412
Unfortunately, because rustc is passing
--fatal-warnings
to wasm-ld, these warnings are not harmless to me but rather prevent me from linking the C++ library into my rust project.I looked for an override such as
--no-fatal-warnings
but there does not appear to be one. Could we perhaps add an option to rustc such that the--fatal-warnings
option can be suppressed (maybe via RUSTFLAGS) in cases where for whatever reason we run into otherwise harmless LLVM warnings?The text was updated successfully, but these errors were encountered: