Skip to content

compiler-builtins subtree update#153866

Merged
rust-bors[bot] merged 50 commits intorust-lang:mainfrom
tgross35:update-builtins
Mar 14, 2026
Merged

compiler-builtins subtree update#153866
rust-bors[bot] merged 50 commits intorust-lang:mainfrom
tgross35:update-builtins

Conversation

@tgross35
Copy link
Contributor

@tgross35 tgross35 commented Mar 14, 2026

Subtree update of compiler-builtins to rust-lang/compiler-builtins@8173070.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost

tgross35 and others added 30 commits February 10, 2026 00:56
It would be nice to support a few more flags here, but the current
implementation is a bit limited. Switch to `getopts` which should make
things a bit easier in the future.
PE executables don't seem to have anything in the symbol table. Don't
assert that we find any symbols in this case, which allows using
symcheck for executable binaries.
Implement the following logic:

* For elf executable binaries, check for PT_GNU_STACK with PF_X. This
  combination tells the kernel to make the stack executable.
* For elf intermediate objects, check for `.note.GNU-stack` with
  SHF_EXECINSTR. This combination in an object file tells the linker to
  give the final binary PT_GNU_STACK PF_X.
* For elf intermediate objects with no `.note.GNU-stack`, assume the
  legacy behavior that assumes an executable stack is required.
* For non-elf binaries, don't check anything. In a follow up it may be
  possible to check for `MH_ALLOW_STACK_EXECUTION` on Mach-O binaries,
  but it doesn't seem possible to get the latest compiler to emit this.

This appears to match what is done by `scanelf` to emit `!WX` [1], which
seems to be the tool used to create the output in the issue. The ld
manpage [2] also has some useful notes about these flags, as does the
presentation at [3].

Closes: rust-lang/compiler-builtins#183

[1]: https://github.com/gentoo/pax-utils/blob/9ef54b472e42ba2c5479fbd86b8be2275724b064/scanelf.c
[2]: https://man7.org/linux/man-pages/man1/ld.1.html
[3]: https://www.ndss-symposium.org/wp-content/uploads/6D-s0924-ye.pdf
CI is failing with:

    error: failed to run custom build command for `quote v1.0.44`

    Caused by:
      process didn't exit successfully: `/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/runner/work/compiler-builtins/compiler-builtins/target/miri/debug/build/quote-32cc00414fa6f72d/build-script-build` (exit status: 1)
      --- stderr
      fatal error: file "/home/runner/work/compiler-builtins/compiler-builtins/target/miri/debug/build/quote-32cc00414fa6f72d/build-script-build" contains outdated or invalid JSON; try `cargo clean`

Link: https://rust-lang.zulipchat.com/#narrow/channel/269128-miri/topic/build-script-build.20contains.20outdated.20or.20invalid.20JSON/with/573426109
These were disabled due to permission issues, which should now be
resolved.

This reverts commit 28e0556a7bca6ca828186d9de74d30c7cb45db5e.
The nightly has the LLVM bump that resolves the relevant issue.

This reverts commit 99d1fc7752b0e09cff5729cd4f3783d23c23cb66.

Link: rust-lang#152428
The `frexpf16` signature is added (to make traits easier) but left
unimplemented, since it will need a slightly different algorithm.
This will support `frexpf16` and should allow `generic::frexp` to be
inlined into the non-generic `frexp*` functions.

Additionally remove an unneeded `as` cast.
The new algorithm now correctly supports the type.
This includes the most recent LLVM bump.
Values like 0.5 that have an exponent but not a mantissa are currently
being reported as OK rather than INEXACT for ceil, floor, and trunc. Fix
this and clean up the test cases.

This tries to keep the algorithm diff as simple as possible, which
introduces some small performance regressions. This is improved in a
future commit.
ceil seems to optimize better, but this gets closer to the pre-fix
codegen.
Suggested-by: Juho Kahala <57393910+quaternic@users.noreply.github.com>
Currently Criterion is always built with the test crates, but it doesn't
really need to be. It wasn't a problem before but did start showing up
with the latest version bump since it added a C dependency, and for the
Miri CI runs we don't have the C toolchains. To resolve this and speed
up compilation time, move criterion behind a new feature `walltime`.

