compiler-builtins subtree update#153866
Conversation
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>
Most of the semver-breaking changes here relate to the 0.10 release of `rand`. Changelogs: * https://github.com/criterion-rs/criterion.rs/releases/tag/criterion-v0.8.0 * https://github.com/gimli-rs/object/blob/master/CHANGELOG.md#0380 * https://github.com/rust-random/rand/blob/master/CHANGELOG.md#0100---2026-02-08
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.
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.
|
35d50bd to
7a698be
Compare
|
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 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. |
I accidentally started the sync from the wrong branch and this was the correction, see rust-lang/josh-sync#36.
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? |
Ah, yeah that would also explain the old base commit. :) |
|
@bors r+ rollup=never p=1 |
This comment has been minimized.
This comment has been minimized.
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 differencesShow 2 test diffs2 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 35f1109ece895199e4b8d755b101e9a481d18243 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (35f1109): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 481.81s -> 483.075s (0.26%) |
Subtree update of
compiler-builtinsto rust-lang/compiler-builtins@8173070.Created using https://github.com/rust-lang/josh-sync.
r? @ghost