Skip to content

Subtree update GCC backend #140015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 123 commits into from
Apr 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
60ee6fb
Update tests.
m-ou-se Oct 31, 2024
0f89f3f
Use a C-safe return type for `__rust_[ui]128_*` overflowing intrinsics
tgross35 Dec 15, 2024
daeeffa
Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril
jhpratt Jan 15, 2025
cdf26a1
Rollup merge of #134338 - tgross35:overflowing-c-safe-ret, r=bjorn3,a…
jhpratt Jan 15, 2025
4600047
When LLVM's location discriminator value limit is exceeded, emit loca…
khuey Jan 17, 2025
49e047f
Treat undef bytes as equal to any other byte
oli-obk Jan 8, 2025
301d247
remove support for the #[start] attribute
RalfJung Dec 14, 2024
c482251
Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
bors Jan 21, 2025
0692ca3
Make CodegenCx and Builder generic
ZuseZ4 Jan 24, 2025
d6d7c15
Merge commit '9f33f846ddc06afd7ffd839ee4f18babac3f3204'
GuillaumeGomez Jan 24, 2025
4fec62a
Rollup merge of #135581 - EnzymeAD:refactor-codgencx, r=oli-obk
matthiaskrgr Jan 24, 2025
24ce0a2
Stabilize `const_black_box`
tgross35 Jan 12, 2025
06f8ed1
Auto merge of #136024 - GuillaumeGomez:cg_gcc-subtree, r=GuillaumeGomez
bors Jan 27, 2025
bc6b9bf
Add CI success job
Kobzol Jan 27, 2025
600999a
ABI-required target features: warn when they are missing in base CPU …
RalfJung Jan 27, 2025
90a6f2b
Do not treat vtable supertraits as distinct when bound with different…
compiler-errors Jan 10, 2025
12feb0e
Use ExistentialTraitRef throughout codegen
compiler-errors Jan 10, 2025
a05dca8
Rollup merge of #135414 - tgross35:stabilize-const_black_box, r=dtolnay
jhpratt Jan 31, 2025
afe0843
Auto merge of #136331 - jhpratt:rollup-curo1f4, r=jhpratt
bors Jan 31, 2025
3e62ac7
Merge pull request #614 from Kobzol/ci-success
antoyo Jan 31, 2025
adee084
Add success job for all CI workflows
antoyo Feb 1, 2025
b825dbc
Merge pull request #616 from rust-lang/success-job
antoyo Feb 1, 2025
ff2cd0f
Remove duplicated CI triggers
Kobzol Feb 1, 2025
befc31c
Move back to a success job so because the required checks only work w…
antoyo Feb 1, 2025
1a25284
Merge pull request #619 from Kobzol/ci-pr
antoyo Feb 1, 2025
2e0595b
Merge pull request #618 from rust-lang/success-job
antoyo Feb 1, 2025
ad2be68
Make globals always have 2+ chars as suffix
fluxchief Jan 27, 2025
5d12c54
Add M68000 entry to arch_to_gcc
fluxchief Jan 27, 2025
efb5185
Merge pull request #613 from fluxchief/68000
antoyo Feb 2, 2025
e0d8fb9
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
safinaskar Feb 3, 2025
c325b82
Merge pull request #612 from fluxchief/master
antoyo Feb 3, 2025
4c932ff
Update repositories URL for repositories moved to `rust-lang` organiz…
GuillaumeGomez Jan 25, 2025
f0c0370
Merge pull request #610 from GuillaumeGomez/update-urls
antoyo Feb 3, 2025
beb24b3
intrinsics: unify rint, roundeven, nearbyint in a single round_ties_e…
RalfJung Feb 4, 2025
819ab9b
cg_gcc: Directly use rustc_abi instead of reexports
workingjubilee Nov 3, 2024
2214ba9
Run the CI on push on the master branch
antoyo Feb 5, 2025
4380568
Merge pull request #620 from rust-lang/ci-master-branch
antoyo Feb 5, 2025
db4b00f
Auto merge of #136471 - safinaskar:parallel, r=SparrowLii
bors Feb 6, 2025
09d9076
fix backslashes in path used for `asm_tests`
folkertdev Feb 7, 2025
21b60aa
Remove Linkage::Private
bjorn3 Feb 7, 2025
a90648d
Remove Linkage::Appending
bjorn3 Feb 7, 2025
f5597ff
Merge pull request #624 from folkertdev/run-asm-tests
antoyo Feb 7, 2025
83f7576
compiler: remove reexports from rustc_target::callconv
workingjubilee Feb 5, 2025
180f350
Rustfmt
bjorn3 Feb 8, 2025
01f1025
Rollup merge of #136706 - workingjubilee:finish-up-rustc-abi-updates,…
workingjubilee Feb 9, 2025
5bf05c1
Auto merge of #136751 - bjorn3:update_rustfmt, r=Mark-Simulacrum
bors Feb 9, 2025
cb499a2
remove some intrinsics (#625)
c8ef Feb 10, 2025
65da92e
cg_gcc: stop caring about compiling for unknown targets
workingjubilee Feb 10, 2025
d7f2227
compiler/rustc_codegen_gcc/src/back/lto.rs: delete "unsafe impl Sync/…
safinaskar Feb 11, 2025
c817210
handle NaN in unordered comparisons
folkertdev Feb 12, 2025
7f05920
Merge pull request #627 from folkertdev/fix-unordered-compare
antoyo Feb 12, 2025
4f59a68
Support sysv64 and ms ABIs
antoyo Feb 13, 2025
b08a0c6
Merge pull request #629 from rust-lang/feature/non-default-abis
antoyo Feb 13, 2025
feb78f9
Implement and use BikeshedGuaranteedNoDrop for union/unsafe field val…
compiler-errors Feb 6, 2025
853ae3d
Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-5…
jhpratt Feb 13, 2025
3ecc012
fix clobbered or lateout registers overlapping with input registers
folkertdev Feb 12, 2025
1f98329
Merge pull request #628 from folkertdev/clobber-input-registers
antoyo Feb 13, 2025
fd526a2
Make `-O` mean `-C opt-level=3`
clubby789 Jan 13, 2025
5e0c773
Set both `nuw` and `nsw` in slice size calculation
scottmcm Feb 5, 2025
5e0f1f6
Auto merge of #136575 - scottmcm:nsuw-math, r=nikic
bors Feb 14, 2025
53aa977
refactor and support reg_byte registers
folkertdev Feb 13, 2025
fcac229
Merge pull request #630 from folkertdev/x86-register-classes
antoyo Feb 14, 2025
51911a7
Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar`
scottmcm Feb 15, 2025
9ebb68d
Rework `OperandRef::extract_field` to stop calling `to_immediate_scal…
scottmcm Feb 16, 2025
be63572
Remove `BackendRepr::Uninhabited`, replaced with an `uninhabited: boo…
zachs18 Jan 26, 2025
aa038c2
Add `new_regular` and `new_allocator` to `ModuleCodegen`
dianqk Feb 6, 2025
9b8701d
Save pre-link bitcode to `ModuleCodegen`
dianqk Feb 6, 2025
a9e8cfe
Rollup merge of #136543 - RalfJung:round-ties-even, r=tgross35
tgross35 Feb 23, 2025
15f0dca
remove support for rustc_intrinsic_must_be_overridden from the compiler
RalfJung Feb 23, 2025
e92466e
Remove an unnecessary lifetime
oli-obk Feb 24, 2025
71c189a
Generalize BaseTypeCodegenMethods
oli-obk Feb 24, 2025
334eb82
Remove an unused lifetime param
oli-obk Feb 24, 2025
7848145
remove `simd_fpow` and `simd_fpowi`
folkertdev Feb 25, 2025
b627900
Rollup merge of #137595 - folkertdev:remove-simd-pow-powi, r=RalfJung
fmease Feb 25, 2025
7721431
Stop using `hash_raw_entry` in `CodegenCx::const_str`
cuviper Feb 27, 2025
975dee2
rename BackendRepr::Vector → SimdVector
RalfJung Feb 28, 2025
24b202f
Auto merge of #133250 - DianQK:embed-bitcode-pgo, r=nikic
bors Mar 1, 2025
d344960
Rollup merge of #137804 - RalfJung:backend-repr-simd-vector, r=workin…
matthiaskrgr Mar 1, 2025
c25f12a
Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin"
compiler-errors Mar 2, 2025
fe9feb3
Rollup merge of #137741 - cuviper:const_str-raw_entry, r=Mark-Simulacrum
matthiaskrgr Mar 3, 2025
273fe4a
Rollup merge of #137894 - compiler-errors:no-scalar-pair-opt, r=oli-obk
matthiaskrgr Mar 3, 2025
ab17806
Auto merge of #137959 - matthiaskrgr:rollup-62vjvwr, r=matthiaskrgr
bors Mar 4, 2025
ae07d7d
Simplify `implied_target_features`.
nnethercote Feb 25, 2025
b2b94f4
Change signature of `target_features_cfg`.
nnethercote Feb 25, 2025
24bf404
Rollup merge of #137549 - oli-obk:llvm-ffi, r=davidtwco
matthiaskrgr Mar 7, 2025
70b5888
compiler: Use size_of from the prelude instead of imported
thaliaarchi Mar 5, 2025
572da5c
cleaned up tests by bringing objects under `mini_core` into scope
madhav-madhusoodanan Mar 8, 2025
499de70
Merge pull request #639 from madhav-madhusoodanan/test_update_mini_core
antoyo Mar 8, 2025
454b083
Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, r…
matthiaskrgr Mar 9, 2025
b802554
Auto merge of #137586 - nnethercote:SetImpliedBits, r=bjorn3
bors Mar 11, 2025
7989568
intrinsics: remove unnecessary leading underscore from argument names
RalfJung Mar 12, 2025
b25a593
Remove implicit #[no_mangle] for #[rustc_std_internal_symbol]
bjorn3 Dec 2, 2023
5743d38
Rename `is_like_osx` to `is_like_darwin`
madsmtm Aug 19, 2024
2f5aa08
Avoid wrapping constant allocations in packed structs when not necessary
bjorn3 Mar 14, 2025
de1dd8b
Auto merge of #138503 - bjorn3:string_merging, r=tmiasko
bors Mar 28, 2025
3670f39
Rollup merge of #138949 - madsmtm:rename-to-darwin, r=WaffleLapkin
matthiaskrgr Apr 4, 2025
3c3a6a2
Simplify temp path creation a bit
compiler-errors Apr 6, 2025
22d3c0d
Prepend temp files with a string per invocation of rustc
compiler-errors Apr 6, 2025
90c6c9f
Merge branch 'master' into sync_from_rust_2025_04_17
antoyo Apr 17, 2025
c1d2100
Update to nightly-2025-04-17
antoyo Apr 17, 2025
cc81c70
Fix patches
antoyo Mar 27, 2025
be75a58
Fix compilation
antoyo Apr 13, 2025
5c832e5
Remove most of builtins hack since it's not necessary anymore
antoyo Mar 27, 2025
e1fa74b
Implement copysignf128
antoyo Mar 27, 2025
9a453d4
Update other patches
antoyo Mar 27, 2025
f982277
Fix libcore tests
antoyo Mar 27, 2025
5cf2bbc
Fix clippy warnings
antoyo Mar 27, 2025
ecf0a1e
Update GCC version
antoyo Apr 13, 2025
ec44cfd
Fix tests
antoyo Mar 27, 2025
bc0bc8d
Fix int_to_float_cast for f128
antoyo Mar 27, 2025
6504f4c
Format
antoyo Apr 13, 2025
bb1e6a3
Fix tests
antoyo Apr 13, 2025
0d77317
Add support for simd_insert_dyn and simd_extract_dyn
antoyo Apr 13, 2025
4b5940a
Fix overflow operations
antoyo Apr 15, 2025
06af88e
Add new failing test
antoyo Apr 15, 2025
65b87aa
Support new target builtins
antoyo Apr 17, 2025
98dd5a3
Fix for libgccjit 12
antoyo Apr 18, 2025
52b0687
Simplify handling of some SIMD intrinsics
antoyo Apr 18, 2025
db1a31c
Merge pull request #650 from rust-lang/sync_from_rust_2025_04_17
antoyo Apr 18, 2025
e4ea67b
Merge commit 'db1a31c243a649e1fe20f5466ba181da5be35c14' into subtree-…
GuillaumeGomez Apr 18, 2025
c123dc6
Fix `rustc_codegen_gcc/tests/run/return-tuple.rs` test
GuillaumeGomez Apr 18, 2025
84f5826
Fix compilation error in GCC backend
GuillaumeGomez Apr 18, 2025
cc359b8
Fix import
GuillaumeGomez Apr 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: CI

on:
- push
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -121,3 +123,22 @@ jobs:
run: |
cd build_system
cargo test

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success:
needs: [build, duplicates, build_system]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
24 changes: 23 additions & 1 deletion compiler/rustc_codegen_gcc/.github/workflows/failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
name: Failures

on:
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -108,3 +111,22 @@ jobs:
echo "Error: 'the compiler unexpectedly panicked' found in output logs. CI Error!!"
exit 1
fi
# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success_failures:
needs: [build]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/gcc12.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: CI libgccjit 12

on:
- push
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -85,3 +87,22 @@ jobs:
#- name: Run tests
#run: |
#./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success_gcc12:
needs: [build]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
name: m68k CI

on:
- push
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -105,3 +107,22 @@ jobs:
- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot --sysroot-features compiler_builtins/no-f16-f128 ${{ matrix.commands }}

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success_m68k:
needs: [build]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: CI with sysroot compiled in release mode

on:
- push
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -82,3 +84,22 @@ jobs:
echo "Test is done with LTO enabled, hence inlining should occur across crates"
exit 1
fi

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success_release:
needs: [build]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
25 changes: 23 additions & 2 deletions compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: stdarch tests with sysroot compiled in release mode

on:
- push
- pull_request
push:
branches:
- master
pull_request:

permissions:
contents: read
Expand Down Expand Up @@ -102,3 +104,22 @@ jobs:
# TODO: remove --skip test_mm512_stream_ps when stdarch is updated in rustc.
# TODO: remove --skip test_tile_ when it's implemented.
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_

# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success_stdarch:
needs: [build]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ dependencies = [

[[package]]
name = "gccjit"
version = "2.4.0"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72fd91f4adbf02b53cfc73c97bc33c5f253009043f30c56a5ec08dd5c8094dc8"
checksum = "2895ddec764de7ac76fe6c056050c4801a80109c066f177a00a9cc8dee02b29b"
dependencies = [
"gccjit_sys",
]

[[package]]
name = "gccjit_sys"
version = "0.5.0"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fb7b8f48a75e2cfe78c3d9a980b32771c34ffd12d196021ab3f98c49fbd2f0d"
checksum = "ac133db68db8a6a8b2c51ef4b18d8ea16682d5814c4641272fe37bbbc223d5f3"
dependencies = [
"libc",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ master = ["gccjit/master"]
default = ["master"]

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

# Local copy.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ A secondary goal is to check if using the gcc backend will provide any run-time
## Building

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

```bash
$ cp config.example.toml config.toml
Expand All @@ -40,7 +40,7 @@ to do a few more things.
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):

