Skip to content

Commit f6d154e

Browse files
committed
Auto merge of #159844 - GuillaumeGomez:subtree-update_cg_gcc_2026-07-24, r=<try>
Subtree cg_gcc sync (2026-07-24) try-job: x86_64-gnu-gcc-core-tests
2 parents 29e68fe + 9cc82eb commit f6d154e

61 files changed

Lines changed: 1933 additions & 579 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/rustc_codegen_gcc/.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"src/intrinsic/llvm.rs"
2323
],
2424
"ignoreRegExpList": [
25-
"/(FIXME|NOTE|TODO)\\([^)]+\\)/",
25+
"/(FIXME|NOTE)\\([^)]+\\)/",
2626
"__builtin_\\w*"
2727
]
2828
}

compiler/rustc_codegen_gcc/.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- { gcc: "gcc-15.deb" }
2727
- { gcc: "gcc-15-without-int128.deb" }
2828
commands: [
29-
"--std-tests",
29+
"--std-tests --alloc-tests",
3030
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
3131
# "--asm-tests",
3232
"--test-libcore",
@@ -36,6 +36,7 @@ jobs:
3636
"--test-successful-rustc --nb-parts 2 --current-part 0",
3737
"--test-successful-rustc --nb-parts 2 --current-part 1",
3838
"--projects",
39+
"--gcc-asm-tests",
3940
]
4041

4142
steps:
@@ -88,6 +89,9 @@ jobs:
8889
- name: Check formatting
8990
run: ./y.sh fmt --check
9091

92+
- name: Check todo
93+
run: ./y.sh check-todo
94+
9195
- name: clippy
9296
run: |
9397
cargo clippy --all-targets -- -D warnings
@@ -98,6 +102,7 @@ jobs:
98102
run: |
99103
./y.sh build --sysroot
100104
./y.sh test --cargo-tests
105+
CARGO_TEST_FLAGS="-Zmir-preserve-ub" ./y.sh test --cargo-tests -- mir_preserve_ub_empty_switch
101106
102107
- name: Run y.sh cargo build
103108
run: |

compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
cargo_runner: [
24-
"sde -future -rtm_mode full --",
24+
"sde -cpuid-in /home/runner/work/rustc_codegen_gcc/rustc_codegen_gcc/tests/cpuid.def -rtm_mode full --",
2525
"",
2626
]
2727

