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

LLVM 18 no longer emits atomic load/store machine code for targets without s32c1i (LLVM-408) #105

Open
3 tasks done
MabezDev opened this issue Oct 25, 2024 · 0 comments
Open
3 tasks done
Assignees
Labels
Resolution: NA Status: Done Issue is done internally

Comments

@MabezDev
Copy link

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

often

Expected behavior

Atomic load/stores to function on the esp32s2

Actual behavior (suspected bug)

We sometimes get linker errors on the s2: https://github.com/esp-rs/esp-hal/actions/runs/11518396724/job/32065069522, in the Rust target we set max atomic width to 32, but in here it gets set to 0:

if (Subtarget.hasS32C1I()) {
setMaxAtomicSizeInBitsSupported(32);
setMinCmpXchgSizeInBits(32);
} else {
setMaxAtomicSizeInBitsSupported(0);
}
.

This heavily relates to LLVM-175 and we should now take the time to implement it and follow what the RISCV backend does:

if (Subtarget.hasStdExtA()) {
setMaxAtomicSizeInBitsSupported(Subtarget.getXLen());
setMinCmpXchgSizeInBits(32);
} else if (Subtarget.hasForcedAtomics()) {
setMaxAtomicSizeInBitsSupported(Subtarget.getXLen());
} else {
setMaxAtomicSizeInBitsSupported(0);
}

Error logs or terminal output

No response

Steps to reproduce the behavior

  1. Clone esp-hal
  2. run cargo xtask run-example examples esp32s2 embassy_usb_serial in the root
  3. Look at linker errors

Project release version

latest 18 release branch

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Gentoo

Shell

ZSH

Additional context

No response

@github-actions github-actions bot changed the title LLVM 18 no longer emits atomic load/store machine code for targets without s32c1i LLVM 18 no longer emits atomic load/store machine code for targets without s32c1i (LLVM-408) Oct 25, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA and removed Status: In Review labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants