-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Linker invocation for wasm32-unknown-unknown incompatibly changed between 1.66.1 and 1.67.1 #108910
Comments
I think that was #104137, which removed |
Indeed, So that seems like strong evidence for what the relevant change was here. My next question is: What should we do about this? Should we readd |
Explicitly adding |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium |
Sorry, @bjorn3 , I don't know how to interpret your suggestion. In particular, who should be responsible for adding
|
The compiler itself. The target specification has a list of linker arguments to pass. As I understand it we used to pass this before as side effect of using link-self-contained, but now it needs to be made explicit in the target spec. |
Okay, great. That sounds like you're in favor then of @cuviper 's idea of having an explicit flag in the target spec, as they mentioned on zulip over here, specifically a (On the other hand, on that same zulip topic thread, @sunfishcode advised not adding a new flag, and "just" reverting the change to |
Targets also have the ability to add explicit link args: rust/compiler/rustc_target/src/spec/mod.rs Lines 1772 to 1784 in 39f2657
But given that we already have the |
…that-broke-wasm-linker-overriding, r=petrochenkov Rollback part of pr 104137 that broke wasm linker overriding This is a quick fix to address rust-lang#108910
I ran this sequence of commands via
rustup
to install 1.66.1 and 1.67.1, as well as the target support for wasm32-unknown-unknown for each, and then tried to compile acdylib
for wasm32-unknown-unknown while also overriding the linker.I expected to see this happen: a command sequence that worked under 1.66.1 to continue working under 1.67.1
Instead, this happened: A linker failure that is somewhat inscrutable to a layperson.
Note: There is a relatively easy workaround available. Under 1.66.1 when passing
-C linker=clang
, the linker invocation also included the argument-nostartfiles
. For some reason, that argument has gone away under 1.67.1 with this invocation sequence, but one can re-add it manually by passing-C link-arg=-nostartfiles
intorustc
.The questions I have are:
-C linker-flavor=xxx
to tellrustc
that it needs to pass along parameters compatible with usingclang
as a linker? (But if that is the case, I do not seeclang
listed as one of the available values forlinker-flavor
)rustc
itself -- and still spit out those linker errors (because in the general case, the user is going to need to see them in order to make sense of what to do in reaction), but potentially also provide hints as to things to look into (e.g. in this case, maybe thecrt1.o
in the error could be used as a hint to look at the-nostartfiles
option as something to pass to the linker).The text was updated successfully, but these errors were encountered: