Skip to content

Commit fd4dee2

Browse files
committed
Attempt to fix CI
1 parent c8d7c04 commit fd4dee2

File tree

12 files changed

+57
-13
lines changed

12 files changed

+57
-13
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ jobs:
4646

4747
- name: Install packages
4848
# `llvm-14-tools` is needed to install the `FileCheck` binary which is used for asm tests.
49-
run: sudo apt-get install ninja-build ripgrep llvm-14-tools
49+
run: |
50+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
51+
sudo apt update
52+
sudo apt-get install ninja-build ripgrep llvm-14-tools gcc-13
5053
5154
- name: Install libgccjit12
5255
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
@@ -74,6 +77,14 @@ jobs:
7477
echo $(readlink -f gcc-build) > gcc_path
7578
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
7679
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
80+
mkdir -p /opt/gcc/libexec/gcc/x86_64-linux-gnu/11
81+
cd gcc-build
82+
chmod +x lto-wrapper lto1
83+
cp *lto* /opt/gcc/libexec/gcc/x86_64-linux-gnu/11/
84+
ls -l /usr/bin/gcc
85+
which gcc
86+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
87+
sudo update-alternatives --all
7788
7889
- name: Set env
7990
run: |

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434
path: llvm
3535

3636
- name: Install packages
37-
run: sudo apt-get install ninja-build ripgrep
37+
run: |
38+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
39+
sudo apt update
40+
sudo apt-get install ninja-build ripgrep gcc-13 gcc-multilib
3841
3942
- name: Download artifact
4043
uses: dawidd6/action-download-artifact@v2
@@ -52,6 +55,13 @@ jobs:
5255
echo $(readlink -f gcc-build) > gcc_path
5356
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
5457
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
58+
mkdir -p /opt/gcc/libexec/gcc/x86_64-linux-gnu/11 /opt/gcc/libexec/gcc/../x86_64-linux-gnu/11/
59+
cd gcc-build
60+
chmod +x lto-wrapper lto1
61+
cp *lto* /opt/gcc/libexec/gcc/x86_64-linux-gnu/11/
62+
cp crt*.o /opt/gcc/libexec/x86_64-linux-gnu/11/
63+
cp /usr/lib/gcc/x86_64-linux-gnu/12/libgcc_s.so /opt/gcc/libexec/x86_64-linux-gnu/11/
64+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
5565
5666
- name: Set env
5767
run: |

.github/workflows/stdarch.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434
path: llvm
3535

3636
- name: Install packages
37-
run: sudo apt-get install ninja-build ripgrep
37+
run: |
38+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
39+
sudo apt update
40+
sudo apt-get install ninja-build ripgrep gcc-13 gcc-multilib
3841
3942
- name: Install Intel Software Development Emulator
4043
if: ${{ matrix.cargo_runner }}
@@ -66,6 +69,16 @@ jobs:
6669
echo $(readlink -f gcc-build) > gcc_path
6770
# NOTE: the filename is still libgccjit.so even when the artifact name is different.
6871
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
72+
mkdir -p /opt/gcc/libexec/gcc/x86_64-linux-gnu/11 /opt/gcc/libexec/gcc/../x86_64-linux-gnu/11/
73+
cd gcc-build
74+
chmod +x lto-wrapper lto1
75+
cp *lto* /opt/gcc/libexec/gcc/x86_64-linux-gnu/11/
76+
# TODO: instead of downloading the crt files from the GCC CI, copy them from the system.
77+
cp crt*.o /opt/gcc/libexec/x86_64-linux-gnu/11/
78+
cp /usr/lib/gcc/x86_64-linux-gnu/12/libgcc_s.so /opt/gcc/libexec/x86_64-linux-gnu/11/
79+
cp /usr/lib/gcc/x86_64-linux-gnu/12/libgcc.a /opt/gcc/libexec/
80+
find / -name gcc. || true
81+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
6982
7083
- name: Set env
7184
run: |

build_sysroot/build_sysroot.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ rm -r sysroot/ 2>/dev/null || true
1919
export RUSTFLAGS="$RUSTFLAGS -Z force-unstable-if-unmarked"
2020
if [[ "$1" == "--release" ]]; then
2121
sysroot_channel='release'
22-
LIBRARY_PATH=/home/bouanto/Ordinateur/Programmation/Projets/gcc-repo/gcc-build/build/gcc GCC_EXEC_PREFIX=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release
22+
# FIXME: make LIBRARY_PATH something approciate in the CI.
23+
LIBRARY_PATH=gcc-build GCC_EXEC_PREFIX=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" strace -f cargo build --target $TARGET_TRIPLE --release
2324
#CG_GCCJIT_DUMP_TREE_ALL=1 CG_GCCJIT_KEEP_INTERMEDIATES=1 RUSTFLAGS="$RUSTFLAGS -Zmir-opt-level=3" cargo build --target $TARGET_TRIPLE --release
2425
else
2526
sysroot_channel='debug'

cargo.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ cmd=$1
2121
shift
2222

