Skip to content

Commit dddb502

Browse files
committed
Auto merge of rust-lang#127150 - xen0n:issue125908, r=<try>
Fix x86_64 code being produced for bare-metal LoongArch targets' `compiler_builtins` Formerly the `loongarch*-*-none*` targets were added to the `dist-various-2` CI job, but no corresponding toolchain was added along with them. This meant the `compiler_builtins` for the targets were built with the host toolchain. As the other `dist-various` toolchains are mostly pre-built so far, to avoid burdening them with crosstool-ng builds, simply move the two bare-metal LoongArch targets to the `dist-loongarch64-linux` job which has a ready-to-use LoongArch toolchain. With the proper CFLAGS applied it is possible to build artifacts suitable for bare-metal. I verified that the `compiler_builtins` objects are now correctly produced regarding architecture and ABI, with the changes here applied. Fixes rust-lang#125908. cc `@heiher` try-job: dist-loongarch64-linux try-job: dist-various-2
2 parents 716752e + 03fce36 commit dddb502

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

+19-1
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,30 @@ ENV CC_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-gcc \
2323
AR_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-ar \
2424
CXX_loongarch64_unknown_linux_gnu=loongarch64-unknown-linux-gnu-g++
2525

26+
# We re-use the Linux toolchain for bare-metal, because upstream bare-metal
27+
# target support for LoongArch is only available from GCC 14+.
28+
#
29+
# See: https://github.com/gcc-mirror/gcc/commit/976f4f9e4770
30+
ENV CC_loongarch64_unknown_none=loongarch64-unknown-linux-gnu-gcc \
31+
AR_loongarch64_unknown_none=loongarch64-unknown-linux-gnu-ar \
32+
CXX_loongarch64_unknown_none=loongarch64-unknown-linux-gnu-g++ \
33+
CFLAGS_loongarch64_unknown_none="-ffreestanding -mabi=lp64d" \
34+
CXXFLAGS_loongarch64_unknown_none="-ffreestanding -mabi=lp64d" \
35+
CC_loongarch64_unknown_none_softfloat=loongarch64-unknown-linux-gnu-gcc \
36+
AR_loongarch64_unknown_none_softfloat=loongarch64-unknown-linux-gnu-ar \
37+
CXX_loongarch64_unknown_none_softfloat=loongarch64-unknown-linux-gnu-g++ \
38+
CFLAGS_loongarch64_unknown_none_softfloat="-ffreestanding -mabi=lp64s -mfpu=none" \
39+
CXXFLAGS_loongarch64_unknown_none_softfloat="-ffreestanding -mabi=lp64s -mfpu=none"
40+
2641
ENV HOSTS=loongarch64-unknown-linux-gnu
42+
ENV TARGETS=$HOSTS
43+
ENV TARGETS=$TARGETS,loongarch64-unknown-none
44+
ENV TARGETS=$TARGETS,loongarch64-unknown-none-softfloat
2745

2846
ENV RUST_CONFIGURE_ARGS \
2947
--enable-extended \
3048
--enable-full-tools \
3149
--enable-profiler \
3250
--disable-docs
3351

34-
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
52+
ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $TARGETS

src/ci/docker/host-x86_64/dist-various-2/Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ ENV TARGETS=$TARGETS,armv7-unknown-linux-gnueabi
121121
ENV TARGETS=$TARGETS,armv7-unknown-linux-musleabi
122122
ENV TARGETS=$TARGETS,i686-unknown-freebsd
123123
ENV TARGETS=$TARGETS,x86_64-unknown-none
124-
ENV TARGETS=$TARGETS,loongarch64-unknown-none
125-
ENV TARGETS=$TARGETS,loongarch64-unknown-none-softfloat
126124
ENV TARGETS=$TARGETS,aarch64-unknown-uefi
127125
ENV TARGETS=$TARGETS,i686-unknown-uefi
128126
ENV TARGETS=$TARGETS,x86_64-unknown-uefi

0 commit comments

Comments
 (0)