Starting from 1.59.0, rustc has been removed support for the llvm_asm!() macro, making it impossible to use avr-device with newer compilers.
This merge requests adjusts the code, so that it continues to use llvm_asm!() on older compilers (such as the infamous nightly-2021-01-07), but switches to asm!() on the newer ones.
Due Diligence
I've checked the code on nightly-2021-01-07 and a custom-built rustc from around yesterday (b759b2218649016cc40e82bdd6d958e2277ff6d7), and everything seems to be working correctly.
I've compared the generated LLVM IRs for an application I'm developing, and they are virtually identical:
Closes https://github.com/Rahix/avr-device/issues/91.
Abstract
Starting from 1.59.0, rustc has been removed support for the
llvm_asm!()
macro, making it impossible to useavr-device
with newer compilers.This merge requests adjusts the code, so that it continues to use
llvm_asm!()
on older compilers (such as the infamousnightly-2021-01-07
), but switches toasm!()
on the newer ones.Due Diligence
I've checked the code on
nightly-2021-01-07
and a custom-builtrustc
from around yesterday (b759b2218649016cc40e82bdd6d958e2277ff6d7
), and everything seems to be working correctly.I've compared the generated LLVM IRs for an application I'm developing, and they are virtually identical:
enable()
:disable()
:The compiled binary seems to be working correctly on an Atmega328p, too.
Follow-ups
I've also got a similar set of changes to
avr-hal
, I'll try pushing the merge request in a few minutes :-)