diff --git a/src/runtime/eng/common/cross/toolchain.cmake b/src/runtime/eng/common/cross/toolchain.cmake index 3210865c221..56b6c1fd143 100644 --- a/src/runtime/eng/common/cross/toolchain.cmake +++ b/src/runtime/eng/common/cross/toolchain.cmake @@ -69,7 +69,11 @@ elseif(TARGET_ARCH_NAME STREQUAL "armv6") endif() elseif(TARGET_ARCH_NAME STREQUAL "loongarch64") set(CMAKE_SYSTEM_PROCESSOR loongarch64) - set(TOOLCHAIN "loongarch64-linux-gnu") + if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/loongarch64-alpine-linux-musl) + set(TOOLCHAIN "loongarch64-alpine-linux-musl") + else() + set(TOOLCHAIN "loongarch64-linux-gnu") + endif() elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") set(CMAKE_SYSTEM_PROCESSOR ppc64le) if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/powerpc64le-alpine-linux-musl) diff --git a/src/runtime/eng/native/tryrun.cmake b/src/runtime/eng/native/tryrun.cmake index c0fe823dd78..01c8bd6ae6c 100644 --- a/src/runtime/eng/native/tryrun.cmake +++ b/src/runtime/eng/native/tryrun.cmake @@ -28,7 +28,8 @@ if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/ppc64le-alpine-linux-musl OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/i586-alpine-linux-musl OR EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/x86_64-alpine-linux-musl OR - EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl) + EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/riscv64-alpine-linux-musl OR + EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/loongarch64-alpine-linux-musl) set(ALPINE_LINUX 1) elseif(EXISTS ${CROSS_ROOTFS}/bin/freebsd-version)