Repository navigation
Fix armv4t- and armv5te- bare metal targets - #149241
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These two targets currently force on the LLVM feature
+atomics-32. LLVM doesn't appear to actually be able to emit 32-bit load/store atomics for these targets despite this feature, and emits calls to a shim function called__sync_lock_test_and_set_4, which nothing in the Rust standard library supplies.See #t-compiler/arm > __sync_lock_test_and_set_4 on Armv5TE for more details.
Experimenting with clang and gcc (as logged in that zulip thread) shows that C code cannot do atomic load/stores on that architecture either (at least, not without a library call inserted).
So, the safest thing to do is probably turn off
+atomics-32for these two Tier 3 targets.I asked @Lokathor and he said he didn't even use atomics on the
armv4t-none-eabi/thumbv4t-none-eabitarget he maintains.I was unable to reach @QuinnPainter for comment for
armv5te-none-eabi/thumbv5te-none-eabi.The second commit renames the base target spec
spec::base::thumbtospec::base::arm_noneand changesarmv4t-none-eabi/thumbv4t-none-eabiandarmv5te-none-eabi/thumbv5te-none-eabito use it. This harmonises the frame-pointer and linker options across the bare-metal Arm EABI and EABIHF targets.You could make an argument for harmonising
armv7a-none-*,armv7r-none*andarmv8r-none-*as well, but that can be another PR.