Skip to content

Commit 806e49f

Browse files
authored
Rollup merge of rust-lang#148158 - heiher:loong64-medium, r=jieyouxu
ci: loongarch64: use medium code model to avoid relocation overflows The LoongArch C/C++ cross toolchain defaults to the `normal` code model, which can cause relocation overflows when linking LLVM after upgrading to verion 22. This change uses the `medium`code model for `loongarch64-linux-gnu` and `loongarch64-linux-musl` builds to avoid these linking errors.
2 parents e65f9bc + 87c66c9 commit 806e49f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/ci/docker/host-x86_64/dist-loongarch64-linux/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ ENV PATH=$PATH:/x-tools/loongarch64-unknown-linux-gnu/bin
2121

2222
ENV CC_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-gcc \
2323
AR_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-ar \
24-
CXX_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-g++
24+
CXX_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-g++ \
25+
CFLAGS_loongarch64_unknown_linux_gnu="-mcmodel=medium" \
26+
CXXFLAGS_loongarch64_unknown_linux_gnu="-mcmodel=medium"
2527

2628
# We re-use the Linux toolchain for bare-metal, because upstream bare-metal
2729
# target support for LoongArch is only available from GCC 14+.

src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ ENV PATH=$PATH:/x-tools/loongarch64-unknown-linux-musl/bin
2121

2222
ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \
2323
AR_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-ar \
24-
CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++
24+
CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++ \
25+
CFLAGS_loongarch64_unknown_linux_musl="-mcmodel=medium" \
26+
CXXFLAGS_loongarch64_unknown_linux_musl="-mcmodel=medium"
2527

2628
ENV HOSTS=loongarch64-unknown-linux-musl
2729

0 commit comments

Comments
 (0)