-
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
AVR: linker failure - architecture of input file is incompatible #137739
Comments
-Ctarget-cpu .
|
I'd like to investigate but I'm having trouble figuring out how to build a version of the compiler with
exporting
I haven't found any other information on how to enable support for these experimental targets. Any tips to get an |
I think you will want to omit avr-none when building rustc and then use build-std like you did with the official toolchain builds except this time with your locally built compiler. |
…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`
…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``
Thanks @bjorn3 for confirming the workflow. This helped me determine my issue was with cargo. From the rustc dev guide:
After running |
This is a fix for rust-lang#137739, and makes sure the "generic" CPU is never used when target_cpu is passed. This is particularly useful for architectures where knowing the exact CPU is a must, like AVR.
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``
rustc AVR support recently moved to an
avr-none
target (#131651). While trying to update the avr-hal crate (Rahix/avr-hal#634) I discovered building for some cpus results in a linker error.I've created a dependency-free reproducer at https://github.com/tones111/avr_bug
Attempting to build (
cargo build --release
) results in a linker failure likeBuilding for
atmega328p
works as expected. Adding-C default-linker-libraries
doesn't change the behavior. Targeting atmega2560 is also problematic.tool versions
avr-gcc: 14.2.0
avr-libc: 2.2.1
avr-ld: GNU ld (GNU Binutils) 2.43
rustc: nightly-2025-02-26
The text was updated successfully, but these errors were encountered: