rust-embedded/heapless

LLSC probe incorrectly includes `pool` module on AArch64

rjsberry opened this issue · 0 comments

Attempting to execute test suite on M1 MacBook fails with:

heapless % cargo t
   Compiling heapless v0.8.0 (~/Code/heapless)
error: unrecognized instruction mnemonic, did you mean: clrex, ldr?
   --> src/pool/treiber/llsc.rs:129:15
    |
129 |         asm!("ldrex {}, [{}]", out(reg) value, in(reg) addr, options(nostack));
    |               ^
    |
note: instantiated into assembly here
   --> <inline asm>:1:2
    |
1   |     ldrex x8, [x9]
    |     ^

error: unrecognized instruction mnemonic, did you mean: str?
   --> src/pool/treiber/llsc.rs:138:15
    |
138 |         asm!("strex {}, {}, [{}]", out(reg) outcome, in(reg) value, in(reg) addr, options(nostack));
    |               ^
    |
note: instantiated into assembly here
   --> <inline asm>:1:2
    |
1   |     strex x8, x9, [x10]
    |     ^

error: could not compile `heapless` due to 2 previous errors

Looks like the LLSC probe in build.rs is wrongly assuming presence of ldrex and strex in instruction set if clrex is known mnemonic. The supported A64 instructions include clrex but not ldrex or strex.

We can avoid this by refusing to run the probe on AArch64 or updating the probe to check for all instructions.