Rollup merge of #126298 - heiher:loongarch64-musl-ci, r=Mark-Simulacrum · rust-lang/rust@7babf99

9 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -1,4 +1,4 @@

11

Change this file to make users of the `download-ci-llvm` configuration download

22

a new version of LLVM from CI, even if the LLVM submodule hasn’t changed.

33
4-

Last change is for: https://github.com/rust-lang/rust/pull/125141

4+

Last change is for: https://github.com/rust-lang/rust/pull/126298

Original file line numberDiff line numberDiff line change

@@ -217,6 +217,7 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {

217217

("arm-unknown-linux-gnueabihf", false),

218218

("armv7-unknown-linux-gnueabihf", false),

219219

("loongarch64-unknown-linux-gnu", false),

220+

("loongarch64-unknown-linux-musl", false),

220221

("mips-unknown-linux-gnu", false),

221222

("mips64-unknown-linux-gnuabi64", false),

222223

("mips64el-unknown-linux-gnuabi64", false),

Original file line numberDiff line numberDiff line change

@@ -271,6 +271,22 @@ For targets: `loongarch64-unknown-linux-gnu`

271271

- C compiler > gcc version = 13.2.0

272272

- C compiler > C++ = ENABLE -- to cross compile LLVM

273273
274+

### `loongarch64-linux-musl.defconfig`

275+
276+

For targets: `loongarch64-unknown-linux-musl`

277+
278+

- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET}

279+

- Path and misc options > Use a mirror = ENABLE

280+

- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc

281+

- Target options > Target Architecture = loongarch

282+

- Target options > Bitness = 64-bit

283+

- Operating System > Target OS = linux

284+

- Operating System > Linux kernel version = 5.19.16

285+

- Binary utilities > Version of binutils = 2.41

286+

- C-library > musl version = 1.2.5

287+

- C compiler > gcc version = 13.2.0

288+

- C compiler > C++ = ENABLE -- to cross compile LLVM

289+
274290

### `mips-linux-gnu.defconfig`

275291
276292

For targets: `mips-unknown-linux-gnu`

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,35 @@

1+

FROM ubuntu:22.04

2+
3+

COPY scripts/cross-apt-packages.sh /scripts/

4+

RUN sh /scripts/cross-apt-packages.sh

5+
6+

COPY scripts/crosstool-ng-git.sh /scripts/

7+

RUN sh /scripts/crosstool-ng-git.sh

8+
9+

COPY scripts/rustbuild-setup.sh /scripts/

10+

RUN sh /scripts/rustbuild-setup.sh

11+

WORKDIR /tmp

12+
13+

COPY scripts/crosstool-ng-build.sh /scripts/

14+

COPY host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig /tmp/crosstool.defconfig

15+

RUN /scripts/crosstool-ng-build.sh

16+
17+

COPY scripts/sccache.sh /scripts/

18+

RUN sh /scripts/sccache.sh

19+
20+

ENV PATH=$PATH:/x-tools/loongarch64-unknown-linux-musl/bin

21+
22+

ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \

23+

AR_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-ar \

24+

CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++

25+
26+

ENV HOSTS=loongarch64-unknown-linux-musl

27+
28+

ENV RUST_CONFIGURE_ARGS \

29+

--enable-extended \

30+

--enable-lld \

31+

--disable-docs \

32+

--set target.loongarch64-unknown-linux-musl.crt-static=false \

33+

--musl-root-loongarch64=/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/usr

34+
35+

ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,15 @@

1+

CT_CONFIG_VERSION="4"

2+

CT_EXPERIMENTAL=y

3+

CT_PREFIX_DIR="/x-tools/${CT_TARGET}"

4+

CT_USE_MIRROR=y

5+

CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc"

6+

CT_ARCH_LOONGARCH=y

7+

# CT_DEMULTILIB is not set

8+

CT_ARCH_USE_MMU=y

9+

CT_ARCH_ARCH="loongarch64"

10+

CT_KERNEL_LINUX=y

11+

CT_LINUX_V_5_19=y

12+

CT_LIBC_MUSL=y

