1392: embassy-rp : Fix for division intrinsics clashing with rp2040-hal r=Dirbaio a=peterkrull

Commit [7a682ec](7a682ec02a (diff-f121955242a67342004444b26214e5d1d591c3182dcd0fedf4329ad472cd1200)) may break compilation if also using `rp2040-hal`. It seems that the rp2040-hal does have a feature flag for [disabling intrinsics](2c9921cdc5/rp2040-hal/src/sio.rs (L323)), but I still cannot seem to compile with that enabled. Adding these flags fixes it for me.

Co-authored-by: Peter Krull <peterkrullpeter@gmail.com>
This commit is contained in:
bors[bot] 2023-04-23 18:54:28 +00:00 committed by GitHub
commit d78edba0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -361,10 +361,11 @@ macro_rules! division_function {
#[cfg(all(target_arch = "arm", feature = "intrinsics"))] #[cfg(all(target_arch = "arm", feature = "intrinsics"))]
core::arch::global_asm!( core::arch::global_asm!(
// Mangle the name slightly, since this is a global symbol. // Mangle the name slightly, since this is a global symbol.
concat!(".global _rphal_", stringify!($name)), concat!(".section .text._erphal_", stringify!($name)),
concat!(".type _rphal_", stringify!($name), ", %function"), concat!(".global _erphal_", stringify!($name)),
concat!(".type _erphal_", stringify!($name), ", %function"),
".align 2", ".align 2",
concat!("_rphal_", stringify!($name), ":"), concat!("_erphal_", stringify!($name), ":"),
$( $(
concat!(".global ", stringify!($intrinsic)), concat!(".global ", stringify!($intrinsic)),
concat!(".type ", stringify!($intrinsic), ", %function"), concat!(".type ", stringify!($intrinsic), ", %function"),
@ -379,10 +380,11 @@ macro_rules! division_function {
#[cfg(all(target_arch = "arm", not(feature = "intrinsics")))] #[cfg(all(target_arch = "arm", not(feature = "intrinsics")))]
core::arch::global_asm!( core::arch::global_asm!(
// Mangle the name slightly, since this is a global symbol. // Mangle the name slightly, since this is a global symbol.
concat!(".global _rphal_", stringify!($name)), concat!(".section .text._erphal_", stringify!($name)),
concat!(".type _rphal_", stringify!($name), ", %function"), concat!(".global _erphal_", stringify!($name)),
concat!(".type _erphal_", stringify!($name), ", %function"),
".align 2", ".align 2",
concat!("_rphal_", stringify!($name), ":"), concat!("_erphal_", stringify!($name), ":"),
"hwdivider_head", "hwdivider_head",
$($begin),+ , $($begin),+ ,
@ -392,7 +394,7 @@ macro_rules! division_function {
#[cfg(target_arch = "arm")] #[cfg(target_arch = "arm")]
extern "aapcs" { extern "aapcs" {
// Connect a local name to global symbol above through FFI. // Connect a local name to global symbol above through FFI.
#[link_name = concat!("_rphal_", stringify!($name)) ] #[link_name = concat!("_erphal_", stringify!($name)) ]
fn $name(n: $argty, d: $argty) -> u64; fn $name(n: $argty, d: $argty) -> u64;
} }