@@ -35,10 +35,8 @@ RUN curl -sL "https://github.com/PowerShell/PowerShell/releases/download/v7.3.1/
35
35
COPY scripts/sccache.sh /scripts/
36
36
RUN sh /scripts/sccache.sh
37
37
38
- # Make `libgccjit.so` accessible.
38
+ # Make `libgccjit.so` accessible to the linker .
39
39
RUN ln -s /usr/lib/gcc/x86_64-linux-gnu/12/libgccjit.so /usr/lib/x86_64-linux-gnu/libgccjit.so
40
- # Fix rustc_codegen_gcc lto issues.
41
- ENV GCC_EXEC_PREFIX="/usr/lib/gcc/"
42
40
43
41
# We are disabling CI LLVM since this builder is intentionally using a host
44
42
# LLVM, rather than the typical src/llvm-project LLVM.
@@ -48,13 +46,21 @@ ENV NO_DOWNLOAD_CI_LLVM 1
48
46
# be missing.
49
47
ENV IS_NOT_LATEST_LLVM 1
50
48
49
+ # If `ENABLE_GCC_CODEGEN` is set and not empty, we add the `--enable-new-symbol-mangling`
50
+ # argument to `RUST_CONFIGURE_ARGS` and set the `GCC_EXEC_PREFIX` environment variable.
51
+ # `cg_gcc` doesn't support the legacy mangling so we need to enforce the new one
52
+ # if we run `cg_gcc` tests.
53
+ ENV USE_NEW_MANGLING ${ENABLE_GCC_CODEGEN:+ --enable-new-symbol-mangling}
54
+ # Fix rustc_codegen_gcc lto issues.
55
+ ENV GCC_EXEC_PREFIX ${ENABLE_GCC_CODEGEN:+/usr/lib/gcc/}
56
+
51
57
# Using llvm-link-shared due to libffi issues -- see #34486
52
58
ENV RUST_CONFIGURE_ARGS \
53
59
--build=x86_64-unknown-linux-gnu \
54
60
--llvm-root=/usr/lib/llvm-15 \
55
61
--enable-llvm-link-shared \
56
- --set rust.thin-lto-import-instr-limit=10 \
57
- --enable-new-symbol-mangling
62
+ $USE_NEW_MANGLING \
63
+ --set rust.thin-lto-import-instr-limit=10
58
64
59
65
COPY host-x86_64/x86_64-gnu-llvm-15/script.sh /tmp/
60
66
0 commit comments