Skip to content

Sync rustc_codegen_gcc #127566

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 231 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
231 commits
Select commit Hold shift + click to select a range
c7607b0
Implement asm goto for LLVM and GCC backend
nbdd0121 Dec 27, 2023
3ca0c59
Forbid implementing `Freeze` even if the trait is stabilized
oli-obk Feb 23, 2024
0975461
only set noalias on Box with the global allocator
RalfJung Mar 5, 2024
faebf73
Merge commit 'b385428e3ddf330805241e7758e773f933357c4b' into subtree-…
GuillaumeGomez Mar 5, 2024
06d07f8
Remove unneeded special case for rust CI
GuillaumeGomez Mar 3, 2024
17aa31b
Fix cg_gcc build
GuillaumeGomez Mar 5, 2024
9aa01ca
Correctly handle "master" feature
GuillaumeGomez Feb 21, 2024
c860ac4
Correctly handle `cargo_target_dir`
GuillaumeGomez Mar 6, 2024
568d394
Rollup merge of #119365 - nbdd0121:asm-goto, r=Amanieu
matthiaskrgr Mar 8, 2024
929e12d
Stabilize associated type bounds
compiler-errors Mar 5, 2024
d9a491b
Merge remote-tracking branch 'upstream/master' into HEAD
GuillaumeGomez Mar 9, 2024
ed5c3bc
Fix cg_gcc merge
GuillaumeGomez Mar 9, 2024
d0dc943
Introduce perma-unstable `wasm-c-abi` flag
daxpedda Feb 27, 2024
dd9407d
use Instance::expect_resolve() instead of unwraping Instance::resolve()
RalfJung Mar 10, 2024
5a89328
Merge branch 'master' into sync_branch_name
GuillaumeGomez Mar 10, 2024
45aa965
Update rustc version to 2024-03-10
GuillaumeGomez Mar 10, 2024
f7622d1
fmt
GuillaumeGomez Mar 10, 2024
fc2d1ed
Add new failing tests
GuillaumeGomez Mar 10, 2024
ba52317
Add code comment about the `--backend` option usage
GuillaumeGomez Mar 10, 2024
915646f
Rename `IntoDiagnostic` as `Diagnostic`.
nnethercote Mar 6, 2024
ca883bd
Remove unused files
GuillaumeGomez Mar 10, 2024
4720794
Merge pull request #468 from GuillaumeGomez/sync
antoyo Mar 10, 2024
0031b21
Auto merge of #122132 - nnethercote:diag-renaming3, r=nnethercote
bors Mar 11, 2024
6f76488
fix(fmt/style): Remove unncessary clones, into's and deref's
tempdragon Mar 8, 2024
9ea3c19
fix(fmt/style): Further apply Clippy suggestions manually
tempdragon Mar 9, 2024
c6b7558
fix(declare.rs): Clone `name` when buiding without the master feat.
tempdragon Mar 9, 2024
8d4d878
fix(clippy): Clone-related clippy workarounds
tempdragon Mar 11, 2024
ad97b8c
fix(liftime): Gen. by cargo clippy
tempdragon Mar 11, 2024
091de55
fix(fmt): Try to comply to the format requirement
tempdragon Mar 11, 2024
d2cda90
fix(clippy): redundant variables in `simd.rs`
tempdragon Mar 11, 2024
3fd9db3
fix(fmt): Rewrite a condition according to clippy
tempdragon Mar 11, 2024
a7d39b8
fix(from_low_high): Renamed according to clippy requirements
tempdragon Mar 11, 2024
a6202e2
Rollup merge of #121840 - oli-obk:freeze, r=dtolnay
jhpratt Mar 11, 2024
be24d39
Use published gccjit dependency instead of git repository
GuillaumeGomez Mar 11, 2024
e3a9b1d
Check whether a static is mutable instead of passing it down
oli-obk Oct 6, 2023
8fdfbf5
Make some functions private that are only ever used in the same module
oli-obk Feb 26, 2024
6d573e9
Ensure nested allocations in statics do not get deduplicated
oli-obk Feb 26, 2024
e7795ed
Some comment nits
oli-obk Mar 11, 2024
a64942a
Mark codegen_gcc fields used only on feature master as such
krtab Jan 4, 2024
6c91567
Regen intrinsics conversions
GuillaumeGomez Mar 13, 2024
b5d61f1
Merge pull request #471 from GuillaumeGomez/intrinsics-conversions
antoyo Mar 14, 2024
9476fe7
avoid naming LLVM basic blocks when fewer_names is true
erikdesjardins Mar 15, 2024
817d2f2
fix(pattern_type_mismatch)): Fix mismatch with ref/deref
tempdragon Mar 16, 2024
878f572
fix(comments): Add some info and revert `else if`
tempdragon Mar 16, 2024
390f906
revert(lifetime): Add "needless" lifetime(s) and allow it in clippy
tempdragon Mar 16, 2024
f6cab2c
feat(CI): Add clippy check to workflow.
tempdragon Mar 16, 2024
653118e
feat(clippy): Suppress lint `suspicious_else_formatting` temporarily
tempdragon Mar 16, 2024
225a32f
Revert "feat(CI): Add clippy check to workflow."
tempdragon Mar 16, 2024
89acb10
feat(ci): Install clippy in ci.yml(But no testing)
tempdragon Mar 16, 2024
4e4efb9
feat(ci): Add clippy check for both master and non-master
tempdragon Mar 16, 2024
3b01fba
fix(intrinsic/mod.rs): Update comments
tempdragon Mar 16, 2024
0a49351
fix(lifetime): Add lifetimes back.
tempdragon Mar 16, 2024
7ff5d39
Merge pull request #469 from tempdragon/master
antoyo Mar 16, 2024
ff2b405
revert changes and just delete the fixme
erikdesjardins Mar 16, 2024
678e624
Auto merge of #122055 - compiler-errors:stabilize-atb, r=oli-obk
bors Mar 19, 2024
4ef3bac
remove debug info from emitting
mubarak23 Mar 19, 2024
09dbab8
change the debug option from true to limited
mubarak23 Mar 19, 2024
17abfa7
Merge pull request #1 from mubarak23/remove-debug-info
antoyo Mar 19, 2024
51d27a6
Move cleanup of sysroot build into its own function
GuillaumeGomez Mar 20, 2024
9b17b3d
Simplify directory creation
GuillaumeGomez Mar 20, 2024
6a2f725
remove pass test
mubarak23 Mar 21, 2024
3cb807b
remove more pass test from the lists
mubarak23 Mar 21, 2024
193d165
add back lto-abort.rs to the list
mubarak23 Mar 21, 2024
486f6b7
remove lto-abort.rs since it has passed
mubarak23 Mar 21, 2024
67c6c7e
add two fail test back to the list
mubarak23 Mar 22, 2024
c8cb091
Codegen const panic messages as function calls
Mark-Simulacrum Mar 18, 2024
906a2ab
Update tests/failing-ui-tests.txt
mubarak23 Mar 22, 2024
83eaede
Make RawPtr take Ty and Mutbl separately
compiler-errors Mar 21, 2024
ab1ea40
Format code
GuillaumeGomez Mar 20, 2024
cde105a
Move `build_sysroot` folder into `build_system`
GuillaumeGomez Mar 20, 2024
52f6d5d
Run test commands in the provided order
GuillaumeGomez Mar 21, 2024
7ccd8ce
Add fmt check on `build_system`
GuillaumeGomez Mar 21, 2024
f16a006
CI cargo test added (#6)
lordshashank Mar 22, 2024
da070d3
Clean up `y.sh` path in CI
GuillaumeGomez Mar 22, 2024
eea2f89
Merge pull request #2 from GuillaumeGomez/rm-build_sysroot-folder
antoyo Mar 22, 2024
a951158
Auto merge of #119552 - krtab:dead_code_priv_mod_pub_field, r=cjgillo…
bors Mar 23, 2024
95c7fde
Unbox and unwrap the contents of `StatementKind::Coverage`
Zalathar Mar 23, 2024
9c81910
fix rebase
mubarak23 Mar 23, 2024
56eab3c
remove trailing space
mubarak23 Mar 23, 2024
0319a80
remove more test that have passed
mubarak23 Mar 23, 2024
abbe1ba
CFI: Use Instance at callsites
maurer Mar 15, 2024
a67cd0c
add fn-arg-incomplete-pattern-drop-order.rs to the list
mubarak23 Mar 23, 2024
51eae7e
Merge pull request #5 from mubarak23/remove-pass-test
antoyo Mar 23, 2024
1a05106
Add+Use `mir::BinOp::Cmp`
scottmcm Mar 6, 2023
1ee4ae9
Rollup merge of #122937 - Zalathar:unbox, r=oli-obk
matthiaskrgr Mar 24, 2024
94ca828
add missing mappings from register classes to dummy output types
Mar 24, 2024
fda1ffd
Merge pull request #8 from zedar/I60_asm_conversion_from_register_to_gcc
antoyo Mar 24, 2024
2a88451
run-make tests initialized (#7)
lordshashank Mar 25, 2024
111b339
Execute tests using a target defined as a JSON spec (#12)
zedar Mar 27, 2024
211b585
Auto merge of #122671 - Mark-Simulacrum:const-panic-msg, r=Nilstrieb
bors Mar 29, 2024
cc98f86
stabilize ptr.is_aligned, move ptr.is_aligned_to to a new feature gate
Gankra Mar 3, 2024
03f299b
Fix VM artifact link
antoyo Mar 30, 2024
92be47b
Add back y.sh to run stdarch tests
antoyo Mar 30, 2024
c7ac792
Add newlines
antoyo Mar 30, 2024
287894f
Merge pull request #14 from antoyo/fix/vm-link-and-stdarch-tests
antoyo Mar 30, 2024
75f0ab5
Merge pull request #482 from antoyo/master
antoyo Mar 30, 2024
27ba1ba
Auto merge of #118310 - scottmcm:three-way-compare, r=davidtwco
bors Apr 2, 2024
f7a6ac1
Rollup merge of #122334 - GuillaumeGomez:vendor-cg_gcc, r=Mark-Simula…
GuillaumeGomez Apr 5, 2024
5eb8d85
Rename `cargo.rs` into `rust_tools.rs` to prepare the addition of the…
GuillaumeGomez Apr 5, 2024
040afd3
Save/restore more items in cache with incremental compilation
pacak Apr 6, 2024
00ad263
Add `rustc` command to build system
GuillaumeGomez Apr 5, 2024
2a99110
Update documentation to recommend using `y.sh rustc` instead of `rust…
GuillaumeGomez Apr 5, 2024
c7f1d5d
Merge pull request #15 from GuillaumeGomez/add-rustc-command
antoyo Apr 7, 2024
7531a22
Merge pull request #486 from antoyo/master
antoyo Apr 7, 2024
8692192
build sysroot flag (#16)
lordshashank Apr 10, 2024
b9b05d5
Make `PlaceRef` hold a `PlaceValue` for the non-layout fields (like `…
scottmcm Apr 11, 2024
cccf379
Put `PlaceValue` into `OperandValue::Ref`, rather than 3 tuple fields
scottmcm Apr 11, 2024
4ea3389
use [N x i8] for alloca types
erikdesjardins Feb 24, 2024
50a1471
restore location in gcc alloca codegen
erikdesjardins Apr 12, 2024
a3cd6e7
Default to `download-gccjit` instead of `gcc-path`
GuillaumeGomez Apr 13, 2024
6f36e82
static_mut_refs: use raw pointers to remove the remaining FIXME
RalfJung Apr 15, 2024
5584f5f
updated build system script commands (#490)
g4titanx Apr 16, 2024
f3ff769
Merge pull request #18 from GuillaumeGomez/default-download
antoyo Apr 17, 2024
56a022f
Merge pull request #492 from antoyo/master
antoyo Apr 17, 2024
50a0d5b
Fix passing custom CG_RUSTFLAGS when building sysroot
darcagn Apr 17, 2024
6e5395a
Updating readme instructions (#489)
Gerson2102 Apr 17, 2024
ab7d138
Merge pull request #493 from darcagn/master
antoyo Apr 17, 2024
0f17e5a
Auto merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiser
bors Apr 19, 2024
7cd561e
Fix check for main function already declared
antoyo Apr 20, 2024
9b628f8
Fix panic when calling get_fn for a variable
antoyo Apr 20, 2024
e26e7ae
Merge pull request #497 from rust-lang/fix/add-block-to-imported-main…
antoyo Apr 20, 2024
89ee0f9
Implement more type kinds
antoyo Apr 20, 2024
9941c35
Merge pull request #499 from rust-lang/fix/unreachable-in-get_fn
antoyo Apr 20, 2024
4a52f95
Merge pull request #500 from rust-lang/fix/type-kind
antoyo Apr 20, 2024
dd50f45
Fixup `rustc_codegen_gcc` test signature
WaffleLapkin Apr 20, 2024
224285d
Rollup merge of #123967 - RalfJung:static_mut_refs, r=Nilstrieb
jieyouxu Apr 20, 2024
f9a0c3f
Fix PassMode::Indirect with params
antoyo Apr 20, 2024
4183917
Merge pull request #498 from rust-lang/fix/pass-indirect-with-params
antoyo Apr 22, 2024
2d082ae
Stabilize the size of incr comp object file names
saethlin Apr 3, 2024
79d217f
Rollup merge of #124003 - WaffleLapkin:dellvmization, r=scottmcm,Ralf…
matthiaskrgr Apr 23, 2024
752af44
Auto merge of #122053 - erikdesjardins:alloca, r=nikic
bors Apr 24, 2024
df0639b
Error on using `yield` without also using `#[coroutine]` on the closure
oli-obk Apr 11, 2024
04932ea
Modify build_system's prepare stage to allow for custom sysroot sourc…
darcagn Apr 17, 2024
01b0fb7
Merge pull request #494 from darcagn/custom_rustlib
antoyo Apr 24, 2024
65e8717
Some fixes for aarch64
antoyo Apr 25, 2024
d408f23
Merge pull request #504 from rust-lang/fix/aarch64
antoyo Apr 25, 2024
4267ff0
Download artifacts from `rust-lang/gcc` instead of old `antoyo/gcc`
GuillaumeGomez Apr 26, 2024
a79c576
Merge pull request #507 from GuillaumeGomez/change-ci-download-urls
GuillaumeGomez Apr 28, 2024
9ed0543
Some more fixes and workarounds for Aarch64
antoyo Apr 29, 2024
0f87072
Merge pull request #508 from rust-lang/fix/aarch64
antoyo Apr 29, 2024
766f59d
Stop swallowing signals in build_system when running sub-commands
GuillaumeGomez Apr 30, 2024
f557bc4
Merge pull request #509 from GuillaumeGomez/signal-swallowing
antoyo May 1, 2024
2b875f0
Step bootstrap cfgs
Mark-Simulacrum Apr 29, 2024
3ea32a7
Inline & delete `Ty::new_unit`, since it's just a field access
WaffleLapkin May 2, 2024
7ed351a
Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmease
matthiaskrgr May 2, 2024
5166efc
Fix segfault in tests due to a bug in libc 0.2.154
antoyo May 2, 2024
aee803b
Merge pull request #512 from rust-lang/fix/tests
GuillaumeGomez May 2, 2024
bd7c57b
Add `fmt` command
GuillaumeGomez May 2, 2024
7e369b3
Simplify `fmt` check in CI
GuillaumeGomez May 2, 2024
d7c8e0f
Merge pull request #510 from GuillaumeGomez/fmt-cmd
antoyo May 3, 2024
efa15eb
Auto merge of #123441 - saethlin:fixed-len-file-names, r=oli-obk
bors May 3, 2024
f26221a
Refactor float `Primitive`s to a separate `Float` type
beetrees May 6, 2024
6b7db50
Simplify `use crate::rustc_foo::bar` occurrences.
nnethercote May 8, 2024
a0b4d73
simd: implement pointer provenance intrinsics
sadlerap May 9, 2024
7ad7346
codegen: memmove/memset cannot be non-temporal
RalfJung May 9, 2024
ce11a86
Rollup merge of #124797 - beetrees:primitive-float, r=davidtwco
matthiaskrgr May 10, 2024
06f1ba4
Auto merge of #124972 - matthiaskrgr:rollup-3fablim, r=matthiaskrgr
bors May 10, 2024
21f58e4
Rename Unsafe to Safety
spastorino May 17, 2024
cae9e7e
Stop using `to_hir_binop` in codegen
scottmcm May 22, 2024
29fc479
rustc_codegen_llvm: add support for writing summary bitcode
durin42 Jan 19, 2024
4a79b06
rustc_codegen_gcc: fix changed method signature
durin42 May 23, 2024
a1d2933
Rollup merge of #125345 - durin42:thin-link-bitcode, r=bjorn3
GuillaumeGomez May 23, 2024
b13943e
adding more env vars (#523)
Gerson2102 May 27, 2024
02eb434
Merge pull request #519 from sadlerap/simd-ptr-provenance
antoyo May 27, 2024
e7eeeb9
Improve Readme.md format
GuillaumeGomez May 28, 2024
c2c93ee
Merge pull request #526 from GuillaumeGomez/readme-format
antoyo May 28, 2024
eccab8b
prevent libgccjit.so download on unsupported os/arch (#529)
Skgland Jun 1, 2024
b2d3981
Uplift TypeRelation and Relate
compiler-errors May 31, 2024
d565d3d
ScalarInt: size mismatches are a bug, do not delay the panic
RalfJung Jun 8, 2024
a63b83e
ui pattern failure tests (#524)
lordshashank Jun 10, 2024
527b357
Use a dedicated type instead of a reference for the diagnostic context
oli-obk Jun 18, 2024
cb1bde0
Remove redundant argument from `subdiagnostic` method
oli-obk Jun 18, 2024
8c5d84d
Add blank lines after module-level `//!` comments.
nnethercote Jun 19, 2024
d0977e3
Add support for Float16, Float32, Float64 and Float128
Apr 10, 2024
a486dbf
Upgrade libgccjit.version
May 5, 2024
fa18a18
Temporary downgrade compiler_builtins library. From version 0.1.110 t…
May 5, 2024
b94cb8c
Add missing types in the type_kind function
May 12, 2024
0dad11f
Do not use target dependent Float32
May 24, 2024
c4e7c04
Fix location of check for sized floating-point types
antoyo Jun 13, 2024
55788e4
Update libgccjit version with fixed is_same_type_as for vector types
Jun 21, 2024
2eaac23
Refactor type_f16|32|128 functions. Common type_kind()
Jun 21, 2024
9d25e85
Remove const_bitcast from ConstMethods
bjorn3 Mar 30, 2024
8a1e581
Remove check_overflow method from MiscMethods
bjorn3 Mar 30, 2024
994041a
Remove type_i1 and type_struct from cg_ssa
bjorn3 Mar 30, 2024
dabf5fa
Add support for Float64
Jun 21, 2024
16e1ad7
Fix clippy warnings
antoyo Jun 25, 2024
73db249
Add comment about compiler_builtins
antoyo Jun 25, 2024
9274c63
Change Void to unreachable
antoyo Jun 25, 2024
70d3655
Merge pull request #17 from zedar/add_support_for_float16_float128
antoyo Jun 25, 2024
173773e
Merge pull request #534 from antoyo/master
antoyo Jun 25, 2024
8e819fb
Fix libcore patch
GuillaumeGomez Mar 26, 2024
f848dbb
Fix non-master build
GuillaumeGomez Mar 26, 2024
580e5ba
Format code
GuillaumeGomez May 15, 2024
2631668
Update libgccjit version
GuillaumeGomez Mar 27, 2024
9b1211d
Fix casts
GuillaumeGomez Apr 3, 2024
7615e04
Fix usage of `get_size` for gcc 12
GuillaumeGomez Apr 3, 2024
fd7979d
Remove usage of `-Zno-parallel-llvm`
GuillaumeGomez Mar 27, 2024
621e948
Fix clippy lint
GuillaumeGomez Mar 27, 2024
a89f178
Fix stdarch crate add patch
GuillaumeGomez Apr 2, 2024
068fe5d
If the type of a global is not the same, we remove the global and rep…
GuillaumeGomez Apr 19, 2024
684a69b
Update gcc version to 272d0ccced960394fe6ff2b40b01610208cb4940
GuillaumeGomez Apr 25, 2024
30ee7ba
Add shl and shr missing casts
GuillaumeGomez May 21, 2024
ca65404
Add missing cast for function_ptr arguments
GuillaumeGomez May 21, 2024
527c049
Fix warnings
GuillaumeGomez May 21, 2024
dd4a546
Add explanations for ptr func call argument cast
GuillaumeGomez May 22, 2024
0ffcbb0
Remove the hack in zext
antoyo Jun 12, 2024
e8e6663
Fix provenance intrinsics
antoyo Jun 18, 2024
9ca7658
Fix tests
antoyo Jun 18, 2024
21b1b11
WIP: Implement dummy ThinLTO
antoyo Jun 26, 2024
bbc765b
Fix clippy warnings
antoyo Jun 28, 2024
2ecab99
Fix build failure in cfg-if
GuillaumeGomez Jun 28, 2024
606196b
Comment libgccjit 12 CI
antoyo Jun 30, 2024
cd014cd
Replace the type of global variables instead of replacing them
antoyo Jul 2, 2024
4d3d0d4
Fix intrinsic/generic-arithmetic-pass.rs test
antoyo Jul 2, 2024
ee41c19
Update to nightly-2024-07-02
antoyo Jul 2, 2024
05a41b8
Merge branch 'master' into sync_from_rust_2024_07_02
antoyo Jul 2, 2024
6099d97
Fix rebase
antoyo Jul 2, 2024
63d308b
Fix broken libgccjit 12 CI
antoyo Jul 2, 2024
59de4fa
Fix type of intrinsics
antoyo Jun 28, 2024
3e91e16
Ignore a stdarch test that will fail until the stdarch version in rus…
antoyo Jul 2, 2024
fc2eee5
Ignore more tests
antoyo Jul 2, 2024
2d123d0
Fix LTO tests
antoyo Jul 5, 2024
bc8520d
Revert "Fix LTO tests"
antoyo Jul 5, 2024
fe054be
Second attempt at fixing LTO tests
antoyo Jul 5, 2024
14d327a
Disable run-make tests
antoyo Jul 5, 2024
0b5be44
Fix for gcc-13 without int128
antoyo Jul 5, 2024
5681c3c
Cleanup
antoyo Jul 5, 2024
98ed962
Merge pull request #535 from rust-lang/sync_from_rust_2024_07_02
antoyo Jul 5, 2024
7cbe50e
Merge commit '98ed962c7d3eebe12c97588e61245273d265e72f' into master
GuillaumeGomez Jul 10, 2024
541b32c
Update `Cargo.lock` and remove duplicated impl
GuillaumeGomez Jul 10, 2024
8bf65c6
Update GCC version
GuillaumeGomez Jul 10, 2024
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
24 changes: 18 additions & 6 deletions compiler/rustc_codegen_gcc/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ jobs:
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
run: sudo apt-get install ninja-build ripgrep llvm-14-tools

- name: Install rustfmt
run: rustup component add rustfmt
- name: Install rustfmt & clippy
run: rustup component add rustfmt clippy

- name: Download artifact
run: curl -LO https://github.com/antoyo/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}

- name: Setup path to libgccjit
run: |
Expand All @@ -78,9 +78,16 @@ jobs:
- name: Build
run: |
./y.sh prepare --only-libcore
./y.sh build
./y.sh build --sysroot
cargo test
./y.sh clean all

- name: Run y.sh cargo build
run: |
./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml

- name: Clean
run: |
./y.sh clean all

- name: Prepare dependencies
run: |
Expand All @@ -96,7 +103,12 @@ jobs:
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }}

- name: Check formatting
run: cargo fmt -- --check
run: ./y.sh fmt --check

- name: clippy
run: |
cargo clippy --all-targets -- -D warnings
cargo clippy --all-targets --features master -- -D warnings

duplicates:
runs-on: ubuntu-latest
Expand Down
15 changes: 14 additions & 1 deletion compiler/rustc_codegen_gcc/.github/workflows/failures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Download artifact
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
run: curl -LO https://github.com/antoyo/gcc/releases/latest/download/gcc-13.deb
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-13.deb

- name: Setup path to libgccjit
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
Expand Down Expand Up @@ -94,7 +94,20 @@ jobs:
run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt

- name: Run tests
# TODO: re-enable those tests for libgccjit 12.
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
id: tests
run: |
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --clean --build-sysroot --test-failing-rustc ${{ matrix.libgccjit_version.extra }} | tee output_log
rg --text "test result" output_log >> $GITHUB_STEP_SUMMARY

- name: Run failing ui pattern tests for ICE
# TODO: re-enable those tests for libgccjit 12.
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
id: ui-tests
run: |
${{ matrix.libgccjit_version.env_extra }} ./y.sh test --release --test-failing-ui-pattern-tests ${{ matrix.libgccjit_version.extra }} | tee output_log_ui
if grep -q "the compiler unexpectedly panicked" output_log_ui; then
echo "Error: 'the compiler unexpectedly panicked' found in output logs. CI Error!!"
exit 1
fi
38 changes: 20 additions & 18 deletions compiler/rustc_codegen_gcc/.github/workflows/gcc12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,23 @@ jobs:
run: |
./y.sh prepare --only-libcore --libgccjit12-patches
./y.sh build --no-default-features --sysroot-panic-abort
cargo test --no-default-features
./y.sh clean all

- name: Prepare dependencies
run: |
git config --global user.email "[email protected]"
git config --global user.name "User"
./y.sh prepare --libgccjit12-patches

- name: Add more failing tests for GCC 12
run: cat tests/failing-ui-tests12.txt >> tests/failing-ui-tests.txt

- name: Add more failing tests because the sysroot is not compiled with LTO
run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt

- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
# Uncomment when we no longer need to remove global variables.
#./y.sh build --sysroot --no-default-features --sysroot-panic-abort
#cargo test --no-default-features
#./y.sh clean all

#- name: Prepare dependencies
#run: |
#git config --global user.email "[email protected]"
#git config --global user.name "User"
#./y.sh prepare --libgccjit12-patches

#- name: Add more failing tests for GCC 12
#run: cat tests/failing-ui-tests12.txt >> tests/failing-ui-tests.txt

#- name: Add more failing tests because the sysroot is not compiled with LTO
#run: cat tests/failing-non-lto-tests.txt >> tests/failing-ui-tests.txt

#- name: Run tests
#run: |
#./y.sh test --release --clean --build-sysroot ${{ matrix.commands }} --no-default-features
17 changes: 9 additions & 8 deletions compiler/rustc_codegen_gcc/.github/workflows/m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,7 @@ jobs:
run: curl -LO https://github.com/cross-cg-gcc-tools/cross-gcc/releases/latest/download/gcc-m68k-13.deb

- name: Download VM artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: m68k.yml
name: debian-m68k
repo: cross-cg-gcc-tools/vms
branch: master
event: push
run: curl -LO https://github.com/cross-cg-gcc-tools/vms/releases/latest/download/debian-m68k.img

- name: Setup path to libgccjit
run: |
Expand Down Expand Up @@ -88,10 +82,17 @@ jobs:
sudo mount debian-m68k.img vm
sudo cp $(which qemu-m68k-static) vm/usr/bin/

- name: Build sample project with target defined as JSON spec
run: |
./y.sh prepare --only-libcore --cross
./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu --target ${{ github.workspace }}/target_specs/m68k-unknown-linux-gnu.json
./y.sh cargo build --manifest-path=./tests/hello-world/Cargo.toml --target ${{ github.workspace }}/target_specs/m68k-unknown-linux-gnu.json
./y.sh clean all

- name: Build
run: |
./y.sh prepare --only-libcore --cross
./y.sh build --target-triple m68k-unknown-linux-gnu
./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu
CG_GCC_TEST_TARGET=m68k-unknown-linux-gnu cargo test
./y.sh clean all

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_gcc/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: sudo apt-get install ninja-build ripgrep

- name: Download artifact
run: curl -LO https://github.com/antoyo/gcc/releases/latest/download/gcc-13.deb
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/gcc-13.deb

- name: Setup path to libgccjit
run: |
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Build
run: |
./y.sh prepare --only-libcore
EMBED_LTO_BITCODE=1 ./y.sh build --release --release-sysroot
EMBED_LTO_BITCODE=1 ./y.sh build --sysroot --release --release-sysroot
cargo test
./y.sh clean all

Expand All @@ -62,12 +62,12 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "User"
./y.sh prepare
# FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros.
echo -n 'lto = "fat"' >> build_sysroot/Cargo.toml

- name: Add more failing tests because of undefined symbol errors (FIXME)
run: cat tests/failing-lto-tests.txt >> tests/failing-ui-tests.txt

- name: Run tests
run: |
# FIXME(antoyo): we cannot enable LTO for stdarch tests currently because of some failing LTO tests using proc-macros.
echo -n 'lto = "fat"' >> build_system/build_sysroot/Cargo.toml
EMBED_LTO_BITCODE=1 ./y.sh test --release --clean --release-sysroot --build-sysroot ${{ matrix.commands }}
9 changes: 4 additions & 5 deletions compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Build
run: |
./y.sh prepare --only-libcore
./y.sh build --release --release-sysroot
./y.sh build --sysroot --release --release-sysroot

- name: Set env (part 2)
run: |
Expand Down Expand Up @@ -89,12 +89,11 @@ jobs:
- name: Run stdarch tests
if: ${{ !matrix.cargo_runner }}
run: |
cd build_sysroot/sysroot_src/library/stdarch/
CHANNEL=release TARGET=x86_64-unknown-linux-gnu CG_RUSTFLAGS="-Ainternal_features" ../../../../y.sh cargo test
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

- name: Run stdarch tests
if: ${{ matrix.cargo_runner }}
run: |
cd build_sysroot/sysroot_src/library/stdarch/
# FIXME: these tests fail when the sysroot is compiled with LTO because of a missing symbol in proc-macro.
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 -- --skip rtm --skip tbm --skip sse4a
# TODO: remove --skip test_mm512_stream_ps when stdarch is updated in rustc.
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_mm512_stream_ps
4 changes: 0 additions & 4 deletions compiler/rustc_codegen_gcc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ perf.data
perf.data.old
*.events
*.string*
/build_sysroot/sysroot
/build_sysroot/sysroot_src
/build_sysroot/Cargo.lock
/build_sysroot/test_target/Cargo.lock
gimple*
*asm
res
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_codegen_gcc/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ dependencies = [

[[package]]
name = "gccjit"
version = "2.0.0"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecaa4c3da2d74c1a991b4faff75d49ab1d0522d9a99d8e2614b3b04d226417ce"
checksum = "62e0ba949ebee07c5cc21f02cb48f28f2c8db7fcbc15fdc5120476a6c43b4636"
dependencies = [
"gccjit_sys",
]

[[package]]
name = "gccjit_sys"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "406a66fba005f1a02661f2f9443e5693dd3a667b7c58e70aa4ccc4c8b50b4758"
checksum = "a5bbf85e12c2593772329a9d4e8310271f6706e6045ce4f41b041dd34fba6603"
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.0"
gccjit = "2.1"

# Local copy.
#gccjit = { path = "../gccjit.rs" }
Expand Down
56 changes: 38 additions & 18 deletions compiler/rustc_codegen_gcc/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ This is a GCC codegen for rustc, which means it can be loaded by the existing ru
The primary goal of this project is to be able to compile Rust code on platforms unsupported by LLVM.
A secondary goal is to check if using the gcc backend will provide any run-time speed improvement for the programs compiled using rustc.

### Dependencies

**rustup:** Follow the instructions on the official [website](https://www.rust-lang.org/tools/install)

**DejaGnu:** Consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)



## Building

**This requires a patched libgccjit in order to work.
Expand Down Expand Up @@ -80,7 +88,7 @@ Then you can run commands like this:

```bash
$ ./y.sh prepare # download and patch sysroot src and install hyperfine for benchmarking
$ ./y.sh build --release
$ ./y.sh build --sysroot --release
```

To run the tests:
Expand All @@ -91,10 +99,16 @@ $ ./y.sh test --release

## Usage

`$CG_GCCJIT_DIR` is the directory you cloned this repo into in the following instructions:
You have to run these commands, in the corresponding order:

```bash
export CG_GCCJIT_DIR=[the full path to rustc_codegen_gcc]
$ ./y.sh prepare
$ ./y.sh build --sysroot
```
To check if all is working correctly, run:

```bash
$ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
```

### Cargo
Expand All @@ -107,8 +121,7 @@ If you compiled cg_gccjit in debug mode (aka you didn't pass `--release` to `./y

### LTO

To use LTO, you need to set the variable `FAT_LTO=1` and `EMBED_LTO_BITCODE=1` in addition to setting `lto = "fat"` in the `Cargo.toml`.
Don't set `FAT_LTO` when compiling the sysroot, though: only set `EMBED_LTO_BITCODE=1`.
To use LTO, you need to set the variable `EMBED_LTO_BITCODE=1` in addition to setting `lto = "fat"` in the `Cargo.toml`.

Failing to set `EMBED_LTO_BITCODE` will give you the following error:

Expand All @@ -118,26 +131,33 @@ error: failed to copy bitcode to object file: No such file or directory (os erro

### Rustc

> You should prefer using the Cargo method.
If you want to run `rustc` directly, you can do so with:

```bash
$ ./y.sh rustc my_crate.rs
```

You can do the same manually (although we don't recommend it):

```bash
$ LIBRARY_PATH="[gcc-path value]" LD_LIBRARY_PATH="[gcc-path value]" rustc +$(cat $CG_GCCJIT_DIR/rust-toolchain | grep 'channel' | cut -d '=' -f 2 | sed 's/"//g' | sed 's/ //g') -Cpanic=abort -Zcodegen-backend=$CG_GCCJIT_DIR/target/release/librustc_codegen_gcc.so --sysroot $CG_GCCJIT_DIR/build_sysroot/sysroot my_crate.rs
```

## Env vars

<dl>
<dt>CG_GCCJIT_INCR_CACHE_DISABLED</dt>
<dd>Don't cache object files in the incremental cache. Useful during development of cg_gccjit
to make it possible to use incremental mode for all analyses performed by rustc without caching
object files when their content should have been changed by a change to cg_gccjit.</dd>
<dt>CG_GCCJIT_DISPLAY_CG_TIME</dt>
<dd>Display the time it took to perform codegen for a crate</dd>
<dt>CG_RUSTFLAGS</dt>
<dd>Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`.</dd>
<dt>CG_GCCJIT_DUMP_TO_FILE</dt>
<dd>Dump a C-like representation to /tmp/gccjit_dumps and enable debug info in order to debug this C-like representation.</dd>
</dl>
* _**CG_GCCJIT_DUMP_ALL_MODULES**_: Enables dumping of all compilation modules. When set to "1", a dump is created for each module during compilation and stored in `/tmp/reproducers/`.
* _**CG_GCCJIT_DUMP_MODULE**_: Enables dumping of a specific module. When set with the module name, e.g., `CG_GCCJIT_DUMP_MODULE=module_name`, a dump of that specific module is created in `/tmp/reproducers/`.
* _**CG_RUSTFLAGS**_: Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`.
* _**CG_GCCJIT_DUMP_TO_FILE**_: Dump a C-like representation to /tmp/gccjit_dumps and enable debug info in order to debug this C-like representation.
* _**CG_GCCJIT_DUMP_RTL**_: Dumps RTL (Register Transfer Language) for virtual registers.
* _**CG_GCCJIT_DUMP_RTL_ALL**_: Dumps all RTL passes.
* _**CG_GCCJIT_DUMP_TREE_ALL**_: Dumps all tree (GIMPLE) passes.
* _**CG_GCCJIT_DUMP_IPA_ALL**_: Dumps all Interprocedural Analysis (IPA) passes.
* _**CG_GCCJIT_DUMP_CODE**_: Dumps the final generated code.
* _**CG_GCCJIT_DUMP_GIMPLE**_: Dumps the initial GIMPLE representation.
* _**CG_GCCJIT_DUMP_EVERYTHING**_: Enables dumping of all intermediate representations and passes.
* _**CG_GCCJIT_KEEP_INTERMEDIATES**_: Keeps intermediate files generated during the compilation process.
* _**CG_GCCJIT_VERBOSE**_: Enables verbose output from the GCC driver.

## Extra documentation

Expand Down
6 changes: 0 additions & 6 deletions compiler/rustc_codegen_gcc/build.rs

This file was deleted.

Loading
Loading