Skip to content

Commit 9f22445

Browse files
Move some setup for cg_gcc outside of the docker file
1 parent 30a0709 commit 9f22445

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile

+1-7
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/
3535
COPY scripts/sccache.sh /scripts/
3636
RUN sh /scripts/sccache.sh
3737

38-
# Make `libgccjit.so` accessible.
39-
RUN ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
40-
# Fix rustc_codegen_gcc lto issues.
41-
ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"
42-
4338
# We are disabling CI LLVM since this builder is intentionally using a host
4439
# LLVM, rather than the typical src/llvm-project LLVM.
4540
ENV NO_DOWNLOAD_CI_LLVM 1
@@ -53,8 +48,7 @@ ENV RUST_CONFIGURE_ARGS \
5348
--build=x86_64-unknown-linux-gnu \
5449
--llvm-root=/usr/lib/llvm-15 \
5550
--enable-llvm-link-shared \
56-
--set rust.thin-lto-import-instr-limit=10 \
57-
--enable-new-symbol-mangling
51+
--set rust.thin-lto-import-instr-limit=10
5852

5953
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
6054

Diff for: src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
set -ex
44

5+
if [[ "${ENABLE_GCC_CODEGEN}" == "1" ]]; then
6+
# Fix rustc_codegen_gcc lto issues.
7+
export GCC_EXEC_PREFIX="/usr/lib/gcc/"
8+
# Make `libgccjit.so` accessible to the linker.
9+
ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
10+
# cg_gcc doesn't support the legacy mangling so we need to enforce the new one
11+
# if we run cg_gcc tests.
12+
export RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-new-symbol-mangling"
13+
fi
14+
515
# Only run the stage 1 tests on merges, not on PR CI jobs.
616
if [[ -z "${PR_CI_JOB}" ]]; then
717
# When running gcc backend tests, we need to install `libgccjit` and to not run llvm codegen

0 commit comments

Comments
 (0)