Open
Description
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.)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
wasm32-unknown-unknown
build as part ofrustc
contains object files for the wrong architecture when using GCC rust-lang/compiler-builtins#732linker-messages
lint by default #136096neither Wasm object file nor LLVM bitcode
from all wasm cdylib builds #136109neither Wasm object file nor LLVM bitcode
from all wasm cdylib builds #136109 as a duplicate of this issuejyn514 commentedon Feb 10, 2025
@emilazy are you interested in fixing this? i think there are three main steps:
optionally, you could also change bootstrap to default to
clang
instead ofcc
for wasm32-unknown.i'm happy to mentor this.
@rustbot label E-mentor
JayAndJef commentedon Feb 18, 2025
Hi @jyn514! If @emilazy doesn't want to take on this issue, I would be glad to. I'm not sure if this is beyond the scope of mine or yours, however, as i'm looking for a good first issue in rustc to resolve - would you be willing to mentor?
jyn514 commentedon Feb 18, 2025
I'm still willing to mentor. I think this would be a challenging first issue but you could do it if you're motivated. There are lots of small things to change, but you will (mostly) have short feedback loops, and finding which parts of the code are relevant will not be too hard I think. Take a look at
src/bootstrap
, at the dev guide for bootstrap, and at the wasm32-unknown platform docs. This check should probably (?) live insanity.rs
, which has flaws, but it's what we have right now.JayAndJef commentedon Feb 19, 2025
I think I'll take this issue on. Are there any steps I need to take besides forking the repository, such as claiming this issue or moving to a different platform to communicate with you?
jyn514 commentedon Feb 19, 2025
both those, yeah - i think
@rustbot claim
is the current syntax?i'm on zulip as "jyn".
16 remaining items