Skip to content

Commit f9c15f4

Browse files
committed
Auto merge of #142669 - GuillaumeGomez:subtree-update_cg_gcc_2025-06-18, r=GuillaumeGomez
Update GCC backend subtree
2 parents 6f935a0 + 8648405 commit f9c15f4

Some content is hidden

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

53 files changed

+11916
-10357
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"allowCompoundWords": true,
3+
"dictionaries": ["cpp", "rust-extra", "rustc_codegen_gcc"],
4+
"dictionaryDefinitions": [
5+
{
6+
"name": "rust-extra",
7+
"path": "tools/cspell_dicts/rust.txt",
8+
"addWords": true
9+
},
10+
{
11+
"name": "rustc_codegen_gcc",
12+
"path": "tools/cspell_dicts/rustc_codegen_gcc.txt",
13+
"addWords": true
14+
}
15+
],
16+
"files": [
17+
"src/**/*.rs"
18+
],
19+
"ignorePaths": [
20+
"src/intrinsic/archs.rs",
21+
"src/intrinsic/llvm.rs"
22+
],
23+
"ignoreRegExpList": [
24+
"/(FIXME|NOTE|TODO)\\([^)]+\\)/",
25+
"__builtin_\\w*"
26+
]
27+
}

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

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ permissions:
1212
env:
1313
# Enable backtraces for easier debugging
1414
RUST_BACKTRACE: 1
15+
# For the run-make tests.
16+
LLVM_BIN_DIR: /usr/bin
1517

1618
jobs:
1719
build:
@@ -48,7 +50,7 @@ jobs:
4850

4951
- name: Install packages
5052
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
51-
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
53+
run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm
5254

5355
- name: Install rustfmt & clippy
5456
run: rustup component add rustfmt clippy
@@ -61,11 +63,15 @@ jobs:
6163
sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}
6264
echo 'gcc-path = "/usr/lib/"' > config.toml
6365
66+
# Some run-make tests fail if we use our forked GCC because it doesn't
67+
# bundle libstdc++, so we switch to gcc-14 to have a GCC that has
68+
# libstdc++.
69+
- name: Set default GCC to gcc-14
70+
run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30
71+
6472
- name: Set env
6573
run: |
6674
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
67-
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
68-
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
6975
7076
#- name: Cache rust repository
7177
## We only clone the rust repository for rustc tests
@@ -76,12 +82,22 @@ jobs:
7682
#path: rust
7783
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
7884

85+
- name: Prepare
86+
run: ./y.sh prepare --only-libcore
87+
88+
- name: Check formatting
89+
run: ./y.sh fmt --check
90+
91+
- name: clippy
92+
run: |
93+
cargo clippy --all-targets -- -D warnings
94+
cargo clippy --all-targets --no-default-features -- -D warnings
95+
cargo clippy --manifest-path build_system/Cargo.toml --all-targets -- -D warnings
96+
7997
- name: Build
8098
run: |
81-
./y.sh prepare --only-libcore
8299
./y.sh build --sysroot
83-
./y.sh test --mini-tests
84-
cargo test
100+
./y.sh test --cargo-tests
85101
86102
- name: Run y.sh cargo build
87103
run: |
@@ -101,20 +117,19 @@ jobs:
101117
run: |
102118
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }}
103119
104-
- name: Check formatting
105-
run: ./y.sh fmt --check
106-
107-
- name: clippy
108-
run: |
109-
cargo clippy --all-targets -- -D warnings
110-
cargo clippy --all-targets --features master -- -D warnings
111-
112120
duplicates:
113121
runs-on: ubuntu-24.04
114122
steps:
115123
- uses: actions/checkout@v4
116124
- run: python tools/check_intrinsics_duplicates.py
117125

126+
spell_check:
127+
runs-on: ubuntu-24.04
128+
steps:
129+
- uses: actions/checkout@v4
130+
- uses: crate-ci/[email protected]
131+
- uses: streetsidesoftware/cspell-action@v7
132+
118133
build_system:
119134
runs-on: ubuntu-24.04
120135
steps:

compiler/rustc_codegen_gcc/.github/workflows/failures.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
run: |
6767
sudo dpkg --force-overwrite -i gcc-15.deb
6868
echo 'gcc-path = "/usr/lib"' > config.toml
69-
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
70-
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
69+
70+
7171
7272
- name: Set env
7373
run: |

compiler/rustc_codegen_gcc/.github/workflows/m68k.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
- name: Set env
6666
run: |
6767
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
68-
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
69-
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
68+
69+
7070
7171
#- name: Cache rust repository
7272
## We only clone the rust repository for rustc tests
@@ -95,7 +95,7 @@ jobs:
9595
./y.sh prepare --only-libcore --cross
9696
./y.sh build --sysroot --features compiler_builtins/no-f16-f128 --target-triple m68k-unknown-linux-gnu
9797
./y.sh test --mini-tests
98-
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test
98+
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu ./y.sh test --cargo-tests
9999
./y.sh clean all
100100
101101
- name: Prepare dependencies

compiler/rustc_codegen_gcc/.github/workflows/release.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ permissions:
1212
env:
1313
# Enable backtraces for easier debugging
1414
RUST_BACKTRACE: 1
15+
# For the run-make tests.
16+
LLVM_BIN_DIR: /usr/bin
1517

1618
jobs:
1719
build:
@@ -36,7 +38,8 @@ jobs:
3638
uses: Swatinem/rust-cache@v2
3739

3840
- name: Install packages
39-
run: sudo apt-get install ninja-build ripgrep
41+
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for run-make tests.
42+
run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm
4043

4144
- name: Download artifact
4245
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-15.deb
@@ -46,18 +49,21 @@ jobs:
4649
sudo dpkg --force-overwrite -i gcc-15.deb
4750
echo 'gcc-path = "/usr/lib/"' > config.toml
4851
52+
# Some run-make tests fail if we use our forked GCC because it doesn't
53+
# bundle libstdc++, so we switch to gcc-14 to have a GCC that has
54+
# libstdc++.
55+
- name: Set default GCC to gcc-14
56+
run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30
57+
4958
- name: Set env
5059
run: |
5160
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
52-
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
53-
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
5461
5562
- name: Build
5663
run: |
5764
./y.sh prepare --only-libcore
5865
EMBED_LTO_BITCODE=1 ./y.sh build --sysroot --release --release-sysroot
59-
./y.sh test --mini-tests
60-
cargo test
66+
./y.sh test --cargo-tests
6167
./y.sh clean all
6268
6369
- name: Prepare dependencies

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
if: ${{ !matrix.cargo_runner }}
9191
run: |
9292
./y.sh test --release --clean --release-sysroot --build-sysroot --mini-tests --std-tests --test-libcore
93-
cargo test
93+
./y.sh test --cargo-tests
9494
9595
- name: Run stdarch tests
9696
if: ${{ !matrix.cargo_runner }}

compiler/rustc_codegen_gcc/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ tools/llvmint-2
1919
llvm
2020
build_system/target
2121
config.toml
22-
build
22+
build
23+
rustlantis

compiler/rustc_codegen_gcc/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To run specific tests, use appropriate flags such as:
3333

3434
- `./y.sh test --test-libcore`
3535
- `./y.sh test --std-tests`
36-
- `cargo test -- <name of test>`
36+
- `./y.sh test --cargo-tests -- <name of test>`
3737

3838
Additionally, you can run the tests of `libgccjit`:
3939

compiler/rustc_codegen_gcc/Cargo.lock

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ dependencies = [
8181
"unicode-width",
8282
]
8383

84+
[[package]]
85+
name = "getrandom"
86+
version = "0.3.3"
87+
source = "registry+https://github.com/rust-lang/crates.io-index"
88+
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
89+
dependencies = [
90+
"cfg-if",
91+
"libc",
92+
"r-efi",
93+
"wasi",
94+
]
95+
8496
[[package]]
8597
name = "hermit-abi"
8698
version = "0.3.1"
@@ -111,9 +123,9 @@ checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"
111123

112124
[[package]]
113125
name = "linux-raw-sys"
114-
version = "0.4.14"
126+
version = "0.9.4"
115127
source = "registry+https://github.com/rust-lang/crates.io-index"
116-
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89"
128+
checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
117129

118130
[[package]]
119131
name = "memchr"
@@ -137,6 +149,12 @@ version = "1.20.2"
137149
source = "registry+https://github.com/rust-lang/crates.io-index"
138150
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
139151

152+
[[package]]
153+
name = "r-efi"
154+
version = "5.2.0"
155+
source = "registry+https://github.com/rust-lang/crates.io-index"
156+
checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
157+
140158
[[package]]
141159
name = "regex"
142160
version = "1.8.4"
@@ -166,9 +184,9 @@ dependencies = [
166184

167185
[[package]]
168186
name = "rustix"
169-
version = "0.38.42"
187+
version = "1.0.7"
170188
source = "registry+https://github.com/rust-lang/crates.io-index"
171-
checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85"
189+
checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266"
172190
dependencies = [
173191
"bitflags",
174192
"errno",
@@ -188,12 +206,12 @@ dependencies = [
188206

189207
[[package]]
190208
name = "tempfile"
191-
version = "3.14.0"
209+
version = "3.20.0"
192210
source = "registry+https://github.com/rust-lang/crates.io-index"
193-
checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c"
211+
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
194212
dependencies = [
195-
"cfg-if",
196213
"fastrand",
214+
"getrandom",
197215
"once_cell",
198216
"rustix",
199217
"windows-sys",
@@ -242,6 +260,15 @@ dependencies = [
242260
"winapi-util",
243261
]
244262

263+
[[package]]
264+
name = "wasi"
265+
version = "0.14.2+wasi-0.2.4"
266+
source = "registry+https://github.com/rust-lang/crates.io-index"
267+
checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3"
268+
dependencies = [
269+
"wit-bindgen-rt",
270+
]
271+
245272
[[package]]
246273
name = "winapi"
247274
version = "0.3.9"
@@ -345,3 +372,12 @@ name = "windows_x86_64_msvc"
345372
version = "0.52.6"
346373
source = "registry+https://github.com/rust-lang/crates.io-index"
347374
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
375+
376+
[[package]]
377+
name = "wit-bindgen-rt"
378+
version = "0.39.0"
379+
source = "registry+https://github.com/rust-lang/crates.io-index"
380+
checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1"
381+
dependencies = [
382+
"bitflags",
383+
]

compiler/rustc_codegen_gcc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ gccjit = "2.7"
3131
[dev-dependencies]
3232
boml = "0.3.1"
3333
lang_tester = "0.8.0"
34-
tempfile = "3.7.1"
34+
tempfile = "3.20"
3535

3636
[profile.dev]
3737
# By compiling dependencies with optimizations, performing tests gets much faster.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[default.extend-words]
2+
ba = "ba"
3+
hsa = "hsa"
4+
olt = "olt"
5+
seh = "seh"
6+
typ = "typ"
7+
8+
[files]
9+
extend-exclude = ["src/intrinsic/archs.rs"]

0 commit comments

Comments
 (0)