Skip to content

Require target_has_atomic = "ptr" for runtime feature detection #909

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented May 6, 2025

The feature_detect module is currently being built on all targets, but the use of AtomicU32 causes a problem if atomics are not available (such as with bpfel-unknown-none). Gate this module behind target_has_atomic = "ptr".

The below now completes successfully:

cargo build -p compiler_builtins --target=bpfel-unknown-none -Z build-std=core

Fixes: #908

The `feature_detect` module is currently being built on all targets, but
the use of `AtomicU32` causes a problem if atomics are not available
(such as with `bpfel-unknown-none`). Gate this module behind
`target_has_atomic = "ptr"`.

The below now completes successfully:

    cargo build -p compiler_builtins --target=bpfel-unknown-none -Z build-std=core

Fixes: rust-lang#908
@tgross35 tgross35 force-pushed the runtime-detection-atomic branch from d8643a5 to 13b95eb Compare May 6, 2025 20:27
@tgross35 tgross35 requested a review from Amanieu May 6, 2025 20:27
@tgross35 tgross35 merged commit da8b582 into rust-lang:master May 6, 2025
35 checks passed
@tgross35 tgross35 deleted the runtime-detection-atomic branch May 6, 2025 21:59
tgross35 added a commit to tgross35/rust that referenced this pull request May 6, 2025
Includes the following changes:

* Require `target_has_atomic = "ptr"` for runtime feature detection

[1]: rust-lang/compiler-builtins#909
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 7, 2025
Update `compiler-builtins` to 0.1.158

Includes the following changes:

* Require `target_has_atomic = "ptr"` for runtime feature detection [1]

[1]: rust-lang/compiler-builtins#909
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 7, 2025
Rollup merge of rust-lang#140724 - tgross35:update-builtins, r=tgross35

Update `compiler-builtins` to 0.1.158

Includes the following changes:

* Require `target_has_atomic = "ptr"` for runtime feature detection [1]

[1]: rust-lang/compiler-builtins#909
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compilation error on platforms that do not have AtomicU32 from #896
2 participants