I'd rather have named this `runtime` but don't want to confuse my future
self with "what runtime?".
The tests pass successfully for me on powerpc64le-unknown-linux-gnu
with nightly 1.95.
This was missed in 6e91b0346c3d (“Revert "Disable broken powerpc64 test
due to
 https://github.com/rust-lang/rust/issues/88520"”).
For cases where we would like to run tests that aren't automatically
detected, allow the following syntax in PR descriptions:

    ci: extra-extensive=copysignf,sqrtf16
In order to improve upon some inconsistencies seen across CI runs and
locally, add a Cargo.lock file for the main workspace.
PRs are now getting the following:

    Traceback (most recent call last):
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 510, in <module>
        main()
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 496, in main
        ctx.emit_workflow_output()
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 294, in emit_workflow_output
        pr = PrInfo.from_env()
             ^^^^^^^^^^^^^^^^^
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 152, in from_env
        return cls.from_pr(pr_env)
               ^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 174, in from_pr
        return cls(**json.loads(pr_info), cfg=PrCfg(pr_json["body"]))
                                              ^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/compiler-builtins/compiler-builtins/ci/ci-util.py", line 134, in __init__
        pprint.pp(self)
      File "/usr/lib/python3.12/pprint.py", line 66, in pp
        pprint(object, *args, sort_dicts=sort_dicts, **kwargs)
    ...
    AttributeError: 'PrCfg' object has no attribute 'extra_extensive'. Did you mean: 'skip_extensive'?

Resolve this by using `__post_init__` rather than `__init__`.

Fixes: bba024d20464 ("ci: Allow specifying extra extensive tests to run")
As of indicatif 0.18.4, this option must be enabled in able to build.
tgross35 and others added 7 commits March 6, 2026 04:18
These warnings are showing up on the most recent nightly:

    error: feature `f128` is declared but not used
     --> builtins-test/tests/addsub.rs:3:35
      |
    3 | #![cfg_attr(f128_enabled, feature(f128))]
      |                                   ^^^^

It isn't always easy to be more exact with the features we enable, so
mostly ignore this.
Since we are starting to use the `fmaximum_num` intrinsics, LLVM may
emit these.
Add a wrapper similar to `Hexf` to print integers with proper padding.
Make `Float::NAN` a qNaN, add sNaNs, and add operations to check whether
a NaN is quiet or signaling.

The MIPS values are checked against https://gcc.godbolt.org/z/1bhsd5ana.
Give more descriptive output in tests since we sometimes need to treat
these differently. We still don't parse `sNaN`/`qNaN` for now, though we
could in the future.
We do handle signaling NaNs properly, with the exception of raising
exceptions as IEEE 754 requires. Add tests to this effect for
`fmin`, `fminimum`, `fminimum_num`, and the max variants.
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 14, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2026

⚠️ Warning ⚠️

@RalfJung
Copy link
Member

RalfJung commented Mar 14, 2026

Be very careful with force-pushing sync branches, this can break the round-trip. Do not modify or rebase any commits Josh created. Adding more commits on top is fine.

This PR is based on an upstream commit that is older than 28 days.

This indicates there hasn't been a sync the other direction in a while. In Miri we have those fully automated, happy to share that infrastructure if you are interested.

@tgross35
Copy link
Contributor Author

Be very careful with force-pushing sync branches, this can break the round-trip. Do not modify or rebase any commits Josh created. Adding more commits on top is fine.

I accidentally started the sync from the wrong branch and this was the correction, see rust-lang/josh-sync#36.

This PR is based on an upstream commit that is older than 28 days.

This indicates there hasn't been a sync the other direction in a while. In Miri we have those fully automated, happy to share that infrastructure if you are interested.

We have rust->cb syncs on a cron job and I also launched one before doing this, there just isn’t anything to sync. Unless you’re talking about doing this cb->rust sync automatically?

@RalfJung
Copy link
Member

We have rust->cb syncs on a cron job and I also launched one before doing this, there just isn’t anything to sync.

Ah, yeah that would also explain the old base commit. :)

@tgross35
Copy link
Contributor Author

@bors r+ rollup=never p=1

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 14, 2026

📌 Commit 7a698be has been approved by tgross35

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 Mar 14, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 14, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 14, 2026

☀️ Test successful - CI
Approved by: tgross35
Duration: 3h 11m 18s
Pushing 35f1109 to main...

@rust-bors rust-bors bot merged commit 35f1109 into rust-lang:main Mar 14, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 14, 2026
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 798a011 (parent) -> 35f1109 (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 35f1109ece895199e4b8d755b101e9a481d18243 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-apple-various: 1h 23m -> 1h 40m (+19.8%)
  2. i686-gnu-1: 2h 22m -> 1h 57m (-18.2%)
  3. dist-armv7-linux: 1h 25m -> 1h 37m (+14.1%)
  4. pr-check-1: 32m 51s -> 28m 51s (-12.2%)
  5. i686-gnu-2: 1h 44m -> 1h 31m (-12.1%)
  6. aarch64-msvc-1: 2h 19m -> 2h 3m (-11.5%)
  7. i686-gnu-nopt-1: 2h 21m -> 2h 5m (-11.5%)
  8. x86_64-gnu-stable: 2h 34m -> 2h 19m (-10.0%)
  9. x86_64-gnu-debug: 2h 5m -> 1h 53m (-9.4%)
  10. aarch64-gnu-llvm-21-2: 49m 56s -> 45m 29s (-8.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (35f1109): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary -2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.7% [-5.7%, -5.7%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 481.81s -> 483.075s (0.26%)
Artifact size: 394.88 MiB -> 394.78 MiB (-0.03%)

@tgross35 tgross35 deleted the update-builtins branch March 15, 2026 09:49
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) merged-by-bors This PR was explicitly merged by bors. 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.

9 participants