mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Set some environment variables value only if ENABLE_GCC_CODEGEN is set
This commit is contained in:
parent
30a07094a6
commit
c890dd66b3
@ -35,10 +35,8 @@ RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/
|
|||||||
COPY scripts/sccache.sh /scripts/
|
COPY scripts/sccache.sh /scripts/
|
||||||
RUN sh /scripts/sccache.sh
|
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
|
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
|
# We are disabling CI LLVM since this builder is intentionally using a host
|
||||||
# LLVM, rather than the typical src/llvm-project LLVM.
|
# LLVM, rather than the typical src/llvm-project LLVM.
|
||||||
@ -53,8 +51,8 @@ ENV RUST_CONFIGURE_ARGS \
|
|||||||
--build=x86_64-unknown-linux-gnu \
|
--build=x86_64-unknown-linux-gnu \
|
||||||
--llvm-root=/usr/lib/llvm-15 \
|
--llvm-root=/usr/lib/llvm-15 \
|
||||||
--enable-llvm-link-shared \
|
--enable-llvm-link-shared \
|
||||||
--set rust.thin-lto-import-instr-limit=10 \
|
$USE_NEW_MANGLING \
|
||||||
--enable-new-symbol-mangling
|
--set rust.thin-lto-import-instr-limit=10
|
||||||
|
|
||||||
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
|
||||||
|
|
||||||
|
@ -267,11 +267,24 @@ fi
|
|||||||
SUMMARY_FILE=github-summary.md
|
SUMMARY_FILE=github-summary.md
|
||||||
touch $objdir/${SUMMARY_FILE}
|
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"
|
||||||
|
fi
|
||||||
|
|
||||||
docker \
|
docker \
|
||||||
run \
|
run \
|
||||||
--workdir /checkout/obj \
|
--workdir /checkout/obj \
|
||||||
--env SRC=/checkout \
|
--env SRC=/checkout \
|
||||||
--env "ENABLE_GCC_CODEGEN=$ENABLE_GCC_CODEGEN" \
|
$extra_env \
|
||||||
$args \
|
$args \
|
||||||
--env CARGO_HOME=/cargo \
|
--env CARGO_HOME=/cargo \
|
||||||
--env DEPLOY \
|
--env DEPLOY \
|
||||||
|
Loading…
Reference in New Issue
Block a user