Skip to content

Commit d5b40b0

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

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ 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.
38+
# Make `libgccjit.so` accessible to the linker.
3939
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/"
4240

4341
# We are disabling CI LLVM since this builder is intentionally using a host
4442
# LLVM, rather than the typical src/llvm-project LLVM.
@@ -53,8 +51,7 @@ ENV RUST_CONFIGURE_ARGS \
5351
--build=x86_64-unknown-linux-gnu \
5452
--llvm-root=/usr/lib/llvm-15 \
5553
--enable-llvm-link-shared \
56-
--set rust.thin-lto-import-instr-limit=10 \
57-
--enable-new-symbol-mangling
54+
--set rust.thin-lto-import-instr-limit=10
5855

5956
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
6057

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

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
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+
# cg_gcc doesn't support the legacy mangling so we need to enforce the new one
9+
# if we run cg_gcc tests.
10+
export RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-new-symbol-mangling"
11+
fi
12+
513
# Only run the stage 1 tests on merges, not on PR CI jobs.
614
if [[ -z "${PR_CI_JOB}" ]]; then
715
# When running gcc backend tests, we need to install `libgccjit` and to not run llvm codegen

0 commit comments

Comments
 (0)