-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add loongarch64-unknown-linux-musl image (#1557)
Close #1556
- Loading branch information
Showing
8 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"type": "added", | ||
"description": "add loongarch64-linux-musl support", | ||
"issues": [1556] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CT_CONFIG_VERSION="4" | ||
CT_EXPERIMENTAL=y | ||
CT_PREFIX_DIR="/x-tools/${CT_TARGET}" | ||
CT_ARCH_LOONGARCH=y | ||
# CT_DEMULTILIB is not set | ||
CT_ARCH_USE_MMU=y | ||
CT_ARCH_ARCH="loongarch64" | ||
CT_KERNEL_LINUX=y | ||
%CT_LINUX_V% | ||
%CT_LINUX% | ||
CT_LIBC_MUSL=y | ||
%CT_MUSL_V% | ||
%CT_GCC_V% | ||
%CT_GCC% | ||
CT_CC_GCC_ENABLE_DEFAULT_PIE=y | ||
CT_CC_LANG_CXX=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM ubuntu:20.04 as cross-base | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
COPY common.sh lib.sh / | ||
RUN /common.sh | ||
|
||
COPY cmake.sh / | ||
RUN /cmake.sh | ||
|
||
COPY xargo.sh / | ||
RUN /xargo.sh | ||
|
||
FROM cross-base as build | ||
|
||
ARG VERBOSE | ||
COPY crosstool-ng.sh / | ||
COPY crosstool-config/loongarch64-unknown-linux-musl.config / | ||
RUN /crosstool-ng.sh loongarch64-unknown-linux-musl.config 5 ed12fa68402f58e171a6f79500f73f4781fdc9e5 | ||
|
||
ENV PATH /x-tools/loongarch64-unknown-linux-musl/bin/:$PATH | ||
|
||
COPY deny-debian-packages.sh / | ||
RUN TARGET_ARCH=loong64 /deny-debian-packages.sh | ||
|
||
COPY qemu.sh / | ||
RUN /qemu.sh loongarch64 | ||
|
||
COPY qemu-runner base-runner.sh / | ||
COPY toolchain.cmake /opt/toolchain.cmake | ||
|
||
ENV CROSS_TOOLCHAIN_PREFIX=loongarch64-unknown-linux-musl- | ||
ENV CROSS_SYSROOT=/x-tools/loongarch64-unknown-linux-musl/loongarch64-unknown-linux-musl/sysroot/ | ||
ENV CROSS_TARGET_RUNNER="/qemu-runner loongarch64" | ||
ENV CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ | ||
CARGO_TARGET_LOONGARCH64_UNKNOWN_LINUX_MUSL_RUNNER="$CROSS_TARGET_RUNNER" \ | ||
AR_loongarch64_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"ar \ | ||
CC_loongarch64_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"gcc \ | ||
CXX_loongarch64_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"g++ \ | ||
CMAKE_TOOLCHAIN_FILE_loongarch64_unknown_linux_musl=/opt/toolchain.cmake \ | ||
BINDGEN_EXTRA_CLANG_ARGS_loongarch64_unknown_linux_musl="--sysroot=$CROSS_SYSROOT" \ | ||
QEMU_LD_PREFIX="$CROSS_SYSROOT" \ | ||
RUST_TEST_THREADS=1 \ | ||
CROSS_CMAKE_SYSTEM_NAME=Linux \ | ||
CROSS_CMAKE_SYSTEM_PROCESSOR=loongarch64 \ | ||
CROSS_CMAKE_CRT=musl \ | ||
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC" | ||
|
||
RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner |
37 changes: 37 additions & 0 deletions
37
docker/crosstool-config/loongarch64-unknown-linux-musl.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
CT_CONFIG_VERSION="4" | ||
CT_EXPERIMENTAL=y | ||
CT_PREFIX_DIR="/x-tools/${CT_TARGET}" | ||
CT_ARCH_LOONGARCH=y | ||
# CT_DEMULTILIB is not set | ||
CT_ARCH_USE_MMU=y | ||
CT_ARCH_ARCH="loongarch64" | ||
CT_KERNEL_LINUX=y | ||
CT_LINUX_V_5_19=y | ||
# CT_LINUX_NO_VERSIONS is not set | ||
CT_LINUX_VERSION="5.19.16" | ||
CT_LINUX_later_than_4_8=y | ||
CT_LINUX_4_8_or_later=y | ||
CT_LINUX_later_than_3_7=y | ||
CT_LINUX_3_7_or_later=y | ||
CT_LINUX_later_than_3_2=y | ||
CT_LINUX_3_2_or_later=y | ||
CT_LIBC_MUSL=y | ||
CT_MUSL_V_1_2_5=y | ||
# CT_MUSL_NO_VERSIONS is not set | ||
CT_MUSL_VERSION="1.2.5" | ||
CT_GCC_V_14=y | ||
# CT_GCC_NO_VERSIONS is not set | ||
CT_GCC_VERSION="14.2.0" | ||
CT_GCC_later_than_7=y | ||
CT_GCC_7_or_later=y | ||
CT_GCC_later_than_6=y | ||
CT_GCC_6_or_later=y | ||
CT_GCC_later_than_5=y | ||
CT_GCC_5_or_later=y | ||
CT_GCC_later_than_4_9=y | ||
CT_GCC_4_9_or_later=y | ||
CT_GCC_later_than_4_8=y | ||
CT_GCC_4_8_or_later=y | ||
CT_CC_GCC_ENABLE_DEFAULT_PIE=y | ||
CT_CC_LANG_CXX=y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters