diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index b19b6c39..e3b23c07 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -268,6 +268,18 @@ jobs: target_cpu: x86 enable_v8: true + linux_musl_arm64: + name: Linux musl arm64 + uses: ./.github/workflows/build.yml + with: + branch: ${{ github.event.inputs.branch }} + version: ${{ github.event.inputs.version }} + is_debug: ${{ github.event.inputs.is_debug == 'true' }} + target_os: linux + target_cpu: arm64 + target_libc: musl + enable_v8: false + linux_musl_x64: name: Linux musl x64 uses: ./.github/workflows/build.yml @@ -631,6 +643,7 @@ jobs: - linux_arm_v8 - linux_arm64 - linux_arm64_v8 + - linux_musl_arm64 - linux_musl_x64 - linux_musl_x64_v8 - linux_musl_x86 diff --git a/.gitignore b/.gitignore index 461ebab5..d2c1508b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,6 @@ /staging/ /build/ *.tgz -/*-musl-cross/ +/*-musl*-cross/ /android-ndk* /conda/out/ \ No newline at end of file diff --git a/patches/musl/toolchain.gn b/patches/musl/toolchain.gn index f3fe091b..5f53f189 100644 --- a/patches/musl/toolchain.gn +++ b/patches/musl/toolchain.gn @@ -43,3 +43,47 @@ gcc_toolchain("x64") { is_clang = false } } + +gcc_toolchain("arm") { + toolprefix = "arm-linux-musleabihf-" + + cc = "${toolprefix}gcc" + cxx = "${toolprefix}g++" + + readelf = "${toolprefix}readelf" + nm = "${toolprefix}nm" + ar = "${toolprefix}ar" + ld = cxx + + extra_ldflags = "-static-libgcc -static-libstdc++" + + toolchain_args = { + current_cpu = "arm" + current_os = "linux" + + use_remoteexec = false + is_clang = false + } +} + +gcc_toolchain("arm64") { + toolprefix = "aarch64-linux-musl-" + + cc = "${toolprefix}gcc" + cxx = "${toolprefix}g++" + + readelf = "${toolprefix}readelf" + nm = "${toolprefix}nm" + ar = "${toolprefix}ar" + ld = cxx + + extra_ldflags = "-static-libgcc -static-libstdc++" + + toolchain_args = { + current_cpu = "arm64" + current_os = "linux" + + use_remoteexec = false + is_clang = false + } +} diff --git a/steps/01-install.sh b/steps/01-install.sh index 39fe3e4a..231c3798 100755 --- a/steps/01-install.sh +++ b/steps/01-install.sh @@ -49,6 +49,16 @@ case "$TARGET_OS" in MUSL_VERSION="x86_64-linux-musl-cross" PACKAGES="g++-10" ;; + + arm) + MUSL_VERSION="arm-linux-musleabihf-cross" + PACKAGES="g++-10" + ;; + + arm64) + MUSL_VERSION="aarch64-linux-musl-cross" + PACKAGES="g++-10" + ;; esac [ -d "$MUSL_VERSION" ] || curl -L "$MUSL_URL/$MUSL_VERSION.tgz" | tar xz diff --git a/steps/08-test.sh b/steps/08-test.sh index d966cdc0..700b8ec7 100755 --- a/steps/08-test.sh +++ b/steps/08-test.sh @@ -56,12 +56,20 @@ case "$OS" in linux) case "$CPU" in arm) - PREFIX="arm-linux-gnueabihf-" - SUFFIX="-10" + if [ "$TARGET_LIBC" == "musl" ]; then + PREFIX="arm-linux-musleabihf-" + else + PREFIX="arm-linux-gnueabihf-" + SUFFIX="-10" + fi ;; arm64) - PREFIX="aarch64-linux-gnu-" - SUFFIX="-10" + if [ "$TARGET_LIBC" == "musl" ]; then + PREFIX="aarch64-linux-musl-" + else + PREFIX="aarch64-linux-gnu-" + SUFFIX="-10" + fi ;; x86) if [ "$TARGET_LIBC" == "musl" ]; then