Closed
Description
(Moving this here from avr-rust#172)
The avr
target now specifies no max_atomic_width
in the target spec file, which means it falls back to the pointer size of 16 bits:
let target = rustc_target::spec::TargetTriple::from_triple("avr-unknown-gnu-atmega328");
println!("{}", rustc_target::spec::Target::search(&target).unwrap().max_atomic_width());
// output: 16
This seems incorrect. As far as I know, AVR does not have any atomic operations (especially not 16 bit).
Compiling something for AVR that uses atomics results in linker errors: undefined reference to __sync_val_compare_and_swap_1
undefined reference to __sync_val_compare_and_swap_2
, etc.