13+

CT_CC_GCC_ENABLE_DEFAULT_PIE=y

14+

CT_CC_LANG_CXX=y

15+

CT_GETTEXT_NEEDED=y

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,17 @@

1+

#!/bin/sh

2+

set -ex

3+
4+

URL=https://github.com/crosstool-ng/crosstool-ng

5+

REV=c64500d94be92ed1bcdfdef911048a14e216a5e1

6+
7+

mkdir crosstool-ng

8+

cd crosstool-ng

9+

git init

10+

git fetch --depth=1 ${URL} ${REV}

11+

git reset --hard FETCH_HEAD

12+

./bootstrap

13+

./configure --prefix=/usr/local

14+

make -j$(nproc)

15+

make install

16+

cd ..

17+

rm -rf crosstool-ng

Original file line numberDiff line numberDiff line change

@@ -144,6 +144,9 @@ auto:

144144

- image: dist-loongarch64-linux

145145

<<: *job-linux-4c

146146
147+

- image: dist-loongarch64-musl

148+

<<: *job-linux-4c

149+
147150

- image: dist-ohos

148151

<<: *job-linux-4c

149152
Original file line numberDiff line numberDiff line change

@@ -93,6 +93,7 @@ target | notes

9393

`arm-unknown-linux-gnueabihf` | Armv6 Linux, hardfloat (kernel 3.2, glibc 2.17)

9494

`armv7-unknown-linux-gnueabihf` | Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)

9595

[`loongarch64-unknown-linux-gnu`](platform-support/loongarch-linux.md) | LoongArch64 Linux, LP64D ABI (kernel 5.19, glibc 2.36)

96+

[`loongarch64-unknown-linux-musl`](platform-support/loongarch-linux.md) | LoongArch64 Linux, LP64D ABI (kernel 5.19, musl 1.2.5)

9697

`powerpc-unknown-linux-gnu` | PowerPC Linux (kernel 3.2, glibc 2.17)

9798

`powerpc64-unknown-linux-gnu` | PPC64 Linux (kernel 3.2, glibc 2.17)

9899

`powerpc64le-unknown-linux-gnu` | PPC64LE Linux (kernel 3.10, glibc 2.17)

@@ -305,7 +306,6 @@ target | std | host | notes

305306

`i686-uwp-windows-msvc` | ✓ | | [^x86_32-floats-return-ABI]

306307

[`i686-win7-windows-msvc`](platform-support/win7-windows-msvc.md) | ✓ | | 32-bit Windows 7 support [^x86_32-floats-return-ABI]

307308

`i686-wrs-vxworks` | ? | | [^x86_32-floats-return-ABI]

308-

[`loongarch64-unknown-linux-musl`](platform-support/loongarch-linux.md) | ? | | LoongArch64 Linux (LP64D ABI) with musl 1.2.3

309309

[`m68k-unknown-linux-gnu`](platform-support/m68k-unknown-linux-gnu.md) | ? | | Motorola 680x0 Linux

310310

`mips-unknown-linux-gnu` | ✓ | ✓ | MIPS Linux (kernel 4.4, glibc 2.23)

311311

`mips-unknown-linux-musl` | ✓ | | MIPS Linux with musl 1.2.3

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,7 @@ static HOSTS: &[&str] = &[

2525

"i686-pc-windows-msvc",

2626

"i686-unknown-linux-gnu",

2727

"loongarch64-unknown-linux-gnu",

28+

"loongarch64-unknown-linux-musl",

2829

"mips-unknown-linux-gnu",

2930

"mips64-unknown-linux-gnuabi64",

3031

"mips64el-unknown-linux-gnuabi64",

@@ -106,6 +107,7 @@ static TARGETS: &[&str] = &[

106107

"i686-unknown-redox",

107108

"i686-unknown-uefi",

108109

"loongarch64-unknown-linux-gnu",

110+

"loongarch64-unknown-linux-musl",

109111

"loongarch64-unknown-none",

110112

"loongarch64-unknown-none-softfloat",

111113

"m68k-unknown-linux-gnu",