-
Notifications
You must be signed in to change notification settings - Fork 642
Add LoongArch64 build support #3198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
ac44fca
Add LoongArch64 build support
4Darmygeometry 18ee00f
Delete binding/HarfBuzzSharp.NativeAssets.Linux/HarfBuzzSharp.NativeA…
4Darmygeometry ffc55e6
Create HarfBuzzSharp.NativeAssets.Linux.csproj
4Darmygeometry 245e08d
Delete binding/SkiaSharp.NativeAssets.Linux.NoDependencies/SkiaSharp.…
4Darmygeometry ee617c9
Create SkiaSharp.NativeAssets.Linux.NoDependencies.csproj
4Darmygeometry 451375c
Delete binding/SkiaSharp.NativeAssets.Linux/SkiaSharp.NativeAssets.Li…
4Darmygeometry 144e3dc
Create SkiaSharp.NativeAssets.Linux.csproj
4Darmygeometry 018d6b4
Update _clang-cross-common.sh
4Darmygeometry e0fac5c
Update Dockerfile
4Darmygeometry 5bc0ec7
Update build-local.sh
4Darmygeometry 7812abd
Update build-local.sh
4Darmygeometry 28b79a0
azure-templates-stages.yml:updated to add loong
4Darmygeometry 2d786be
azure-templates-stages.yml:LoongArch64
4Darmygeometry 6a4e95e
Dockerfile:Changed to trixie docker and back to gcc13
4Darmygeometry f534899
build-local.sh:update instruction
4Darmygeometry a4c53a1
azure-templates-stages.yml:Fix loongarch64 build
4Darmygeometry cf0a58a
azure-templates-stages.yml:Fix loongarch64 build 2
4Darmygeometry 7f8dcd8
Create startup.sh
4Darmygeometry 012f3dd
Dockerfile:changes libpthread.so to libpthread.so.0
4Darmygeometry 4072be5
azure-templates-stages.yml:Revert because alpine official support loong
4Darmygeometry 49bcb75
Dockerfile:Back to GCC 14 to compat libc6-loong64-cross
4Darmygeometry 2abe60c
Update scripts/azure-templates-stages.yml
mattleibow 7c12896
azure-templates-stages.yml:https://packages.debian.org/trixie/binutil…
4Darmygeometry 73b62c7
Update scripts/Docker/debian/clang-cross/13/Dockerfile
mattleibow 74b64c0
Merge branch 'main' into main
mattleibow bab37ab
Create deepin 23 Dockerfile for backup purposes
4Darmygeometry 0b5c745
Dockerfile:Use stable version LLVM 18
4Darmygeometry 7ea22af
Create startup.sh
4Darmygeometry 3eaea33
Create .dockerignore
4Darmygeometry 43e52aa
Create Deepin 23 build-local.sh
4Darmygeometry eed9a94
azure-templates-stages.yml:Try to use deepin 23 to build
4Darmygeometry df36e43
azure-templates-stages.yml:Revert to debian trixie
4Darmygeometry 281389f
Delete scripts/Docker/deepin/clang-cross/23/Dockerfile
4Darmygeometry 9c17cd1
Delete scripts/Docker/deepin/clang-cross/23/startup.sh
4Darmygeometry 2dc5921
Delete scripts/Docker/deepin/clang-cross/.dockerignore
4Darmygeometry 7303ccb
Delete scripts/Docker/deepin/clang-cross/build-local.sh
4Darmygeometry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,88 @@ | ||
| # Arguments: | ||
| # IMAGE_ARCH - the architecture of the image [ amd64 | arm64v8 | riscv64 | loongarch64 ] | ||
| # DOTNET_SDK_VERSION - the version of dotnet for the Cake script [ 8.0 | * ] | ||
| # LLVM_VERSION - the version of the LLVM compiler [ 19 | * ] | ||
| # TOOLCHAIN_VERSION - the version of the GCC toolchain [ 14 | * ] | ||
| # TOOLCHAIN_ARCH - the architecture of the GCC toolchain [ arm-linux-gnueabihf | aarch64-linux-gnu | riscv64-linux-gnu | loongarch64-linux-gnu ] | ||
| # TOOLCHAIN_ARCH_SHORT - the short form architecture of the GCC toolchain [ armhf | arm64 | riscv64 | loong64 ] | ||
|
|
||
| ARG IMAGE_ARCH=amd64 | ||
| FROM ${IMAGE_ARCH}/debian:trixie | ||
|
|
||
| # Set the architecture-specific variables based on the value of the BUILD_ARCH argument | ||
| ARG BUILD_ARCH=arm64 | ||
| RUN case ${BUILD_ARCH} in \ | ||
| arm) TOOLCHAIN_ARCH=arm-linux-gnueabihf ; TOOLCHAIN_ARCH_SHORT=armhf ; TOOLCHAIN_ARCH_TARGET=armv7a-linux-gnueabihf ;; \ | ||
| arm64) TOOLCHAIN_ARCH=aarch64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=arm64 ; TOOLCHAIN_ARCH_TARGET=aarch64-linux-gnu ;; \ | ||
| loongarch64) TOOLCHAIN_ARCH=loongarch64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=loong64 ; TOOLCHAIN_ARCH_TARGET=loongarch64-linux-gnu ;; \ | ||
| riscv64) TOOLCHAIN_ARCH=riscv64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=riscv64 ; TOOLCHAIN_ARCH_TARGET=riscv64-linux-gnu ;; \ | ||
| x86) TOOLCHAIN_ARCH=i686-linux-gnu ; TOOLCHAIN_ARCH_SHORT=i386 ; TOOLCHAIN_ARCH_TARGET=i686-linux-gnu ;; \ | ||
| x64) TOOLCHAIN_ARCH=x86-64-linux-gnu ; TOOLCHAIN_ARCH_SHORT=amd64 ; TOOLCHAIN_ARCH_TARGET=x86_64-linux-gnu ;; \ | ||
| *) echo "Unsupported architecture: ${BUILD_ARCH}" && exit 1 ;; \ | ||
| esac \ | ||
| && echo "export TOOLCHAIN_ARCH=${TOOLCHAIN_ARCH}" > /etc/skia-env \ | ||
| && echo "export TOOLCHAIN_ARCH_SHORT=${TOOLCHAIN_ARCH_SHORT}" >> /etc/skia-env \ | ||
| && echo "export TOOLCHAIN_ARCH_TARGET=${TOOLCHAIN_ARCH_TARGET}" >> /etc/skia-env | ||
|
|
||
| # Install the required packages | ||
| ARG LLVM_VERSION=19 | ||
| RUN apt-get update \ | ||
| && apt-get install -y \ | ||
| curl python3 git clang-${LLVM_VERSION} ninja-build xz-utils \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install the cross-compilation GCC toolchain | ||
| ARG TOOLCHAIN_VERSION=14 | ||
| RUN . /etc/skia-env \ | ||
| && apt-get update \ | ||
| && apt-get install -y \ | ||
| libc6-dev-${TOOLCHAIN_ARCH_SHORT}-cross \ | ||
| libstdc++-${TOOLCHAIN_VERSION}-dev-${TOOLCHAIN_ARCH_SHORT}-cross \ | ||
| libgcc-${TOOLCHAIN_VERSION}-dev-${TOOLCHAIN_ARCH_SHORT}-cross \ | ||
| binutils-${TOOLCHAIN_ARCH} \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Make the script more flexible and use "current" instead of the actual version | ||
| # libpthread.so.0 for loong64 is in https://packages.debian.org/trixie/all/libc6-loong64-cross/filelist that use GCC 14 and Glibc 2.41 to programmed | ||
| RUN . /etc/skia-env \ | ||
| && TOOLCHAIN_ARCH=$(echo ${TOOLCHAIN_ARCH} | sed 's/x86-64/x86_64/g') \ | ||
| && ln -s /usr/${TOOLCHAIN_ARCH}/include/c++/${TOOLCHAIN_VERSION} /usr/${TOOLCHAIN_ARCH}/include/c++/current \ | ||
| && sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libpthread.so.0 \ | ||
| && sed -i "s/\/usr\/${TOOLCHAIN_ARCH}\/lib\///g" /usr/${TOOLCHAIN_ARCH}/lib/libc.so | ||
|
|
||
| # Install the cross-compilation skia build dependencies (fontconfig) | ||
| # In order to compat Loongnix 25, LoongArch APT_REPO use loongnix 25 mirrors. | ||
| RUN . /etc/skia-env \ | ||
| && mkdir -p /skia-utils/libfontconfig-dev \ | ||
| && cd /skia-utils/libfontconfig-dev \ | ||
| && APT_REPO=http://deb.debian.org/debian \ | ||
| && case "${TOOLCHAIN_ARCH_SHORT}" in \ | ||
| loong64) FC_VERSION=2.15.0-1.1 ; FC_PKG=libfontconfig-dev ; APT_REPO=https://pkg.loongnix.cn/loongnix/25 ;; \ | ||
| riscv64) FC_VERSION=2.15.0-2.1 ; FC_PKG=libfontconfig-dev ;; \ | ||
| *) FC_VERSION=2.13.1-2 ; FC_PKG=libfontconfig1-dev ;; \ | ||
| esac \ | ||
| && curl ${APT_REPO}/pool/main/f/fontconfig/${FC_PKG}_${FC_VERSION}_${TOOLCHAIN_ARCH_SHORT}.deb -L -o libfontconfig-dev.deb \ | ||
| && ar vx libfontconfig-dev.deb \ | ||
| && tar -xJvf data.tar.xz \ | ||
| && rm libfontconfig-dev.deb \ | ||
| && TOOLCHAIN_ARCH=$(echo ${TOOLCHAIN_ARCH} | sed 's/x86-64/x86_64/g') \ | ||
| && cp -R usr/lib/*/* /usr/${TOOLCHAIN_ARCH}/lib/ \ | ||
| && cp -R usr/include/* /usr/${TOOLCHAIN_ARCH}/include/ | ||
|
|
||
| # Install the .NET SDK | ||
| ARG DOTNET_SDK_VERSION=8.0 | ||
| ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 | ||
| RUN curl https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh -L -o dotnet-install.sh \ | ||
| && bash dotnet-install.sh --channel ${DOTNET_SDK_VERSION} --install-dir /usr/share/dotnet --verbose \ | ||
| && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet \ | ||
| && rm dotnet-install.sh \ | ||
| && dotnet help \ | ||
| && dotnet --info | ||
|
|
||
| ENV CC=clang-${LLVM_VERSION} CXX=clang++-${LLVM_VERSION} | ||
|
|
||
| WORKDIR /work | ||
|
|
||
| COPY ./startup.sh / | ||
| RUN chmod +x /startup.sh | ||
| ENTRYPOINT [ "/startup.sh" ] | ||
|
mattleibow marked this conversation as resolved.
|
||
This file contains hidden or 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,6 @@ | ||
| #!/usr/bin/env bash | ||
| set -e | ||
|
|
||
| source /etc/skia-env | ||
|
|
||
| exec "$@" |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.