From 0a3fd37ed87879d2cbe392bd74c9204c5bf7beb7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 29 Nov 2023 14:55:42 -0800 Subject: [PATCH 1/2] Re-enable `rustc_codegen_gcc` tests in CI --- src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile | 4 ++++ src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile | 4 ++++ src/ci/docker/run.sh | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) 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 4757c3e7329d7..f6741ac272a6d 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 @@ -24,8 +24,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils \ nodejs \ mingw-w64 \ + libgccjit-12-dev \ && rm -rf /var/lib/apt/lists/* +# Note: libgccjit needs to match the default gcc version for the linker to find it. + # Install powershell (universal package) so we can test x.ps1 on Linux RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \ dpkg -i powershell.deb && \ @@ -47,6 +50,7 @@ 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/ diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile index dc5a04d4e06a7..5eb3d4bae08da 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile @@ -24,8 +24,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ xz-utils \ nodejs \ mingw-w64 \ + libgccjit-13-dev \ && rm -rf /var/lib/apt/lists/* +# Note: libgccjit needs to match the default gcc version for the linker to find it. + # Install powershell (universal package) so we can test x.ps1 on Linux RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/powershell_7.3.1-1.deb_amd64.deb" > powershell.deb && \ dpkg -i powershell.deb && \ @@ -43,6 +46,7 @@ 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/ diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index cedbc0390f8ff..0f9765d4d0470 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -269,14 +269,14 @@ touch $objdir/${SUMMARY_FILE} extra_env="" if [ "$ENABLE_GCC_CODEGEN" = "1" ]; then - extra_env="$EXTRA_ENV --env ENABLE_GCC_CODEGEN=1" + 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" + 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/" + extra_env="$extra_env --env GCC_EXEC_PREFIX=/usr/lib/gcc/" echo "Setting extra environment values for docker: $extra_env" fi From dc20566c01447228bd13ef0bf5e104884b2c59ef Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 30 Nov 2023 21:11:09 +0100 Subject: [PATCH 2/2] Fix cg_gcc CI run --- src/ci/docker/host-x86_64/x86_64-gnu-llvm-16/Dockerfile | 1 - src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile | 1 - src/ci/docker/run.sh | 5 ----- src/ci/run.sh | 8 ++++++++ 4 files changed, 8 insertions(+), 7 deletions(-) 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 f6741ac272a6d..f4850715e82e8 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 @@ -50,7 +50,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/ diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile index 5eb3d4bae08da..f1d6b9a4ef26b 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile +++ b/src/ci/docker/host-x86_64/x86_64-gnu-llvm-17/Dockerfile @@ -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/ diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 0f9765d4d0470..636692a0954ac 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -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" diff --git a/src/ci/run.sh b/src/ci/run.sh index fa786c6c7e784..5700172fd3ec4 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -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.