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

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

Open
jrandall opened this issue Jun 14, 2019 · 1 comment
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.

Comments

@jrandall
Copy link

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?

@jonas-schievink jonas-schievink added A-linkage Area: linking into static, shared libraries and binaries 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. A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. and removed A-linkage Area: linking into static, shared libraries and binaries labels Aug 6, 2019
@jrandall
Copy link
Author

I believe this issue should have resolved itself from rust 1.38.0, as that has updated to llvm 9.0 which I believe no longer emits this particular warning for C++ code in wasm. I will verify this and update here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants