Skip to content

Commit 2ef7858

Browse files
committed
Auto merge of #140015 - GuillaumeGomez:subtree-update_cg_gcc_2025-04-18, r=antoyo
Subtree update GCC backend cc `@antoyo`
2 parents 191df20 + cc359b8 commit 2ef7858

Some content is hidden

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

52 files changed

+960
-1247
lines changed

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

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: CI
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- master
7+
pull_request:
68

79
permissions:
810
contents: read
@@ -121,3 +123,22 @@ jobs:
121123
run: |
122124
cd build_system
123125
cargo test
126+
127+
# Summary job for the merge queue.
128+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
129+
success:
130+
needs: [build, duplicates, build_system]
131+
# We need to ensure this job does *not* get skipped if its dependencies fail,
132+
# because a skipped job is considered a success by GitHub. So we have to
133+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
134+
# when the workflow is canceled manually.
135+
if: ${{ !cancelled() }}
136+
runs-on: ubuntu-latest
137+
steps:
138+
# Manually check the status of all dependencies. `if: failure()` does not work.
139+
- name: Conclusion
140+
run: |
141+
# Print the dependent jobs to see them in the CI log
142+
jq -C <<< '${{ toJson(needs) }}'
143+
# Check if all jobs that we depend on (in the needs array) were successful.
144+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+23-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
name: Failures
33

44
on:
5-
- pull_request
5+
push:
6+
branches:
7+
- master
8+
pull_request:
69

710
permissions:
811
contents: read
@@ -108,3 +111,22 @@ jobs:
108111
echo "Error: 'the compiler unexpectedly panicked' found in output logs. CI Error!!"
109112
exit 1
110113
fi
114+
115+
# Summary job for the merge queue.
116+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
117+
success_failures:
118+
needs: [build]
119+
# We need to ensure this job does *not* get skipped if its dependencies fail,
120+
# because a skipped job is considered a success by GitHub. So we have to
121+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
122+
# when the workflow is canceled manually.
123+
if: ${{ !cancelled() }}
124+
runs-on: ubuntu-latest
125+
steps:
126+
# Manually check the status of all dependencies. `if: failure()` does not work.
127+
- name: Conclusion
128+
run: |
129+
# Print the dependent jobs to see them in the CI log
130+
jq -C <<< '${{ toJson(needs) }}'
131+
# Check if all jobs that we depend on (in the needs array) were successful.
132+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

compiler/rustc_codegen_gcc/.github/workflows/gcc12.yml

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: CI libgccjit 12
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- master
7+
pull_request:
68

79
permissions:
810
contents: read
@@ -85,3 +87,22 @@ jobs:
8587
#- name: Run tests
8688
#run: |
8789
#./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
90+
91+
# Summary job for the merge queue.
92+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
93+
success_gcc12:
94+
needs: [build]
95+
# We need to ensure this job does *not* get skipped if its dependencies fail,
96+
# because a skipped job is considered a success by GitHub. So we have to
97+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
98+
# when the workflow is canceled manually.
99+
if: ${{ !cancelled() }}
100+
runs-on: ubuntu-latest
101+
steps:
102+
# Manually check the status of all dependencies. `if: failure()` does not work.
103+
- name: Conclusion
104+
run: |
105+
# Print the dependent jobs to see them in the CI log
106+
jq -C <<< '${{ toJson(needs) }}'
107+
# Check if all jobs that we depend on (in the needs array) were successful.
108+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
name: m68k CI
44

55
on:
6-
- push
7-
- pull_request
6+
push:
7+
branches:
8+
- master
9+
pull_request:
810

911
permissions:
1012
contents: read
@@ -105,3 +107,22 @@ jobs:
105107
- name: Run tests
106108
run: |
107109
./y.sh test --release --clean --build-sysroot --sysroot-features compiler_builtins/no-f16-f128 ${{ matrix.commands }}
110+
111+
# Summary job for the merge queue.
112+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
113+
success_m68k:
114+
needs: [build]
115+
# We need to ensure this job does *not* get skipped if its dependencies fail,
116+
# because a skipped job is considered a success by GitHub. So we have to
117+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
118+
# when the workflow is canceled manually.
119+
if: ${{ !cancelled() }}
120+
runs-on: ubuntu-latest
121+
steps:
122+
# Manually check the status of all dependencies. `if: failure()` does not work.
123+
- name: Conclusion
124+
run: |
125+
# Print the dependent jobs to see them in the CI log
126+
jq -C <<< '${{ toJson(needs) }}'
127+
# Check if all jobs that we depend on (in the needs array) were successful.
128+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: CI with sysroot compiled in release mode
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- master
7+
pull_request:
68

79
permissions:
810
contents: read
@@ -82,3 +84,22 @@ jobs:
8284
echo "Test is done with LTO enabled, hence inlining should occur across crates"
8385
exit 1
8486
fi
87+
88+
# Summary job for the merge queue.
89+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
90+
success_release:
91+
needs: [build]
92+
# We need to ensure this job does *not* get skipped if its dependencies fail,
93+
# because a skipped job is considered a success by GitHub. So we have to
94+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
95+
# when the workflow is canceled manually.
96+
if: ${{ !cancelled() }}
97+
runs-on: ubuntu-latest
98+
steps:
99+
# Manually check the status of all dependencies. `if: failure()` does not work.
100+
- name: Conclusion
101+
run: |
102+
# Print the dependent jobs to see them in the CI log
103+
jq -C <<< '${{ toJson(needs) }}'
104+
# Check if all jobs that we depend on (in the needs array) were successful.
105+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

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

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: stdarch tests with sysroot compiled in release mode
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- master
7+
pull_request:
68

79
permissions:
810
contents: read
@@ -102,3 +104,22 @@ jobs:
102104
# TODO: remove --skip test_mm512_stream_ps when stdarch is updated in rustc.
103105
# TODO: remove --skip test_tile_ when it's implemented.
104106
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 --cfg stdarch_intel_sde" ./y.sh cargo test --manifest-path build/build_sysroot/sysroot_src/library/stdarch/Cargo.toml -- --skip rtm --skip tbm --skip sse4a --skip test_mm512_stream_ps --skip test_tile_
107+
108+
# Summary job for the merge queue.
109+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
110+
success_stdarch:
111+
needs: [build]
112+
# We need to ensure this job does *not* get skipped if its dependencies fail,
113+
# because a skipped job is considered a success by GitHub. So we have to
114+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
115+
# when the workflow is canceled manually.
116+
if: ${{ !cancelled() }}
117+
runs-on: ubuntu-latest
118+
steps:
119+
# Manually check the status of all dependencies. `if: failure()` does not work.
120+
- name: Conclusion
121+
run: |
122+
# Print the dependent jobs to see them in the CI log
123+
jq -C <<< '${{ toJson(needs) }}'
124+
# Check if all jobs that we depend on (in the needs array) were successful.
125+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

