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

Official binaries for wasm32-unknown-unknown (and potentially other WASM platforms?) contain code for the wrong architecture #132802

Open
emilazy opened this issue Nov 9, 2024 · 0 comments
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@emilazy
Copy link

emilazy commented Nov 9, 2024

The compiler-builtins crate compiles C code for WASM platforms since rust-lang/compiler-builtins#566. This works if the C compiler is Clang, as it passes the appropriate -target. However, in a GCC build environment this means that the cc crate will end up silently compiling code for the wrong architecture entirely. This means that, for example, the compiler-builtins shipping for wasm32-unknown-unknown via Rustup contains object files like the following:

45c91108d938afe8-cmpti2.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), with debug_info, not stripped

I suppose that the build for these needs to arrange for Clang to be present, or perhaps even specified explicitly in the target.*.{cc,cxx,linker} settings.

(Was redirected here from rust-lang/compiler-builtins#732.)

@emilazy emilazy added the C-bug Category: This is a bug. label Nov 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 9, 2024
@bjorn3 bjorn3 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) O-wasm Target: WASM (WebAssembly), http://webassembly.org/ labels Nov 9, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants