Skip to content

Commit c9ff496

Browse files
committed
Auto merge of #160468 - GuillaumeGomez:revert-159844, r=JonathanBrouwer
Revert #159844 r? @JonathanBrouwer
2 parents 5048696 + bf57193 commit c9ff496

66 files changed

Lines changed: 675 additions & 2176 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)\\([^)]+\\)/",
25+
"/(FIXME|NOTE|TODO)\\([^)]+\\)/",
2626
"__builtin_\\w*"
2727
]
2828
}

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

Lines changed: 9 additions & 8 deletions
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 --alloc-tests",
29+
"--std-tests",
3030
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
3131
# "--asm-tests",
3232
"--test-libcore",
@@ -36,7 +36,6 @@ 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",
4039
]
4140

4241
steps:
@@ -53,6 +52,9 @@ jobs:
5352
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
5453
run: sudo apt-get install ninja-build ripgrep llvm-14-tools llvm
5554

55+
- name: Install rustfmt & clippy
56+
run: rustup component add rustfmt clippy
57+
5658
- name: Download artifact
5759
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}
5860

@@ -86,17 +88,16 @@ jobs:
8688
- name: Check formatting
8789
run: ./y.sh fmt --check
8890

89-
- name: Check todo
90-
run: ./y.sh check-todo
91-
92-
- name: Check lints
93-
run: ./y.sh clippy
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
9496
9597
- name: Build
9698
run: |
9799
./y.sh build --sysroot
98100
./y.sh test --cargo-tests
99-
CARGO_TEST_FLAGS="-Zmir-preserve-ub" ./y.sh test --cargo-tests -- mir_preserve_ub_empty_switch
100101
101102
- name: Run y.sh cargo build
102103
run: |

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

Lines changed: 7 additions & 13 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 -cpuid-in /home/runner/work/rustc_codegen_gcc/rustc_codegen_gcc/tests/cpuid.def -rtm_mode full --",
24+
"sde -future -rtm_mode full --",
2525
"",
2626
]
2727

@@ -42,24 +42,19 @@ 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 -o Acquire::Retries=3
45+
sudo apt-get update
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
5347
5448
- name: Install Intel Software Development Emulator
5549
if: ${{ matrix.cargo_runner }}
5650
run: |
5751
mkdir intel-sde
5852
cd intel-sde
5953
version=10.8.0-2026-03-15
54+
url_path=915934
6055
dir=sde-external-$version-lin
6156
file=$dir.tar.xz
62-
wget http://ci-mirrors.rust-lang.org/$file
57+
wget https://downloadmirror.intel.com/$url_path/$file
6358
tar xvf $file
6459
sudo mkdir /usr/share/intel-sde
6560
sudo cp -r $dir/* /usr/share/intel-sde
@@ -95,15 +90,14 @@ jobs:
9590
- name: Run stdarch tests
9691
if: ${{ !matrix.cargo_runner }}
9792
run: |
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
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
10094
10195
- name: Run stdarch tests
10296
if: ${{ matrix.cargo_runner }}
10397
run: |
10498
# FIXME: these tests fail when the sysroot is compiled with LTO because of a missing symbol in proc-macro.
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
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_
107101
108102
# Summary job for the merge queue.
109103
# 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/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Full list of debugging options can be found in the [README](Readme.md#env-vars).
112112
### Code Style Guidelines
113113

114114
- Follow Rust standard coding conventions
115-
- Ensure your code passes `rustfmt` and `clippy` (you can run them with `y.sh fmt` and `y.sh clippy`)
115+
- Ensure your code passes `rustfmt` and `clippy`
116116
- Add comments explaining complex logic, especially in GCC interface code
117117

118118
## Additional Resources

compiler/rustc_codegen_gcc/Cargo.lock

Lines changed: 79 additions & 21 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.14"
34+
version = "0.3.10"
3535
source = "registry+https://github.com/rust-lang/crates.io-index"
36-
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
36+
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
3737
dependencies = [
3838
"libc",
3939
"windows-sys",
@@ -56,18 +56,18 @@ dependencies = [
5656

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

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

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

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

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

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

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

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

319322
[[package]]
320-
name = "windows-sys"
321-
version = "0.61.2"
323+
name = "windows-targets"
324+
version = "0.52.6"
322325
source = "registry+https://github.com/rust-lang/crates.io-index"
323-
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
326+
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
324327
dependencies = [
325-
"windows-link",
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",
326336
]
327337

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+
328386
[[package]]
329387
name = "wit-bindgen-rt"
330388
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 = "4.0.0", features = ["dlopen"] }
23+
gccjit = { version = "3.3.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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,19 @@ $ ./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_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.
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.
143143

144144
### Rustc
145145

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

148148
```bash
149-
$ CHANNEL=release ./y.sh rustc my_crate.rs
149+
$ ./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-
154152
You can do the same manually (although we don't recommend it):
155153

156154
```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 = 4
3+
version = 3
44

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

0 commit comments

Comments
 (0)