|
| 1 | +From fb5f17d6958e86af31e719482001b13bec3b29ce Mon Sep 17 00:00:00 2001 |
| 2 | +From: WANG Rui <wangrui@loongson.cn> |
| 3 | +Date: Tue, 5 Mar 2024 16:04:02 +0800 |
| 4 | +Subject: [PATCH 06/12] ci: Add support for dist-loongarch64-musl |
| 5 | + |
| 6 | +--- |
| 7 | + src/ci/docker/README.md | 16 +++++++++ |
| 8 | + .../dist-loongarch64-musl/Dockerfile | 36 +++++++++++++++++++ |
| 9 | + .../loongarch64-unknown-linux-musl.defconfig | 15 ++++++++ |
| 10 | + src/ci/github-actions/ci.yml | 3 ++ |
| 11 | + 4 files changed, 70 insertions(+) |
| 12 | + create mode 100644 src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile |
| 13 | + create mode 100644 src/ci/docker/host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig |
| 14 | + |
| 15 | +diff --git a/src/ci/docker/README.md b/src/ci/docker/README.md |
| 16 | +index 2e6456837..c53cf28c0 100644 |
| 17 | +--- a/src/ci/docker/README.md |
| 18 | ++++ b/src/ci/docker/README.md |
| 19 | +@@ -274,6 +274,22 @@ For targets: `loongarch64-unknown-linux-gnu` |
| 20 | + - C compiler > gcc version = 13.2.0 |
| 21 | + - C compiler > C++ = ENABLE -- to cross compile LLVM |
| 22 | + |
| 23 | ++### `loongarch64-linux-musl.defconfig` |
| 24 | ++ |
| 25 | ++For targets: `loongarch64-unknown-linux-musl` |
| 26 | ++ |
| 27 | ++- Path and misc options > Prefix directory = /x-tools/${CT\_TARGET} |
| 28 | ++- Path and misc options > Use a mirror = ENABLE |
| 29 | ++- Path and misc options > Base URL = https://ci-mirrors.rust-lang.org/rustc |
| 30 | ++- Target options > Target Architecture = loongarch |
| 31 | ++- Target options > Bitness = 64-bit |
| 32 | ++- Operating System > Target OS = linux |
| 33 | ++- Operating System > Linux kernel version = 5.19.16 |
| 34 | ++- Binary utilities > Version of binutils = 2.41 |
| 35 | ++- C-library > musl version = 1.2.5 |
| 36 | ++- C compiler > gcc version = 13.2.0 |
| 37 | ++- C compiler > C++ = ENABLE -- to cross compile LLVM |
| 38 | ++ |
| 39 | + ### `mips-linux-gnu.defconfig` |
| 40 | + |
| 41 | + For targets: `mips-unknown-linux-gnu` |
| 42 | +diff --git a/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile b/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile |
| 43 | +new file mode 100644 |
| 44 | +index 000000000..201e83b2c |
| 45 | +--- /dev/null |
| 46 | ++++ b/src/ci/docker/host-x86_64/dist-loongarch64-musl/Dockerfile |
| 47 | +@@ -0,0 +1,36 @@ |
| 48 | ++FROM ubuntu:22.04 |
| 49 | ++ |
| 50 | ++COPY scripts/cross-apt-packages.sh /scripts/ |
| 51 | ++RUN sh /scripts/cross-apt-packages.sh |
| 52 | ++ |
| 53 | ++COPY scripts/crosstool-ng.sh /scripts/ |
| 54 | ++RUN sh /scripts/crosstool-ng.sh |
| 55 | ++ |
| 56 | ++COPY scripts/rustbuild-setup.sh /scripts/ |
| 57 | ++RUN sh /scripts/rustbuild-setup.sh |
| 58 | ++WORKDIR /tmp |
| 59 | ++ |
| 60 | ++COPY scripts/crosstool-ng-build.sh /scripts/ |
| 61 | ++COPY host-x86_64/dist-loongarch64-linux/loongarch64-unknown-linux-musl.defconfig /tmp/crosstool.defconfig |
| 62 | ++RUN /scripts/crosstool-ng-build.sh |
| 63 | ++ |
| 64 | ++COPY scripts/sccache.sh /scripts/ |
| 65 | ++RUN sh /scripts/sccache.sh |
| 66 | ++ |
| 67 | ++ENV PATH=$PATH:/x-tools/loongarch64-unknown-linux-musl/bin |
| 68 | ++ |
| 69 | ++ENV CC_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-gcc \ |
| 70 | ++ AR_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-ar \ |
| 71 | ++ CXX_loongarch64_unknown_linux_musl=loongarch64-unknown-linux-musl-g++ |
| 72 | ++ |
| 73 | ++ENV HOSTS=loongarch64-unknown-linux-musl |
| 74 | ++ |
| 75 | ++ENV RUST_CONFIGURE_ARGS \ |
| 76 | ++ --enable-extended \ |
| 77 | ++ --enable-lld \ |
| 78 | ++ --disable-docs \ |
| 79 | ++ --set target.loongarch64-unknown-linux-musl.crt-static=false \ |
| 80 | ++ --set target.loongarch64-unknown-linux-musl.musl-root=/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/usr \ |
| 81 | ++ --build $HOSTS |
| 82 | ++ |
| 83 | ++ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS |
| 84 | +diff --git a/src/ci/docker/host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig b/src/ci/docker/host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig |
| 85 | +new file mode 100644 |
| 86 | +index 000000000..3ab676ed9 |
| 87 | +--- /dev/null |
| 88 | ++++ b/src/ci/docker/host-x86_64/dist-loongarch64-musl/loongarch64-unknown-linux-musl.defconfig |
| 89 | +@@ -0,0 +1,15 @@ |
| 90 | ++CT_CONFIG_VERSION="4" |
| 91 | ++CT_EXPERIMENTAL=y |
| 92 | ++CT_PREFIX_DIR="/x-tools/${CT_TARGET}" |
| 93 | ++CT_USE_MIRROR=y |
| 94 | ++CT_MIRROR_BASE_URL="https://ci-mirrors.rust-lang.org/rustc" |
| 95 | ++CT_ARCH_LOONGARCH=y |
| 96 | ++# CT_DEMULTILIB is not set |
| 97 | ++CT_ARCH_USE_MMU=y |
| 98 | ++CT_ARCH_ARCH="loongarch64" |
| 99 | ++CT_KERNEL_LINUX=y |
| 100 | ++CT_LINUX_V_5_19=y |
| 101 | ++CT_LIBC_MUSL=y |
| 102 | ++CT_CC_GCC_ENABLE_DEFAULT_PIE=y |
| 103 | ++CT_CC_LANG_CXX=y |
| 104 | ++CT_GETTEXT_NEEDED=y |
| 105 | +diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml |
| 106 | +index f2effcbd8..81fc89ab8 100644 |
| 107 | +--- a/src/ci/github-actions/ci.yml |
| 108 | ++++ b/src/ci/github-actions/ci.yml |
| 109 | +@@ -392,6 +392,9 @@ jobs: |
| 110 | + - name: dist-loongarch64-linux |
| 111 | + <<: *job-linux-8c |
| 112 | + |
| 113 | ++ - name: dist-loongarch64-musl |
| 114 | ++ <<: *job-linux-8c |
| 115 | ++ |
| 116 | + - name: dist-powerpc-linux |
| 117 | + <<: *job-linux-8c |
| 118 | + |
| 119 | +-- |
| 120 | +2.44.0 |
| 121 | + |
0 commit comments