-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix link failure on AVR (incompatible ISA error) #137830
Conversation
Fixes rust-lang#137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) and trying to get the ISA revision from there. This commit uses the `target-cpu` option instead, which is already required to be present for the target. Co-authored-by: tones111 <[email protected]>
Failed to set assignee to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a nice one - wonder why my earlier tests worked then 🤔 Anyway, good to have it fixed.
Did you happen to test with atmega328p? That one linked properly, I guess it's still a default somewhere. Or maybe you built something that didn't require linking with avr-gcc/avr-ld? In any case, your work is already really good, the change toward avr-none was a nice improvement over having to write JSON specs for everything. |
@bors r+ rollup |
…r=workingjubilee Fix link failure on AVR (incompatible ISA error) Fixes rust-lang#137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) while also trying to get the ISA revision from the target spec. This commit uses the `target-cpu` option instead, which is already required to be present for the target. r? compiler cc `@Patryk27`
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#137804 (rename BackendRepr::Vector → SimdVector) - rust-lang#137807 (Fully qualify `Result` in generated doctest code) - rust-lang#137809 (Use correct error message casing for `io::const_error`s) - rust-lang#137818 (tests: adapt for LLVM 21 changes) - rust-lang#137822 (Update query normalizer docs to not position it as the greatest pioneer in the space of normalization) - rust-lang#137824 (Tweak invalid RTN errors) - rust-lang#137828 (Fix inaccurate `std::intrinsics::simd` documentation) - rust-lang#137830 (Fix link failure on AVR (incompatible ISA error)) - rust-lang#137837 (Update `const_conditions` and `explicit_implied_const_bounds` docs) - rust-lang#137840 (triagebot: only ping me for constck) r? `@ghost` `@rustbot` modify labels: rollup
Hum, I proposed this fix, but now I wonder if this approach would be better. It ensures the generic CPU default is replaced everywhere, instead of doing it just for the AVR note. Doing it like that would also help with something separate I have in mind, an implementation of which I will propose later. In avr-device, it would help a lot if we had a |
that would be a new Rust feature which has not been discussed before, I cannot sign off on that on my own, even experimentally. |
@LuigiPiucco There are a lot of nuances to why we have some target-cpu values set, that are very much not generic at all, but rather surprisingly often important for the soundness of all programs, and setting a different one makes all programs that exercise Rust's primitive types unsound, including the ones that target that CPU. Evaluating that change that affects all targets would require a much longer review cycle because I would have to work through all the implications in the backend. If you opened the PR now, I might be able to have it reviewed on March 3rd, but also depending on some things I haven't checked yet, it might be reviewed sometime in April. And the other possible work would likely require discussion of the language-level implications, such as e.g. we might now need to start recognizing every I also expect we would have requests, immediately, to approach it in a "tiered" fashion where future versions outmode, even though that's not right for every architecture, and so on. I don't think that's the right approach, but we'd need a response for why. That all requires a lot of discussion as to how do we respond to this feature request and how do we respond to related feature requests before even a provisional implementation should land. So... I would not belay this change that fixes the target on something much more complicated. |
Well, I suppose it's not complicated in implementation, arguably even simpler, just... complicated in implications. My apologies, I know this all might seem surprising and annoying, but, well, you see, 32-bit x86 exists, you know? So we all have to live with the consequences of its... very... organic development. |
So, to make it clear, the alternative approach would also increase review time, or would that only be the case if we're talking about the My reasoning for the alternative implementation was that, instead of using the target option just for the note, correcting the target spec's
|
Yes. I don't think it's particularly distinguishable from this changeset if it's just for AVR, and even if it is, I'd like to have a deeper discussion of, and time for, examining the reasoning and impacts beyond "it fixes this bug". |
I see, no worries. I'll open an issue later, and keep this PR the same. |
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#137804 (rename BackendRepr::Vector → SimdVector) - rust-lang#137807 (Fully qualify `Result` in generated doctest code) - rust-lang#137809 (Use correct error message casing for `io::const_error`s) - rust-lang#137818 (tests: adapt for LLVM 21 changes) - rust-lang#137822 (Update query normalizer docs to not position it as the greatest pioneer in the space of normalization) - rust-lang#137824 (Tweak invalid RTN errors) - rust-lang#137828 (Fix inaccurate `std::intrinsics::simd` documentation) - rust-lang#137830 (Fix link failure on AVR (incompatible ISA error)) - rust-lang#137837 (Update `const_conditions` and `explicit_implied_const_bounds` docs) - rust-lang#137840 (triagebot: only ping me for constck) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137830 - LuigiPiucco:incompatible-isa-fix, r=workingjubilee Fix link failure on AVR (incompatible ISA error) Fixes rust-lang#137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) while also trying to get the ISA revision from the target spec. This commit uses the `target-cpu` option instead, which is already required to be present for the target. r? compiler cc ``@Patryk27``
Fixes #137739. A reproducer of the issue is present there. I believe the root cause was introducing the avr-none target (which has no CPU by default) while also trying to get the ISA revision from the target spec. This commit uses the
target-cpu
option instead, which is already required to be present for the target.r? compiler
cc @Patryk27