2323
# TODO: remove LIBRARY_PATH and GCC_EXEC_PREFIX. Those are used to debug the LTO front-end.
24-
LIBRARY_PATH=/home/bouanto/Ordinateur/Programmation/Projets/gcc-repo/gcc-build/build/gcc GCC_EXEC_PREFIX=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu PATH=$PATH:/opt/gcc/bin RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd $@
24+
#LIBRARY_PATH=/home/bouanto/Ordinateur/Programmation/Projets/gcc-repo/gcc-build/build/gcc GCC_EXEC_PREFIX=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu
25+
PATH=$PATH:/opt/gcc/bin RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd $@

failing-ui-tests.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,11 @@ tests/ui/panics/nested_panic_caught.rs
7070
tests/ui/simd/intrinsic/generic-bswap-byte.rs
7171
tests/ui/const_prop/ice-issue-111353.rs
7272
tests/ui/process/println-with-broken-pipe.rs
73+
tests/ui/panic-runtime/lto-abort.rs
74+
tests/ui/lto/thin-lto-inlines2.rs
75+
tests/ui/lto/weak-works.rs
76+
tests/ui/lto/thin-lto-inlines.rs
77+
tests/ui/lto/thin-lto-global-allocator.rs
78+
tests/ui/lto/msvc-imp-present.rs
79+
tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs
80+
tests/ui/lto/all-crates.rs

src/back/lto.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use std::ffi::CString;
2424
use std::fs::{self, File};
2525
use std::path::{Path, PathBuf};
26-
use std::sync::atomic::Ordering;
2726

2827
use gccjit::{OutputKind, OptimizationLevel};
2928
use object::read::archive::ArchiveFile;

src/back/write.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::sync::atomic::Ordering;
21
use std::{env, fs};
32

43
use gccjit::OutputKind;

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::cell::{Cell, RefCell};
22

3-
use gccjit::{Block, CType, Context, Function, FunctionPtrType, FunctionType, LValue, RValue, Type, FnAttribute, ToRValue};
3+
use gccjit::{Block, CType, Context, Function, FunctionPtrType, FunctionType, LValue, RValue, Type};
44
use rustc_codegen_ssa::base::wants_msvc_seh;
55
use rustc_codegen_ssa::traits::{
66
BackendTypes,

src/declare.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use gccjit::{Function, FunctionType, GlobalKind, LValue, RValue, Type, FnAttribute, ToRValue};
1+
use gccjit::{Function, FunctionType, GlobalKind, LValue, RValue, Type};
2+
#[cfg(feature="master")]
3+
use gccjit::{FnAttribute, ToRValue};
24
use rustc_codegen_ssa::traits::BaseTypeMethods;
35
use rustc_middle::ty::Ty;
46
use rustc_span::Symbol;
@@ -115,6 +117,7 @@ fn declare_raw_fn<'gcc>(cx: &CodegenCx<'gcc, '_>, name: &str, _callconv: () /*ll
115117
let func = cx.context.new_function(None, cx.linkage.get(), return_type, &params, mangle_name(name), variadic);
116118
cx.functions.borrow_mut().insert(name.to_string(), func);
117119

120+
#[cfg(feature="master")]
118121
if name == "rust_eh_personality" {
119122
// NOTE: GCC will sometimes change the personality function set on a function from
120123
// rust_eh_personality to __gcc_personality_v0 as an optimization.

src/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ extern crate rustc_middle;
4242
extern crate rustc_session;
4343
extern crate rustc_span;
4444
extern crate rustc_target;
45-
extern crate tempfile;
4645
#[macro_use]
4746
extern crate tracing;
4847

@@ -74,6 +73,7 @@ mod type_of;
7473

7574
use std::any::Any;
7675
use std::sync::Arc;
76+
#[cfg(not(feature="master"))]
7777
use std::sync::atomic::AtomicBool;
7878
#[cfg(not(feature="master"))]
7979
use std::sync::atomic::Ordering;
@@ -140,7 +140,6 @@ impl TargetInfo {
140140
#[derive(Clone)]
141141
pub struct GccCodegenBackend {
142142
target_info: Arc<TargetInfo>,
143-
should_combine_object_files: Arc<AtomicBool>,
144143
// Temporary directory used by LTO. We keep it here so that it's not removed before linking.
145144
temp_dir: Option<String>,
146145
}
@@ -345,7 +344,6 @@ pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
345344

346345
Box::new(GccCodegenBackend {
347346
target_info,
348-
should_combine_object_files: Arc::new(AtomicBool::new(false)),
349347
temp_dir: None,
350348
})
351349
}

test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function clean() {
151151

152152
function mini_tests() {
153153
echo "[BUILD] mini_core"
154-
$RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib --target $TARGET_TRIPLE
154+
GCC_EXEC_PREFIX=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu $RUSTC example/mini_core.rs --crate-name mini_core --crate-type lib,dylib --target $TARGET_TRIPLE
155155

156156
echo "[BUILD] example"
157157
$RUSTC example/example.rs --crate-type lib --target $TARGET_TRIPLE
@@ -337,6 +337,7 @@ function extended_sysroot_tests() {
337337
}
338338

339339
function test_rustc() {
340+
# FIXME: LTO UI tests probably fail because GCC_EXEC_PREFIX is not set.
340341
echo
341342
echo "[TEST] rust-lang/rust"
342343

0 commit comments

Comments
 (0)