Skip to content

Fix -Ctarget-features getting ignored after crt-static #144143

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 2 commits into from
Jul 20, 2025

Conversation

Gelbpunkt
Copy link
Contributor

@Gelbpunkt Gelbpunkt commented Jul 18, 2025

The current behaviour introduced by commit a50a3b8 would discard any target features specified after crt-static (the only member of RUSTC_SPECIFIC_FEATURES). This is because it returned instead of continuing processing the next feature.

I wasn't entirely sure how the regression test should look like, but this one should do. If anyone has some suggestions, I'm happy to learn, it's my first test :)

I've confirmed that the test fails without the fix on powerpc64le-unknown-linux-musl and x86_64-unknown-linux-gnu.

cc @RalfJung

fixes #144203

The current behaviour introduced by commit
a50a3b8 would discard any
target features specified after crt-static (the only member of
RUSTC_SPECIFIC_FEATURES). This is because it returned instead of
continuing processing the next flag.

Signed-off-by: Jens Reidel <[email protected]>
@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2025

r? @compiler-errors

rustbot has assigned @compiler-errors.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 18, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 18, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 18, 2025
@Gelbpunkt Gelbpunkt changed the title Fix -Ctarget-features getting ignored after crt-static Fix -Ctarget-features getting ignored after crt-static Jul 18, 2025
@Gelbpunkt
Copy link
Contributor Author

This should probably also be backported to 1.89.

@workingjubilee workingjubilee added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jul 18, 2025
@apiraino
Copy link
Contributor

apiraino commented Jul 18, 2025

Regression introduced in #140920

@tgross35
Copy link
Contributor

@Noratrieb
Copy link
Member

@Gelbpunkt can you open an issue for this? We usually don't require issues for bug fixes but we use them for tracking backports, so it would be useful here.

@RalfJung
Copy link
Member

It's a bit odd to make this a fail-test that way, but sure, why not. :) Thanks for finding the issue and fixing it!

r? @RalfJung
@bors r+

@bors
Copy link
Collaborator

bors commented Jul 19, 2025

📌 Commit 1b35d5f has been approved by RalfJung

It is now in the queue for this repository.

@rustbot rustbot assigned RalfJung and unassigned compiler-errors Jul 19, 2025
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2025
@Gelbpunkt
Copy link
Contributor Author

@Gelbpunkt can you open an issue for this? We usually don't require issues for bug fixes but we use them for tracking backports, so it would be useful here.

Opened #144203

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 20, 2025
…ic, r=RalfJung

Fix `-Ctarget-feature`s getting ignored after `crt-static`

The current behaviour introduced by commit a50a3b8 would discard any target features specified after `crt-static` (the only member of `RUSTC_SPECIFIC_FEATURES`). This is because it returned instead of continuing processing the next feature.

I wasn't entirely sure how the regression test should look like, but this one should do. If anyone has some suggestions, I'm happy to learn, it's my first test :)

I've confirmed that the test fails without the fix on `powerpc64le-unknown-linux-musl` and `x86_64-unknown-linux-gnu`.

cc `@RalfJung`
bors added a commit that referenced this pull request Jul 20, 2025
Rollup of 9 pull requests

Successful merges:

 - #143282 (Add `uX::strict_sub_signed`)
 - #143423 (address clippy formatting nits)
 - #143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too)
 - #144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds)
 - #144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests)
 - #144125 (Add new `ignore-backends` and `needs-backends` tests annotations)
 - #144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`)
 - #144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass)
 - #144190 (Give a message with a span on MIR validation error)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1e6ef24 into rust-lang:master Jul 20, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 20, 2025
rust-timer added a commit that referenced this pull request Jul 20, 2025
Rollup merge of #144143 - Gelbpunkt:target-features-crt-static, r=RalfJung

Fix `-Ctarget-feature`s getting ignored after `crt-static`

The current behaviour introduced by commit a50a3b8 would discard any target features specified after `crt-static` (the only member of `RUSTC_SPECIFIC_FEATURES`). This is because it returned instead of continuing processing the next feature.

I wasn't entirely sure how the regression test should look like, but this one should do. If anyone has some suggestions, I'm happy to learn, it's my first test :)

I've confirmed that the test fails without the fix on `powerpc64le-unknown-linux-musl` and `x86_64-unknown-linux-gnu`.

cc ``@RalfJung``
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jul 21, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143282 (Add `uX::strict_sub_signed`)
 - rust-lang/rust#143423 (address clippy formatting nits)
 - rust-lang/rust#143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too)
 - rust-lang/rust#144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds)
 - rust-lang/rust#144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests)
 - rust-lang/rust#144125 (Add new `ignore-backends` and `needs-backends` tests annotations)
 - rust-lang/rust#144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`)
 - rust-lang/rust#144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass)
 - rust-lang/rust#144190 (Give a message with a span on MIR validation error)

r? `@ghost`
`@rustbot` modify labels: rollup
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 21, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143282 (Add `uX::strict_sub_signed`)
 - rust-lang/rust#143423 (address clippy formatting nits)
 - rust-lang/rust#143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too)
 - rust-lang/rust#144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds)
 - rust-lang/rust#144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests)
 - rust-lang/rust#144125 (Add new `ignore-backends` and `needs-backends` tests annotations)
 - rust-lang/rust#144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`)
 - rust-lang/rust#144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass)
 - rust-lang/rust#144190 (Give a message with a span on MIR validation error)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

-Ctarget-features get ignored after crt-static
9 participants