diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile index 859b7c18f02fc..cbb33c703af25 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/Dockerfile @@ -35,10 +35,8 @@ 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. +# 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 -# 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. @@ -53,8 +51,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/ diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile index c177e7387fc8c..c3567194d4c3e 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile @@ -42,11 +42,20 @@ ENV NO_DOWNLOAD_CI_LLVM 1 # be missing. ENV IS_NOT_LATEST_LLVM 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. +ENV USE_NEW_MANGLING=${ENABLE_GCC_CODEGEN:+ --enable-new-symbol-mangling} +# Fix rustc_codegen_gcc lto issues. +ENV GCC_EXEC_PREFIX=${ENABLE_GCC_CODEGEN:+/usr/lib/gcc/} + # Using llvm-link-shared due to libffi issues -- see #34486 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-15/script.sh /tmp/