Skip to content

Commit

Permalink
Move some setup for cg_gcc outside of the docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 2, 2023
1 parent 30a0709 commit 9f22445
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

# Make `libgccjit.so` accessible.
RUN ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
# Fix rustc_codegen_gcc lto issues.
ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"

# We are disabling CI LLVM since this builder is intentionally using a host
# LLVM, rather than the typical src/llvm-project LLVM.
ENV NO_DOWNLOAD_CI_LLVM 1
Expand All @@ -53,8 +48,7 @@ ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-15 \
--enable-llvm-link-shared \
--set rust.thin-lto-import-instr-limit=10 \
--enable-new-symbol-mangling
--set rust.thin-lto-import-instr-limit=10

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

Expand Down
10 changes: 10 additions & 0 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -ex

if [[ "${ENABLE_GCC_CODEGEN}" == "1" ]]; then
# Fix rustc_codegen_gcc lto issues.
export GCC_EXEC_PREFIX="/usr/lib/gcc/"
# Make `libgccjit.so` accessible to the linker.
ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
# cg_gcc doesn't support the legacy mangling so we need to enforce the new one
# if we run cg_gcc tests.
export RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-new-symbol-mangling"
fi

# Only run the stage 1 tests on merges, not on PR CI jobs.
if [[ -z "${PR_CI_JOB}" ]]; then
# When running gcc backend tests, we need to install `libgccjit` and to not run llvm codegen
Expand Down

0 comments on commit 9f22445

Please sign in to comment.