-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
1 deletion.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/azurelinux/3.0/net10.0/cross/loongarch64-musl/Dockerfile
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,36 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/loongarch64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh loongarch64 alpine3.20 --skipunmount | ||
|
||
RUN TARGET_TRIPLE="loongarch64-alpine-linux-musl" && \ | ||
cmake -S llvm-project.src/runtimes -B runtimes \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_ASM_COMPILER=clang \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
# We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
-DCMAKE_SYSROOT="$ROOTFS_DIR" \ | ||
# Specify linker to use for exes directly for CMake toolchain detection | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
# Don't search for tools in the sysroot as we're cross-compiling | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ | ||
-DLLVM_USE_LINKER=lld \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx" \ | ||
-DLIBCXX_ENABLE_SHARED=OFF \ | ||
-DLIBCXX_HAS_MUSL_LIBC=ON \ | ||
-DLIBCXX_CXX_ABI=libstdc++ \ | ||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="$ROOTFS_DIR/usr/include/c++/14.2.0/;$ROOTFS_DIR/usr/include/c++/14.2.0/$TARGET_TRIPLE" && \ | ||
cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ | ||
cmake --install runtimes --prefix "$ROOTFS_DIR/usr" | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR |
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,63 @@ | ||
ARG ROOTFS_DIR=/crossrootfs/loongarch64 | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-builder-amd64 AS builder | ||
ARG ROOTFS_DIR | ||
|
||
# 1. Download the debian keyrings | ||
RUN wget https://mirrors.edge.kernel.org/debian/pool/main/d/debian-ports-archive-keyring/debian-ports-archive-keyring_2024.02.02.tar.xz && \ | ||
echo "e27138a7c3586a06bdb4c0015912d33dd44267f8c7227cc8860f3b16af6167eb debian-ports-archive-keyring_2024.02.02.tar.xz" | sha256sum -c && \ | ||
tar xf debian-ports-archive-keyring_2024.02.02.tar.xz && \ | ||
rm debian-ports-archive-keyring_2024.02.02.tar.xz && \ | ||
# 2. Verify debian keyrings | ||
pushd debian-ports-archive-keyring && \ | ||
gpg --output SHA256SUMS --decrypt SHA256SUMS.asc && \ | ||
sha256sum -c SHA256SUMS && \ | ||
# 3. Install the needed debian keyring and clean up | ||
mkdir -p /usr/share/keyrings && \ | ||
mv keyrings/debian-ports-archive-keyring.gpg /usr/share/keyrings && \ | ||
# Download the removed Debian key and dearmor it | ||
wget -qO- "https://keyring.debian.org/pks/lookup?op=get&search=0x2404C9546E145360" | gpg --dearmor > /usr/share/keyrings/debian-archive-removed-keys.gpg && \ | ||
popd && \ | ||
rm -r debian-ports-archive-keyring | ||
|
||
RUN /scripts/eng/common/cross/build-rootfs.sh loongarch64 sid --skipunmount | ||
|
||
RUN TARGET_TRIPLE="loongarch64-linux-gnu" && \ | ||
CLANG_MAJOR_VERSION=$(clang --version | grep -oP "(?<=version )\d+") && \ | ||
cmake -S llvm-project.src/runtimes -B runtimes \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DCMAKE_ASM_COMPILER=clang \ | ||
-DCMAKE_C_COMPILER=clang \ | ||
-DCMAKE_CXX_COMPILER=clang++ \ | ||
-DCMAKE_ASM_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_C_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
-DCMAKE_CXX_COMPILER_TARGET="$TARGET_TRIPLE" \ | ||
# We're going to link the static libraries we build here into PIC images, so build the static libraries as PIC. | ||
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \ | ||
-DCMAKE_SYSROOT="$ROOTFS_DIR" \ | ||
# Specify linker to use for exes directly for CMake toolchain detection | ||
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \ | ||
# Don't search for tools in the sysroot as we're cross-compiling | ||
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="NEVER" \ | ||
-DLLVM_USE_LINKER=lld \ | ||
-DLLVM_ENABLE_RUNTIMES="libcxx;compiler-rt" \ | ||
-DLIBCXX_ENABLE_SHARED=OFF \ | ||
-DLIBCXX_CXX_ABI=libstdc++ \ | ||
-DLIBCXX_CXX_ABI_INCLUDE_PATHS="$ROOTFS_DIR/usr/include/c++/13/;$ROOTFS_DIR/usr/include/$TARGET_TRIPLE" \ | ||
-DCOMPILER_RT_CXX_LIBRARY="libcxx" \ | ||
-DCOMPILER_RT_STATIC_CXX_LIBRARY=ON \ | ||
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
-DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
# The libfuzzer build in LLVM doesn't correctly forward the required CMake properties to the "fuzzed libc++" build | ||
# so skip it here. | ||
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \ | ||
-DCOMPILER_RT_INSTALL_PATH="/usr/local/lib/clang/$CLANG_MAJOR_VERSION" && \ | ||
cmake --build runtimes -j $(getconf _NPROCESSORS_ONLN) && \ | ||
cmake --install runtimes --prefix "$ROOTFS_DIR/usr" | ||
|
||
FROM mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-crossdeps-llvm-amd64 | ||
ARG ROOTFS_DIR | ||
|
||
COPY --from=builder /usr/local/lib/clang /usr/local/lib/clang/ | ||
COPY --from=builder $ROOTFS_DIR $ROOTFS_DIR |
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