Skip to content

Remove compiler-builtins-{no-asm,mangled-names} #144471

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jul 25, 2025

Remove compiler-builtins-no-asm

This feature used to be for when Cranelift didn't support inline
assembly, but its last uses were removed in 52933e0 ("Don't disable
inline asm usage in compiler-builtins when the cranelift backend is
enabled"). and cba05a7 ("Support naked functions").

This doesn't remove the feature from the compiler-builtins crate, that
will be done separately in the subtree repo.


Remove compiler-builtins-mangled-names

This config was added in 207de01 ("libary: Forward
compiler-builtins "asm" and "mangled-names" feature") but it does not
appear this has ever been used. The PR adding it (#78472) says that
this was exposed to help with configuration and points at the Hermit
Cargo config
, but as far as I can tell, this feature name has never
been mentioned in that repository's git history.

Thus, clean up a seemingly unneeded feature.

r? @Amanieu
cc @bjorn3

This feature used to be for when Cranelift didn't support inline
assembly, but its last uses were removed in 52933e0 ("Don't disable
inline asm usage in compiler-builtins when the cranelift backend is
enabled"). and cba05a7 ("Support naked functions").

This doesn't remove the feature from the `compiler-builtins` crate, that
will be done separately in the subtree repo.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 25, 2025
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Jul 25, 2025
Assembly-related configuration was added in 1621c6d ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while so remove the unused feature here.

To keep miri tests working, replace one instance of `not(feature =
"no-asm")` with `not(miri)`.

This is the compiler-builtins portion of
rust-lang/rust#144471.
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Jul 25, 2025
Assembly-related configuration was added in 1621c6d ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while so remove the unused feature here.

To keep miri tests working, replace one instance of `not(feature =
"no-asm")` with `not(miri)`.

This is the compiler-builtins portion of
rust-lang/rust#144471.
@tgross35
Copy link
Contributor Author

@bors r=Amanieu rollup

@bors
Copy link
Collaborator

bors commented Jul 25, 2025

📌 Commit a076bd8 has been approved by Amanieu

It is now in the queue for this repository.

@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 25, 2025
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Jul 25, 2025
Assembly-related configuration was added in 1621c6d ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate `asm!` behind this configuration.
Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no
generic fallback.

There are other cases, however, where setting the `no-asm` configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future.

This is the compiler-builtins portion of
rust-lang/rust#144471.
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Jul 26, 2025
Assembly-related configuration was added in 1621c6d ("Use
`specialized-div-rem` 1.0.0 for division algorithms") to account for
Cranelift not yet supporting assembly. This hasn't been relevant for a
while, so we no longer need to gate `asm!` behind this configuration.
Thus, remove `cfg(not(feature = "no-asm"))` in places where there is no
generic fallback.

There are other cases, however, where setting the `no-asm` configuration
enables testing of generic version of builtins when there are platform-
specific implementations available; these cases are left unchanged. This
could be improved in the future by exposing both versions for testing
rather than using a configuration and running the entire testsuite
twice.

This is the compiler-builtins portion of
rust-lang/rust#144471.
This config was added in 207de01 ("libary: Forward
compiler-builtins "asm"  and "mangled-names" feature") but it does not
appear this has ever been used. The PR adding it (RUST-78472) says that
this was exposed to help with configuration and points at the [Hermit
Cargo config], but as far as I can tell, this feature name has never
been mentioned in that repository's git history.

Thus, clean up a seemingly unneeded feature.

[Hermit Cargo config]: https://github.com/hermit-os/hermit-rs/blob/ab2b830930e6a9a98c8294997a8183feeabeda4a/.cargo/config
@tgross35 tgross35 changed the title Remove compiler-builtins-no-asm Remove compiler-builtins-{no-asm,mangled-names} Jul 26, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Jul 26, 2025

Added a commit to also remove compiler-builtins-mangled-names since that is also unused, rather than creating a separate PR to conflict with this one.

@tgross35 tgross35 requested a review from Amanieu July 26, 2025 00:32
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants