Skip to content

rustc fails when including some C++ libs because of wasm32 linker fatal warnings #61846

Open
@jrandall

Description

@jrandall

rustc is now passing the argument --fatal-warnings to lld on wasm32 (wasm-ld). This appears to have been added in #54258

While 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions