You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A bug was introduced in #103240 (5642a75) when compiling for AVR targets, causing errors in linking which look like:
error: linking with `avr-gcc` failed: exit status: 1
|
= note: "avr-gcc" "-mmcu=attiny404" "/tmp/rustcmivxhx/symbols.o" "/home/goose/dev/hwlife/life-cell/firmware/target/avr-attiny404/debug/deps/life_cell-6668cd99ba2eaeff.avrxmega_hal-cc404b4688795bef.avrxmega_hal.d6125529-cgu.0.rcgu.o.rcgu.o" "-Wl,--as-needed" "-L" "/home/goose/dev/hwlife/life-cell/firmware/target/avr-attiny404/debug/deps" "-L" "/home/goose/dev/hwlife/life-cell/firmware/target/debug/deps" "-L" "/home/goose/build/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/avr-attiny404/lib" "-Wl,-Bstatic" "/home/goose/dev/hwlife/life-cell/firmware/target/avr-attiny404/debug/deps/libcompiler_builtins-dfbc3c77452aecc4.rlib" "-Wl,-Bdynamic" "-lgcc" "-Wl,-znoexecstack" "-L" "/home/goose/build/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/avr-attiny404/lib" "-o" "/home/goose/dev/hwlife/life-cell/firmware/target/avr-attiny404/debug/deps/life_cell-6668cd99ba2eaeff.elf" "-Wl,--gc-sections" "-no-pie"
= note: /usr/lib/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld: avr architecture of input file `/tmp/rustcmivxhx/symbols.o' is incompatible with avr:103 output
collect2: error: ld returned 1 exit status
The PR in question added support for AVR architecture in create_object_file, but it doesn't actually make the necessary changes to set the e_flags field, which is used to specify the AVR ISA revision. As a knock-on-effect, this causes add_linked_symbol_object to avoid an early return and succeed in creating a symbols.o file, but this object file doesn't have e_flags set correctly.
I believe that is the cause of this error; the AVR linker checks the e_flags field to make sure the ISA revision matches what is expected, and rustc is not setting that field correctly.
The text was updated successfully, but these errors were encountered:
Fix unset e_flags in ELF files generated for AVR targets
Closesrust-lang#106576
~~Sort-of blocked by gimli-rs/object#500~~ (merged)
I'm not sure whether the list of AVR CPU names is okay here. Maybe it could be moved out-of-line to improve the readability of the function.
(Downstream issue: Rahix/avr-hal#388)
A bug was introduced in #103240 (5642a75) when compiling for AVR targets, causing errors in linking which look like:
The PR in question added support for AVR architecture in
create_object_file
, but it doesn't actually make the necessary changes to set thee_flags
field, which is used to specify the AVR ISA revision. As a knock-on-effect, this causesadd_linked_symbol_object
to avoid an early return and succeed in creating asymbols.o
file, but this object file doesn't havee_flags
set correctly.I believe that is the cause of this error; the AVR linker checks the
e_flags
field to make sure the ISA revision matches what is expected, and rustc is not setting that field correctly.The text was updated successfully, but these errors were encountered: