Commit Graph

232 Commits

Author SHA1 Message Date
Trevor Gross
91480ccf44 ci: Do a quick check for system runtime performance
This gives a very rough idea of what is reasonable for test volume on
each arch, and hints if a job happens to pick up a slow runner. We don't
really need this to run each time but we have been adding and removing
runners with some frequency recently, and it only takes about five
seconds to build and run.

Results from CI:

| Target                              | Environment      | Single-core score | Multi-core score  |
|-------------------------------------|------------------|-------------------|-------------------|
| aarch64-apple-darwin                | Native           | 490               | 1371              |
| aarch64-pc-windows-msvc             | Native           | 492               | 1819              |
| aarch64-unknown-linux-gnu           | Native           | 627               | 2318              |
| arm-unknown-linux-gnueabi           | QEMU (Docker)    | 19                | 72                |
| arm-unknown-linux-gnueabihf         | QEMU (Docker)    | 37                | 136               |
| armv7-unknown-linux-gnueabihf       | Native           | 278               | 2026              |
| armv7-unknown-linux-gnueabihf       | QEMU (Docker)    | 37                | 137               |
| i586-unknown-linux-gnu              | Native (Docker)  | 248               | 916               |
| i686-pc-windows-gnu                 | Native           | 321               | 1188              |
| i686-pc-windows-msvc                | Native           | 541               | 2002              |
| i686-unknown-linux-gnu              | Native (Docker)  | 323               | 1193              |
| loongarch64-unknown-linux-gnu       | QEMU (Docker)    | 86                | 320               |
| powerpc-unknown-linux-gnu           | QEMU (Docker)    | 23                | 86                |
| powerpc64-unknown-linux-gnu         | QEMU (Docker)    | 44                | 164               |
| powerpc64-unknown-linux-musl        | Native           | 215               | 7770              |
| powerpc64le-unknown-linux-gnu       | Native           | 107               | 397               |
| powerpc64le-unknown-linux-gnu       | QEMU (Docker)    | 42                | 157               |
| riscv64gc-unknown-linux-gnu         | QEMU (Docker)    | 100               | 371               |
| s390x-unknown-linux-gnu             | Native           | 243               | 899               |
| thumbv7neon-unknown-linux-gnueabihf | QEMU (Docker)    | 50                | 186               |
| x86_64-apple-darwin                 | Native           | 192               | 711               |
| x86_64-pc-windows-gnu,              | Native           | 456               | 1689              |
| x86_64-pc-windows-msvc              | Native           | 462               | 1709              |
| x86_64-unknown-linux-gnu            | Native (Docker)  | 457               | 1689              |
2026-10-08 11:37:17 -05:00
Mend Renovate
e89394a326 chore(deps): update rust crate gungraun to 0.20.0 2026-09-28 23:23:43 -04:00
Trevor Gross
908d02a1cf macros: Update to syn 3.0 2026-08-10 05:41:13 -04:00
Trevor Gross
3b21362528 symcheck: Update to object 0.40
The biggest thing here is a change from integers to newtypes for most
flags.

Link: 400e64fbcb/CHANGELOG.md (0400)
2026-08-10 04:39:29 -04:00
Trevor Gross
dfc678553d symcheck: Make the crate actually called symcheck
I've always referred to the crate as `symcheck` rather than
`symbol-check`; make this its actual name.
2026-08-07 10:01:55 -04:00
Marijn Schouten
8286947b72 replace cfg_if with cfg_select
Now that cfg_select is stable, we can start to replace cfg_if. One
difference is that cfg_select needs one branch to match. Therefore an
empty default branch is sometimes needed.

This is using a local impl of cfg_select (thanks @folkertdev [1]) so as
not to have to increase msrv.

[1]: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/compiler-builtins.20msrv.20policy.3F/near/606320965
2026-06-30 18:48:43 -04:00
Mend Renovate
86098ec7b6 chore(deps): update rust crate gungraun to 0.19.0 2026-05-15 19:41:43 -05:00
Mend Renovate
b61f1716c7 chore(deps): update rust crate gungraun to 0.18.0 2026-04-16 13:44:34 -04:00
Trevor Gross
3af9faa6cd test: Move tidy_lists from update-api-list.py to a new crate
This is the first step of migrating `update-api-list.py` to something
that handles the compiler-builtins functions.
2026-04-10 06:30:25 -04:00
Mend Renovate
6dd2ec0ce5 chore(deps): update rust crate object to 0.39.0 2026-04-01 05:55:05 -04:00
Trevor Gross
ce25428693 c-b: Change the mangled-names feature to unmangled-names
This feature is somewhat backwards because the mangled names are always
available; enabling the `mangled-names` feature disables unmangled
names. This was likely somehow related to default features when the
crate was published on crates.io.

Rename the feature and reverse the logic such that unmangled names are
exposed when the feature `unmangled-names` is enabled.

Note that this changes some benchmarking logic; see the following commit
message for details.
2026-03-31 21:35:45 -04:00
Trevor Gross
b6d05f5993 test: Move libm-macros/shared.rs to a new api-list-common crate
This file is already used in two places and was going to be needed in
another. Turning it into its own crate makes things easier to work with,
and allows for the removal of a few `allow(dead_code)` instances.
2026-03-27 07:29:27 -04:00
Trevor Gross
8fd2474e2d meta: Upgrade all dependencies to the latest incompatible versions
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
2026-02-13 17:47:29 -06:00
Trevor Gross
6aa1e6932d util: Add support for decomposing floats 2026-02-12 00:52:58 -06:00
Trevor Gross
0d2a5d24d3 symcheck: Switch to getopts for argument parsing
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.
2026-02-10 00:56:43 -06:00
Trevor Gross
0538f7b2ab meta: Switch to workspace dependencies
We have a handful of repeated dependencies that can be cleaned up, so
change here.
2026-02-07 07:51:17 -06:00
Juho Kahala
b0f680cfa4 Set codegen-units=1 for benchmarks
This should remove some of the nondeterminism in benchmark results
observed in rust-lang/compiler-builtins#935.
2026-01-23 18:05:22 -06:00
Trevor Gross
c8f0d643c0 bench: Add strip = false to the bench profile
This is already the default but gungraun requires it, so make it
explicit.
2025-12-05 04:43:01 -05:00
Trevor Gross
1cfe3585e7 bench: Update the benchmark runner to gungraun 0.17
`iai-callgrind` was renamed to `gungraun` and had a new release. Update
everything to match.

There shouldn't be any changes to observable behavior here.
2025-12-04 21:35:41 -05:00
Jakub Beránek
2f20628da2 Remove josh-sync crate 2025-07-08 08:56:34 +02:00
Trevor Gross
7222fa6f34 Work around out-of-tree testing with a shim crate
Out-of-tree testing is broken with the most recent update from
rust-lang/rust because it makes `compiler-builtins` depend on `core` by
path, which isn't usually available. In order to enable testing outside
of rust-lang/rust, add a new crate `builtins-shim` that uses the same
source as `compiler-builtins` but drops the `core` dependency. This has
replaced `compiler-builtins` as the workspace member and entrypoint for
tests.
2025-06-14 06:56:18 +00:00
Trevor Gross
3353a891e3 Add tooling for josh syncs
Create a crate that handles pulling from and pushing to rust-lang/rust.
This can be invoked with the following:

    $ cargo run -p josh-sync -- rustc-pull
    $ RUSTC_GIT=/path/to/rust/checkout cargo run -p josh-sync -- rustc-push <username>
2025-06-04 18:06:15 +00:00
Trevor Gross
a63f4826cf Replace the nm symbol check with a Rust implementation
This should be less error-prone and adaptable than the `nm` version, and
have better cross-platform support without needing LLVM `nm` installed.
2025-05-29 15:38:10 +00:00
Trevor Gross
d30dde73b3 fix: Switch to resolver v2
The published crates fail to build with an edition less than 2024
because they are packaged with `resolver = "3"`, which is a 2024-only
option. Revert back to resolver v2 to drop this requirement.

Fixes: https://github.com/rust-lang/compiler-builtins/issues/883
2025-04-22 04:00:49 -04:00
Trevor Gross
4e8eea696d Add panic-handler to the workspace
This crate does not interact with features so there isn't any reason it
can't become part of the workspace.
2025-04-20 05:33:19 -04:00
Trevor Gross
9c96f245b8 ci: Enable testing of libm crates
Update `run.sh` to start testing `libm`. Currently this is somewhat
inefficient because `builtins-test` gets run more than once on some
targets; this can be cleaned up later.
2025-04-20 03:22:27 -04:00
Trevor Gross
141c7b06c4 Add remaining libm crates to the workspace
These are still not yet covered in CI since we always name explicit
packages there, but all crates are now part of the workspace.
2025-04-19 23:20:13 -04:00
Trevor Gross
a48de6950c Move builtins-test-intrinsics out of the workspace
This crate doesn't need to be a default member since it requires the
opposite settings from everything else. Exclude it from the workspace
and run it only when explicitly requested.

This also makes `cargo t --no-default-features` work without additional
qualifiers. `--no-default-features` still needs to be passed to ensure
`#![compiler_builtins]` does not get set.

compiler-builtins needs doctests disabled in order for everything to
work correctly, since this causes an error running rustdoc that is
unrelated to features (our `compiler_builtins` is getting into the crate
graph before that from the sysroot, but `#![compiler_builtins]` is not
set).

We can also remove `test = false` and `doctest = false` in
`builtins-test` since these no longer cause issues. This is unlikely to
be used but it is better to not quietly skip if anything ever gets added
by accident.
2025-04-19 22:30:58 -04:00
Trevor Gross
66fa4fd265 Add libm and libm-macros to the workspace
These should build and test correctly. `libm-test` and others that
depend on it are excluded since the necessary CI is not yet set up.
2025-04-19 19:05:49 -04:00
Trevor Gross
92b1e8454d Rename testcrate to builtins-test
The repo will soon have `libm` as a top-level crate, so make it clear
that this is only the test crate for `compiler-builtins`.
2025-04-18 21:14:41 -04:00
Trevor Gross
683485cda2 Switch repository layout to use a virtual manifest
The current setup has the `Cargo.toml` for `compiler-builtins` at the
repository root, which means all support crates and other files are
located within the package root. This works for now but is not the
cleanest setup since files that should or shouldn't be included in the
package need to be configured in `Cargo.toml`. If we eventually merge
`libm` development into this repository, it would be nice to make this
separation more straightforward.

Begin cleaning things up by moving the crate source to a new
`compiler-builtins` directory and adding a virtual manifest. For now the
`libm` submodule is also moved, but in the future it can likely move
back to the top level (ideally `compiler-builtins/src` would contain a
symlink to `libm/src/math`, but unfortunately it seems like Cargo does
not like something about the submodule + symlink combination).
2025-03-19 00:49:34 -05:00
Trevor Gross
a179959e0b Move examples/intrinsics.rs to its own crate
Currently there is an interesting situation with the way features get
enabled; `testcrate` enables `mangled-names`, but the `intrinsics.rs`
example requires this feature be disabled (otherwise the test fails with
missing symbols, as expected). This is also the reason that `testcrate`
is not a default workspace member, meaning `cargo test` doesn't actually
run `testcrate`'s tests; making it a default member would mean that
`compiler-builtins/mangled-names` gets enabled when
`examples/intrinsics.rs` gets built, due to the way features get
unified.

Simplify the situation by making moving the example to its own crate as
`builtins-test-intrinsics`. This also means `testcrate` can become a
default member so it is included in `cargo check` or `cargo test` when
run at the workspace root.

`testcrate` and `builtins-test-intrinsics` still can't be built at the
same time since there isn't a straightforward way to have Cargo build
`compiler-builtins` twice with different features. This is a side effect
of us using non-additive features, but there isn't really a better
option since enabling both mangled and unmangled names would render
`builtins-test-intrinsics` useless.
2025-03-18 05:35:19 -05:00
Trevor Gross
1112886edc Use the v2 resolver in the workspace 2025-03-06 04:04:39 -05:00
github-actions[bot]
795fa2f40a chore: release v0.1.151 2025-03-05 01:32:53 -05:00
github-actions[bot]
4b664fd2ef chore: release v0.1.150 2025-03-01 14:54:11 -05:00
github-actions[bot]
45c4a1d1b5 chore: release v0.1.149 2025-02-25 14:02:15 -05:00
github-actions[bot]
95a5ad5225 chore: release v0.1.148 2025-02-24 02:43:13 -05:00
github-actions[bot]
f851256581 chore: release v0.1.147 2025-02-19 19:16:19 -05:00
github-actions[bot]
84cb50e5b5 chore: release v0.1.146 2025-02-06 17:46:20 -06:00
github-actions[bot]
dbd3032d42 chore: release v0.1.145 2025-02-04 10:46:49 +00:00
github-actions[bot]
49595ea04e chore: release v0.1.144 2025-01-15 21:19:09 +00:00
github-actions[bot]
05d429523d chore: release v0.1.143 2025-01-15 03:53:29 +00:00
github-actions[bot]
d0a79fd542 chore: release v0.1.142 2025-01-07 23:21:35 +00:00
github-actions[bot]
1b0adb233c chore: release v0.1.141 2025-01-07 01:57:53 +00:00
github-actions[bot]
a078f5a0c5 chore: release v0.1.140 2024-12-26 00:16:33 -05:00
github-actions[bot]
c33f521bb5 chore: release v0.1.139 2024-11-03 23:08:41 +00:00
github-actions[bot]
4c7450d10c chore: release v0.1.138 2024-11-01 11:00:27 +00:00
github-actions[bot]
94e6ed373a chore: release v0.1.137 2024-10-31 19:13:38 -05:00
github-actions[bot]
f9914e98b3 chore: release v0.1.136 2024-10-26 23:29:14 +00:00
Trevor Gross
6399bed36c Update licensing to MIT AND Apache-2.0 WITH LLVM-exception
Currently, Cargo.toml specifies Apache-2.0 OR MIT, but LICENSE.txt
describes MIT OR NCSA. compiler-builtins is derived from LLVM's
compiler-rt. LICENSE.txt correctly reflects the state of compiler-rt
prior to relicensing on 2019-01-19, during which time software was
available for use under either MIT or the University of Illinois NCSA
license. After relicensing, however, compiler-rt is available for use
only under Apache-2.0 with the LLVM exception; this is not reflected
anywhere in the repository.

Update the SPDX license identifier to `MIT AND Apache-2.0 WITH
LLVM-exception AND (MIT OR Apache-2.0)`. Each AND portion covers
something specific:

* Apache-2.0 WITH LLVM-exception: this covers work that is derived from
  the LLVM repository since after the LLVM relicensing.
* MIT: This covers work that is derived from LLVM before the LLVM
  relicensing (under MIT OR NCSA), as well as the vendored `libm`
  components.
* MIT AND Apache-2.0: This ensures that any contributions to this
  repository, in addition to meeting the above required licenses, is
  also released for use under the Rust-standard Apache-2.0 with no LLVM
  exception.

See also the parallel license update in rust-lang/libm [1].

Fixes: https://github.com/rust-lang/compiler-builtins/issues/307
Closes: https://github.com/rust-lang/compiler-builtins/pull/511
Link: https://rust-lang.zulipchat.com/#narrow/channel/335408-foundation/topic/Request.20for.20legal.20team.20input.20on.20crate.20licensing
Link: https://github.com/rust-lang/libm/pull/317 [1]
2024-10-26 17:35:26 -05:00