compiler/rustc_codegen_gcc/Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ dependencies = [
5656

5757
[[package]]
5858
name = "gccjit"
59-
version = "2.4.0"
59+
version = "2.5.0"
6060
source = "registry+https://github.com/rust-lang/crates.io-index"
61-
checksum = "72fd91f4adbf02b53cfc73c97bc33c5f253009043f30c56a5ec08dd5c8094dc8"
61+
checksum = "2895ddec764de7ac76fe6c056050c4801a80109c066f177a00a9cc8dee02b29b"
6262
dependencies = [
6363
"gccjit_sys",
6464
]
6565

6666
[[package]]
6767
name = "gccjit_sys"
68-
version = "0.5.0"
68+
version = "0.6.0"
6969
source = "registry+https://github.com/rust-lang/crates.io-index"
70-
checksum = "0fb7b8f48a75e2cfe78c3d9a980b32771c34ffd12d196021ab3f98c49fbd2f0d"
70+
checksum = "ac133db68db8a6a8b2c51ef4b18d8ea16682d5814c4641272fe37bbbc223d5f3"
7171
dependencies = [
7272
"libc",
7373
]

compiler/rustc_codegen_gcc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ master = ["gccjit/master"]
2222
default = ["master"]
2323

2424
[dependencies]
25-
gccjit = "2.4"
25+
gccjit = "2.5"
2626
#gccjit = { git = "https://github.com/rust-lang/gccjit.rs" }
2727

2828
# Local copy.

compiler/rustc_codegen_gcc/Readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ A secondary goal is to check if using the gcc backend will provide any run-time
2323
## Building
2424

2525
**This requires a patched libgccjit in order to work.
26-
You need to use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
26+
You need to use my [fork of gcc](https://github.com/rust-lang/gcc) which already includes these patches.**
2727

2828
```bash
2929
$ cp config.example.toml config.toml
@@ -40,7 +40,7 @@ to do a few more things.
4040
To build it (most of these instructions come from [here](https://gcc.gnu.org/onlinedocs/jit/internals/index.html), so don't hesitate to take a look there if you encounter an issue):
4141

4242
```bash
43-
$ git clone https://github.com/antoyo/gcc
43+
$ git clone https://github.com/rust-lang/gcc
4444
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
4545
$ mkdir gcc-build gcc-install
4646
$ cd gcc-build

compiler/rustc_codegen_gcc/build_system/src/clone_gcc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn run() -> Result<(), String> {
6161
return Ok(());
6262
};
6363

64-
let result = git_clone("https://github.com/%3Cspan%20class="x x-first x-last">antoyo/gcc", Some(&args.out_path), false)?;
64+
let result = git_clone("https://github.com/%3Cspan%20class="x x-first x-last">rust-lang/gcc", Some(&args.out_path), false)?;
6565
if result.ran_clone {
6666
let gcc_commit = args.config_info.get_gcc_commit()?;
6767
println!("Checking out GCC commit `{}`...", gcc_commit);

compiler/rustc_codegen_gcc/build_system/src/test.rs

+11-10
Original file line numberDiff line numberDiff line change
@@ -529,20 +529,21 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {
529529

530530
env.insert("COMPILETEST_FORCE_STAGE0".to_string(), "1".to_string());
531531

532-
let extra =
533-
if args.is_using_gcc_master_branch() { "" } else { " -Csymbol-mangling-version=v0" };
534-
535-
let rustc_args = &format!(
536-
r#"-Zpanic-abort-tests \
537-
-Zcodegen-backend="{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}" \
538-
--sysroot "{sysroot_dir}" -Cpanic=abort{extra}"#,
532+
let codegen_backend_path = format!(
533+
"{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}",
539534
pwd = std::env::current_dir()
540535
.map_err(|error| format!("`current_dir` failed: {:?}", error))?
541536
.display(),
542537
channel = args.config_info.channel.as_str(),
543538
dylib_ext = args.config_info.dylib_ext,
544-
sysroot_dir = args.config_info.sysroot_path,
545-
extra = extra,
539+
);
540+
541+
let extra =
542+
if args.is_using_gcc_master_branch() { "" } else { " -Csymbol-mangling-version=v0" };
543+
544+
let rustc_args = format!(
545+
"-Zpanic-abort-tests -Zcodegen-backend={codegen_backend_path} --sysroot {} -Cpanic=abort{extra}",
546+
args.config_info.sysroot_path
546547
);
547548

548549
run_command_with_env(
@@ -677,7 +678,7 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
677678
fn test_libcore(env: &Env, args: &TestArg) -> Result<(), String> {
678679
// FIXME: create a function "display_if_not_quiet" or something along the line.
679680
println!("[TEST] libcore");
680-
let path = get_sysroot_dir().join("sysroot_src/library/core/tests");
681+
let path = get_sysroot_dir().join("sysroot_src/library/coretests");
681682
let _ = remove_dir_all(path.join("target"));
682683
run_cargo_command(&[&"test"], Some(&path), env, args)?;
683684
Ok(())

compiler/rustc_codegen_gcc/doc/add-attribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Finally, you need to update this repository by calling the relevant API you adde
1414

1515
To test it, build `gcc`, run `cargo update -p gccjit` and then you can test the generated output for a given Rust crate.
1616

17-
[gccjit.rs]: https://github.com/antoyo/gccjit.rs
17+
[gccjit.rs]: https://github.com/rust-lang/gccjit.rs

0 commit comments

Comments
 (0)