@@ -42,19 +42,24 @@ jobs:
4242
- name: Install more recent binutils
4343
run: |
4444
echo "deb http://archive.ubuntu.com/ubuntu plucky main universe" | sudo tee /etc/apt/sources.list.d/plucky-copies.list
45-
sudo apt-get update
45+
sudo apt-get update -o Acquire::Retries=3
4646
sudo apt-get install binutils
47+
installed="$(dpkg-query --showformat='${Version}' --show binutils)"
48+
echo "Installed binutils: $installed"
49+
if dpkg --compare-versions "$installed" lt "2.44"; then
50+
echo "::error::binutils upgrade failed (got $installed, need >= 2.44); the apt fetch probably failed"
51+
exit 1
52+
fi
4753
4854
- name: Install Intel Software Development Emulator
4955
if: ${{ matrix.cargo_runner }}
5056
run: |
5157
mkdir intel-sde
5258
cd intel-sde
5359
version=10.8.0-2026-03-15
54-
url_path=915934
5560
dir=sde-external-$version-lin
5661
file=$dir.tar.xz
57-
wget https://downloadmirror.intel.com/$url_path/$file
62+
wget http://ci-mirrors.rust-lang.org/$file
5863
tar xvf $file
5964
sudo mkdir /usr/share/intel-sde
6065
sudo cp -r $dir/* /usr/share/intel-sde
@@ -90,14 +95,15 @@ jobs:
9095
- name: Run stdarch tests
9196
if: ${{ !matrix.cargo_runner }}
9297
run: |
93-
CHANNEL=release TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml
98+
# FIXME: remove --skip test_tile_ and --skip --skip test__tile when it's implemented.
99+
./y.sh test --release --stdarch-tests -- --skip test_tile_ --skip test__tile
94100
95101
- name: Run stdarch tests
96102
if: ${{ matrix.cargo_runner }}
97103
run: |
98104
# FIXME: these tests fail when the sysroot is compiled with LTO because of a missing symbol in proc-macro.
99-
# FIXME: remove --skip test_tile_ when it's implemented.
100-
STDARCH_TEST_SKIP_FUNCTION="xsave,xsaveopt,xsave64,xsaveopt64" STDARCH_TEST_EVERYTHING=1 CHANNEL=release CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="${{ matrix.cargo_runner }}" TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml -- --skip rtm --skip tbm --skip sse4a --skip test_tile_
105+
# FIXME: remove --skip test_tile_ and --skip --skip test__tile when it's implemented.
106+
STDARCH_TEST_SKIP_FUNCTION="xsave,xsaveopt,xsave64,xsaveopt64" STDARCH_TEST_EVERYTHING=1 CHANNEL=release CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="${{ matrix.cargo_runner }}" TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml -- --skip rtm --skip tbm --skip sse4a --skip test_tile_ --skip test__tile
101107
102108
# Summary job for the merge queue.
103109
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!

compiler/rustc_codegen_gcc/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ perf.data.old
77
*.events
88
*.string*
99
gimple*
10-
*asm
10+
*_asm
1111
res
1212
test-backend
1313
projects

compiler/rustc_codegen_gcc/Cargo.lock

Lines changed: 21 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
3131

3232
[[package]]
3333
name = "errno"
34-
version = "0.3.10"
34+
version = "0.3.14"
3535
source = "registry+https://github.com/rust-lang/crates.io-index"
36-
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
36+
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
3737
dependencies = [
3838
"libc",
3939
"windows-sys",
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "3.3.0"
59+
version = "3.7.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "26b73d18b642ce16378af78f89664841d7eeafa113682ff5d14573424eb0232a"
61+
checksum = "37885008422371f81d654ddfbf9b8ab3c5e1b0b54146bf5ff4b74ae91812e8ba"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "1.3.0"
68+
version = "1.7.0"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "ee689456c013616942d5aef9a84d613cefcc3b335340d036f3650fc1a7459e15"
70+
checksum = "1e00d0323f55a3b71b302620571d44cd45fd05b4eb6bba6dd7f716095b8ab8cf"
7171
dependencies = [
7272
"libc",
7373
]
@@ -117,15 +117,15 @@ dependencies = [
117117

118118
[[package]]
119119
name = "libc"
120-
version = "0.2.168"
120+
version = "0.2.186"
121121
source = "registry+https://github.com/rust-lang/crates.io-index"
122-
checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"
122+
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
123123

124124
[[package]]
125125
name = "linux-raw-sys"
126-
version = "0.9.4"
126+
version = "0.12.1"
127127
source = "registry+https://github.com/rust-lang/crates.io-index"
128-
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
128+
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
129129

130130
[[package]]
131131
name = "memchr"
@@ -194,9 +194,9 @@ dependencies = [
194194

195195
[[package]]
196196
name = "rustix"
197-
version = "1.0.7"
197+
version = "1.1.4"
198198
source = "registry+https://github.com/rust-lang/crates.io-index"
199-
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
199+
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
200200
dependencies = [
201201
"bitflags",
202202
"errno",
@@ -216,9 +216,9 @@ dependencies = [
216216

217217
[[package]]
218218
name = "tempfile"
219-
version = "3.20.0"
219+
version = "3.27.0"
220220
source = "registry+https://github.com/rust-lang/crates.io-index"
221-
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
221+
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
222222
dependencies = [
223223
"fastrand",
224224
"getrandom",
@@ -311,78 +311,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
311311
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
312312

313313
[[package]]
314-
name = "windows-sys"
315-
version = "0.59.0"
314+
name = "windows-link"
315+
version = "0.2.1"
316316
source = "registry+https://github.com/rust-lang/crates.io-index"
317-
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
318-
dependencies = [
319-
"windows-targets",
320-
]
317+
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
321318

322319
[[package]]
323-
name = "windows-targets"
324-
version = "0.52.6"
320+
name = "windows-sys"
321+
version = "0.61.2"
325322
source = "registry+https://github.com/rust-lang/crates.io-index"
326-
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
323+
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
327324
dependencies = [
328-
"windows_aarch64_gnullvm",
329-
"windows_aarch64_msvc",
330-
"windows_i686_gnu",
331-
"windows_i686_gnullvm",
332-
"windows_i686_msvc",
333-
"windows_x86_64_gnu",
334-
"windows_x86_64_gnullvm",
335-
"windows_x86_64_msvc",
325+
"windows-link",
336326
]
337327

338-
[[package]]
339-
name = "windows_aarch64_gnullvm"
340-
version = "0.52.6"
341-
source = "registry+https://github.com/rust-lang/crates.io-index"
342-
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
343-
344-
[[package]]
345-
name = "windows_aarch64_msvc"
346-
version = "0.52.6"
347-
source = "registry+https://github.com/rust-lang/crates.io-index"
348-
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
349-
350-
[[package]]
351-
name = "windows_i686_gnu"
352-
version = "0.52.6"
353-
source = "registry+https://github.com/rust-lang/crates.io-index"
354-
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
355-
356-
[[package]]
357-
name = "windows_i686_gnullvm"
358-
version = "0.52.6"
359-
source = "registry+https://github.com/rust-lang/crates.io-index"
360-
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
361-
362-
[[package]]
363-
name = "windows_i686_msvc"
364-
version = "0.52.6"
365-
source = "registry+https://github.com/rust-lang/crates.io-index"
366-
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
367-
368-
[[package]]
369-
name = "windows_x86_64_gnu"
370-
version = "0.52.6"
371-
source = "registry+https://github.com/rust-lang/crates.io-index"
372-
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
373-
374-
[[package]]
375-
name = "windows_x86_64_gnullvm"
376-
version = "0.52.6"
377-
source = "registry+https://github.com/rust-lang/crates.io-index"
378-
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
379-
380-
[[package]]
381-
name = "windows_x86_64_msvc"
382-
version = "0.52.6"
383-
source = "registry+https://github.com/rust-lang/crates.io-index"
384-
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
385-
386328
[[package]]
387329
name = "wit-bindgen-rt"
388330
version = "0.39.0"

compiler/rustc_codegen_gcc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ default = ["master"]
2020
[dependencies]
2121
object = { version = "0.37.0", default-features = false, features = ["std", "read"] }
2222
tempfile = "3.20"
23-
gccjit = { version = "3.3.0", features = ["dlopen"] }
23+
gccjit = { version = "3.7.0", features = ["dlopen"] }
2424
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs", branch = "error-dlopen", features = ["dlopen"] }
2525

2626
# Local copy.

compiler/rustc_codegen_gcc/Readme.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,19 +136,21 @@ $ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
136136
### Cargo
137137

138138
```bash
139-
$ CHANNEL="release" $CG_GCCJIT_DIR/y.sh cargo run
139+
$ CHANNEL=release $CG_GCCJIT_DIR/y.sh cargo run
140140
```
141141

142-
If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./y.sh test`) you should use `CHANNEL="debug"` instead or omit `CHANNEL="release"` completely.
142+
If you compiled `cg_gcc` in debug mode (aka you didn't pass `--release` to `./y.sh build`) you should use `CHANNEL=debug` instead or omit `CHANNEL=release` completely.
143143

144144
### Rustc
145145

146146
If you want to run `rustc` directly, you can do so with:
147147

148148
```bash
149-
$ ./y.sh rustc my_crate.rs
149+
$ CHANNEL=release ./y.sh rustc my_crate.rs
150150
```
151151

152+
If you compiled `cg_gcc` in debug mode (aka you didn't pass `--release` to `./y.sh build`) you should use `CHANNEL=debug` instead or omit `CHANNEL=release` completely.
153+
152154
You can do the same manually (although we don't recommend it):
153155

154156
```bash

compiler/rustc_codegen_gcc/build_system/Cargo.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is automatically @generated by Cargo.
22
# It is not intended for manual editing.
3-
version = 3
3+
version = 4
44

55
[[package]]
66
name = "boml"

0 commit comments

Comments
 (0)