Skip to content

Update the compiler-builtins subtree #143405

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 15 commits into
base: master
Choose a base branch
from

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jul 3, 2025

Update the Josh subtree to rust-lang/compiler-builtins@8aba4c899ee8.

r? @ghost

folkertdev and others added 9 commits June 14, 2025 13:10
This PR adds a minimal `triagebot.toml` config to make contributions to
this repository respect upstream rust-lang/rust conventions and avoid
issues when syncing this subtree.
Rather than re-opening the archive file for each check, add a wrapper
that keeps the data in memory. Additionally, collect the `--target`
argument so it can be used within this crate.
Often our short summaries will pick up a Bors "Auto merge of #xxxx ...`
commit message. Replace these with something like `rust-lang#1234`
to avoid broken links when going between repositories.
…i256 and u256

`i256` and `u256`
- operators now use the same overflow convention as primitives
- implement `<<` and `-` (previously just `>>` and `+`)
- implement `Ord` correctly (the previous `PartialOrd` was broken)
- correct `i256::SIGNED` to `true`

The `Int`-trait is extended with `trailing_zeros`, `carrying_add`, and
`borrowing_sub`.
Currently we whether or not to build and test `f16` and `f128` support
mostly based on the target triple. This isn't always accurate, however,
since support also varies by backend and the backend version.

Since recently, `rustc` is aware of this with the unstable config option
`target_has_reliable_{f16,f128}`, which better represents when the types
are actually expected to be available and usable. Switch our
compiler-builtins and libm configuration to use this by probing `rustc`
for the target's settings.

A few small `cfg` fixes are needed with this.
@rustbot rustbot added A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Jul 3, 2025

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jul 3, 2025

📌 Commit be35d37 has been approved by tgross35

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 3, 2025
bors added a commit that referenced this pull request Jul 4, 2025
Update the `compiler-builtins` subtree

Update the Josh subtree to rust-lang/compiler-builtins@ed17b95715dd.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Jul 4, 2025

⌛ Testing commit be35d37 with merge a6503b1...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 4, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 4, 2025
tgross35 added 5 commits July 4, 2025 16:53
This makes it more obvious what we intend to check rather than looking
for `--target`.
Rather than printing the entire JSON dump, use the rendered version.
8521530f4938 ("Fix __divsi3 and __udivsi3 on thumbv6m targets") removed
tests that use these `thumb*-linux` target files in favor of tests that
use the `thumb*-none` targets, which are available via Rustup. The JSON
files haven't been used since then and are outdated, so remove them.
The `rustc` probe done in our build scripts needs to pass `--target` to
get the correct configuration, which usually comes from the `TARGET`
environment variable. However, for targets specified via a `target.json`
file, `TARGET` gets set to the file name without an extension or path.
`rustc` will check a search path to attempt to locate the file, but this
is likely to fail since the directory where Cargo invokes build scripts
(and hence where those scripts invoke `rustc`) might not have any
relation to the JSON spec file.

Resolve this for now by leaving `f16` and `f128` disabled if the `rustc`
command fails. Result of the discussion at CARGO-14208 may eventually
provide a better solution.

A CI test is also added since custom JSON files are an edge case that
could fail in other ways. I verified this fails without the fix here.
The JSON file is the output for `thumbv7em-none-eabi`, just renamed so
`rustc` doesn't identify it.
@tgross35
Copy link
Contributor Author

tgross35 commented Jul 5, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 5, 2025

📌 Commit 016bc61 has been approved by tgross35

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 5, 2025
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 5, 2025
bors added a commit that referenced this pull request Jul 5, 2025
Update the `compiler-builtins` subtree

Update the Josh subtree to rust-lang/compiler-builtins@8aba4c899ee8.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Jul 5, 2025

⌛ Testing commit 016bc61 with merge 4b909fc...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jul 5, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 5, 2025
`conv-bits-runtime-const` gates `f16` and `f128` tests behind `x86_64`,
but this isn't always accurate. In particular, x86 `MinGW` has an ABI
bug [1] which means things work when linked to our Rust math libraries
but don't work with host libraries. RUST-143405 slightly adjusts which
targets we provide `f16` and `f128` symbols for and effectively removes
MinGW from that list, meaning host libraries start getting linked,
meaning `f16` and `f128` tests start to fail.

Account for this by changing the gates in one such test to
`cfg(target_has_reliable_{f16,f128})` which is the way we should be
gating all behavior related to the types going forward.

`rustfmt` also seems to have formatted the macros which is fine.

[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 5, 2025
@tgross35
Copy link
Contributor Author

tgross35 commented Jul 5, 2025

@bors2 try jobs=x86_64-mingw-*,aarch64-apple

@rust-bors
Copy link

rust-bors bot commented Jul 5, 2025

⌛ Trying commit 082c119 with merge 4b5fb38

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 5, 2025
Update the `compiler-builtins` subtree

Update the Josh subtree to rust-lang/compiler-builtins@8aba4c899ee8.

r? `@ghost`
try-job: x86_64-mingw-*
try-job: aarch64-apple
@rust-bors
Copy link

rust-bors bot commented Jul 5, 2025

☀️ Try build successful (CI)
Build commit: 4b5fb38 (4b5fb38fd87852634931b0ddfa4ca9dd7895c842, parent: 733b47ea4b1b86216f14ef56e49440c33933f230)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiler-builtins Area: compiler-builtins (https://github.com/rust-lang/compiler-builtins) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

7 participants