Skip to content

Commit b9540b7

Browse files
committed
Auto merge of #118463 - cuviper:restore-cg_gcc-ci, r=cuviper,GuillaumeGomez
Re-enable `rustc_codegen_gcc` tests in CI When #117947 dropped llvm-15 from CI, we neglected to copy #117313's changes to enable `rustc_codegen_gcc` testing to the new base llvm-16. This is now restored, as well as copying the setup to llvm-17 as well so we hopefully won't miss it next time. In addition, due to case mismatch in `$extra_env` updates in `docker/run.sh`, I think it wasn't actually getting enabled before, but this should now be fixed. I also avoided the linker hack for `libgccjit.so` that was present before, because that's not needed if the version matches the base `gcc` used for linking. r? GuillaumeGomez
2 parents f90f898 + dc20566 commit b9540b7

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

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

+3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2424
xz-utils \
2525
nodejs \
2626
mingw-w64 \
27+
libgccjit-12-dev \
2728
&& rm -rf /var/lib/apt/lists/*
2829

30+
# Note: libgccjit needs to match the default gcc version for the linker to find it.
31+
2932
# Install powershell (universal package) so we can test x.ps1 on Linux
3033
RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
3134
dpkg -i powershell.deb && \

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

+3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2424
xz-utils \
2525
nodejs \
2626
mingw-w64 \
27+
libgccjit-13-dev \
2728
&& rm -rf /var/lib/apt/lists/*
2829

30+
# Note: libgccjit needs to match the default gcc version for the linker to find it.
31+
2932
# Install powershell (universal package) so we can test x.ps1 on Linux
3033
RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \
3134
dpkg -i powershell.deb && \

src/ci/docker/run.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,9 @@ touch $objdir/${SUMMARY_FILE}
269269

270270
extra_env=""
271271
if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then
272-
extra_env="$EXTRA_ENV --env ENABLE_GCC_CODEGEN=1"
273-
# If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling`
274-
# argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable.
275-
# `cg_gcc` doesn't support the legacy mangling so we need to enforce the new one
276-
# if we run `cg_gcc` tests.
277-
extra_env="$EXTRA_ENV --env USE_NEW_MANGLING=--enable-new-symbol-mangling"
272+
extra_env="$extra_env --env ENABLE_GCC_CODEGEN=1"
278273
# Fix rustc_codegen_gcc lto issues.
279-
extra_env="$EXTRA_ENV --env GCC_EXEC_PREFIX=/usr/lib/gcc/"
274+
extra_env="$extra_env --env GCC_EXEC_PREFIX=/usr/lib/gcc/"
280275
echo "Setting extra environment values for docker: $extra_env"
281276
fi
282277

src/ci/run.sh

+8
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,14 @@ if [ "$IS_NOT_LATEST_LLVM" = "" ]; then
163163
export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1
164164
fi
165165

166+
if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then
167+
# If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling`
168+
# argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable.
169+
# `cg_gcc` doesn't support the legacy mangling so we need to enforce the new one
170+
# if we run `cg_gcc` tests.
171+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-new-symbol-mangling"
172+
fi
173+
166174
# Print the date from the local machine and the date from an external source to
167175
# check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure
168176
# Pipelines it happened that the certificates were marked as expired.

0 commit comments

Comments
 (0)