Skip to content

Commit

Permalink
Fix cg_gcc CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 30, 2023
1 parent 0a3fd37 commit 1c021ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ 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 to the linker.
RUN ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so

This comment has been minimized.

Copy link
@cuviper

cuviper Nov 30, 2023

Member

This symlink shouldn't be needed as long as the system has gcc 12, because then this path is already in the linker search path. That's what I was trying to indicate with the Note above, and that's why I used 13 in the llvm-17 container based on ubuntu:23.10.

This comment has been minimized.

Copy link
@GuillaumeGomez

GuillaumeGomez Nov 30, 2023

Author Member

Ah? I remember that the linker couldn't find this .so because of the very weird path. We opened an issue on debian iirc about this. Let's see if the other changes fix the issue and if so, I'll remove this change to confirm it's all working.


# 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 @@ -50,7 +53,6 @@ ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-16 \
--enable-llvm-link-shared \
$USE_NEW_MANGLING \
--set rust.thin-lto-import-instr-limit=10

COPY host-x86_64/x86_64-gnu-llvm-16/script.sh /tmp/
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-17 \
--enable-llvm-link-shared \
$USE_NEW_MANGLING \
--set rust.thin-lto-import-instr-limit=10

COPY host-x86_64/x86_64-gnu-llvm-16/script.sh /tmp/
Expand Down
5 changes: 0 additions & 5 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ touch $objdir/${SUMMARY_FILE}
extra_env=""
if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then
extra_env="$extra_env --env ENABLE_GCC_CODEGEN=1"
# If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling`
# argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable.
# `cg_gcc` doesn't support the legacy mangling so we need to enforce the new one
# if we run `cg_gcc` tests.
extra_env="$extra_env --env USE_NEW_MANGLING=--enable-new-symbol-mangling"
# Fix rustc_codegen_gcc lto issues.
extra_env="$extra_env --env GCC_EXEC_PREFIX=/usr/lib/gcc/"
echo "Setting extra environment values for docker: $extra_env"
Expand Down
8 changes: 8 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ if [ "$IS_NOT_LATEST_LLVM" = "" ]; then
export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1
fi

if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then
# If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling`
# argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable.
# `cg_gcc` doesn't support the legacy mangling so we need to enforce the new one
# if we run `cg_gcc` tests.
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-new-symbol-mangling"
fi

# Print the date from the local machine and the date from an external source to
# check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure
# Pipelines it happened that the certificates were marked as expired.
Expand Down

0 comments on commit 1c021ff

Please sign in to comment.