Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pool (mis)compile on AArch64 #350

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

rjsberry
Copy link
Contributor

Fixes #349

Alternatively we could change the probe to something like:

#[no_mangle]
pub unsafe fn probe(x: &usize, y: usize) -> usize {
    let mut ret;
    asm!(
        "       clrex",
        "2:",
        "       ldrex {2}, [{0}]",
        "       strex {tmp}, {1}, [{0}]",
        "       cmp {tmp}, #0",
        "       bne 2b",
        in(reg) x,
        in(reg) y,
        out(reg) ret,
        tmp = out(reg) _,
    );
    ret
}

Without explicitly denying any aarch64* target.

@rjsberry rjsberry force-pushed the fix-aarch64-llsc branch 2 times, most recently from b207dda to 519eb9d Compare February 27, 2023 22:54
@AdinAck
Copy link

AdinAck commented Aug 30, 2023

Please merge this. Tests cannot be run on Darwin processors without this PR.

newAM
newAM previously approved these changes Oct 20, 2023
Copy link
Member

@newAM newAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Will merge soon after CI is fixed.

The LLSC probe in `build.rs` checks for the presence of the
`clrex` instruction and assumes the target also has both `ldrex`
and `strex`.

In AArch64 `clrex` is a known mnemonic but `ldrex` and `strex`
are not. This caused the `arm_llsc` feature (and subsequently the
oiik module) to be included in the crate for AArc64 which is invalid.
@newAM newAM added this pull request to the merge queue Oct 20, 2023
Merged via the queue into rust-embedded:main with commit 7d3282b Oct 20, 2023
69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LLSC probe incorrectly includes pool module on AArch64
3 participants