Don't add empty target features for target-cpu=native on macOS#153763
Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom Mar 12, 2026
Merged
Don't add empty target features for target-cpu=native on macOS#153763rust-bors[bot] merged 1 commit intorust-lang:mainfrom
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22. Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds *some* target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables `neon` if it's already enabled. (This is to avoid enabling it on softfloat targets.)
Collaborator
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
|
Thanks for the super quick fix! r? me and r=me when green |
Contributor
Author
|
@bors r=lqd |
Contributor
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Mar 12, 2026
Don't add empty target features for target-cpu=native on macOS LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22. Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds *some* target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables `neon` if it's already enabled. (This is to avoid enabling it on softfloat targets.) Fixes rust-lang#153397.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 12, 2026
Rollup of 11 pull requests Successful merges: - #153726 (Add optional CI job to build the compiler with the parallel frontend) - #153763 (Don't add empty target features for target-cpu=native on macOS) - #153432 (Fix some comments about dataflow analysis.) - #153529 (Fix LegacyKeyValueFormat report from docker build: pr) - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`) - #153708 (de-non_const `Iterator` trait methods) - #153717 (unused_macro_rules switched used and unused comments) - #153736 (add test that an incomplete feature emits a warning) - #153748 (editorconfig: css uses tabs) - #153750 (rustc-dev-guide subtree update) - #153762 (actually make the is-fn test test what it says it tests)
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Mar 12, 2026
Don't add empty target features for target-cpu=native on macOS LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22. Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds *some* target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables `neon` if it's already enabled. (This is to avoid enabling it on softfloat targets.) Fixes rust-lang#153397.
rust-bors bot
pushed a commit
that referenced
this pull request
Mar 12, 2026
…uwer Rollup of 10 pull requests Successful merges: - #153726 (Add optional CI job to build the compiler with the parallel frontend) - #153763 (Don't add empty target features for target-cpu=native on macOS) - #153432 (Fix some comments about dataflow analysis.) - #153529 (Fix LegacyKeyValueFormat report from docker build: pr) - #153694 (fix(query): Pass Query Key to `value_from_cycle_error`) - #153717 (unused_macro_rules switched used and unused comments) - #153736 (add test that an incomplete feature emits a warning) - #153748 (editorconfig: css uses tabs) - #153750 (rustc-dev-guide subtree update) - #153762 (actually make the is-fn test test what it says it tests)
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Mar 16, 2026
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#153726 (Add optional CI job to build the compiler with the parallel frontend) - rust-lang/rust#153763 (Don't add empty target features for target-cpu=native on macOS) - rust-lang/rust#153432 (Fix some comments about dataflow analysis.) - rust-lang/rust#153529 (Fix LegacyKeyValueFormat report from docker build: pr) - rust-lang/rust#153694 (fix(query): Pass Query Key to `value_from_cycle_error`) - rust-lang/rust#153717 (unused_macro_rules switched used and unused comments) - rust-lang/rust#153736 (add test that an incomplete feature emits a warning) - rust-lang/rust#153748 (editorconfig: css uses tabs) - rust-lang/rust#153750 (rustc-dev-guide subtree update) - rust-lang/rust#153762 (actually make the is-fn test test what it says it tests)
Collaborator
|
beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle. Backport labels are handled by them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
LLVM does not support host feature detection (only host cpu detection) on apple platforms. As such, the returned feature string will be empty. Adding this empty string to the target-features attribute results in a verifier error on LLVM 22.
Fix this by not adding the empty string to the target features. The reason why this was not caught by the target-cpu-native test is that it requires a function that adds some target features, otherwise the attribute is omitted entirely. We achieve this with a somewhat peculiar construction that enables
neonif it's already enabled. (This is to avoid enabling it on softfloat targets.)Fixes #153397.