```bash
$ git clone https://github.com/antoyo/gcc
$ git clone https://github.com/rust-lang/gcc
$ sudo apt install flex libmpfr-dev libgmp-dev libmpc3 libmpc-dev
$ mkdir gcc-build gcc-install
$ cd gcc-build
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/build_system/src/clone_gcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub fn run() -> Result<(), String> {
return Ok(());
};

let result = git_clone("https://github.com/antoyo/gcc", Some(&args.out_path), false)?;
let result = git_clone("https://github.com/rust-lang/gcc", Some(&args.out_path), false)?;
if result.ran_clone {
let gcc_commit = args.config_info.get_gcc_commit()?;
println!("Checking out GCC commit `{}`...", gcc_commit);
Expand Down
21 changes: 11 additions & 10 deletions compiler/rustc_codegen_gcc/build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,21 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {

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

let extra =
if args.is_using_gcc_master_branch() { "" } else { " -Csymbol-mangling-version=v0" };

let rustc_args = &format!(
r#"-Zpanic-abort-tests \
-Zcodegen-backend="{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}" \
--sysroot "{sysroot_dir}" -Cpanic=abort{extra}"#,
let codegen_backend_path = format!(
"{pwd}/target/{channel}/librustc_codegen_gcc.{dylib_ext}",
pwd = std::env::current_dir()
.map_err(|error| format!("`current_dir` failed: {:?}", error))?
.display(),
channel = args.config_info.channel.as_str(),
dylib_ext = args.config_info.dylib_ext,
sysroot_dir = args.config_info.sysroot_path,
extra = extra,
);

let extra =
if args.is_using_gcc_master_branch() { "" } else { " -Csymbol-mangling-version=v0" };

let rustc_args = format!(
"-Zpanic-abort-tests -Zcodegen-backend={codegen_backend_path} --sysroot {} -Cpanic=abort{extra}",
args.config_info.sysroot_path
);

run_command_with_env(
Expand Down Expand Up @@ -677,7 +678,7 @@ fn test_projects(env: &Env, args: &TestArg) -> Result<(), String> {
fn test_libcore(env: &Env, args: &TestArg) -> Result<(), String> {
// FIXME: create a function "display_if_not_quiet" or something along the line.
println!("[TEST] libcore");
let path = get_sysroot_dir().join("sysroot_src/library/core/tests");
let path = get_sysroot_dir().join("sysroot_src/library/coretests");
let _ = remove_dir_all(path.join("target"));
run_cargo_command(&[&"test"], Some(&path), env, args)?;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_gcc/doc/add-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Finally, you need to update this repository by calling the relevant API you adde

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

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