From c9fb14a1e82fcb883725f03fd8fe4cefde2e0403 Mon Sep 17 00:00:00 2001 From: yzewei Date: Mon, 29 Jan 2024 16:46:53 +0800 Subject: [PATCH] del alpine in loongarch64 Signed-off-by: yzewei --- src/test-cargo.bats | 13 +++++++++++-- src/test-clang.bats | 2 +- src/test-go.bats | 6 +----- src/test-info-alpine.bats | 5 ----- src/test-info-debian.bats | 2 +- src/test_helper.bash | 2 ++ src/xx-apk | 6 ------ src/xx-apt | 2 +- src/xx-cargo | 8 ++++---- src/xx-info | 2 +- 10 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/test-cargo.bats b/src/test-cargo.bats index 24f8587..996fe33 100755 --- a/src/test-cargo.bats +++ b/src/test-cargo.bats @@ -92,7 +92,11 @@ testHelloCargoRustup() { } @test "loong64-hellocargo-rustup" { - skip "LOONG64 not supported" # rust stdlib package not available + if ! supportLoongArch; then + skip "LOONGARCH64 not supported" # rust stdlib package not available + fi + export TARGETARCH=loongarch64 + testHelloCargoRustup } @test "386-hellocargo-rustup" { @@ -148,7 +152,12 @@ testHelloCargoRustup() { } @test "loong64-hellocargo-rustpkg" { - skip "LOONG64 not supported" # rust stdlib package not available + if ! supportLoongArch; then + skip "LOONGARCH64 not supported" # rust stdlib package not available + fi + export TARGETARCH=loongarch64 + export LOONG64_TARGET_ARCH=loongarch64 + testHelloCargo } @test "386-hellocargo-rustpkg" { diff --git a/src/test-clang.bats b/src/test-clang.bats index 95aefec..289fda7 100755 --- a/src/test-clang.bats +++ b/src/test-clang.bats @@ -14,7 +14,7 @@ clean() { testHelloCLLD() { clean - add clang binutils lld + add clang lld xxadd xx-c-essentials run sh -c 'xx-clang --print-target-triple | sed s/unknown-// | sed s/pc-//' assert_success diff --git a/src/test-go.bats b/src/test-go.bats index 177f2e7..0a1f413 100755 --- a/src/test-go.bats +++ b/src/test-go.bats @@ -9,11 +9,7 @@ ensureGo() { else add golang fi - if [ "$(xx-info arch)" = "loong64" ]; then - add clang binutils - else - add clang lld - fi + add clang lld } setup_file() { diff --git a/src/test-info-alpine.bats b/src/test-info-alpine.bats index dea7d57..b01b6c7 100755 --- a/src/test-info-alpine.bats +++ b/src/test-info-alpine.bats @@ -74,11 +74,6 @@ load 'assert' assert_equal "riscv64" "$(TARGETPLATFORM=linux/riscv64 RISCV64_TARGET_ARCH=riscv64gc xx-info pkg-arch)" # does not change } -@test "loong64" { - assert_equal "loong64-alpine-linux-muslabi" "$(TARGETPLATFORM=linux/loong64 xx-info triple)" - assert_equal "loongarch64" "$(TARGETPLATFORM=linux/loong64 xx-info pkg-arch)" -} - @test "custom-vendor" { assert_equal "riscv64-unknown-linux-musl" "$(TARGETPLATFORM=linux/riscv64 XX_VENDOR=unknown xx-info triple)" } diff --git a/src/test-info-debian.bats b/src/test-info-debian.bats index b626436..124e554 100755 --- a/src/test-info-debian.bats +++ b/src/test-info-debian.bats @@ -78,7 +78,7 @@ fi } @test "loong64" { - assert_equal "loong64-linux-gnuabi" "$(TARGETPLATFORM=linux/loong64 xx-info triple)" + assert_equal "loong64-linux-gnu" "$(TARGETPLATFORM=linux/loong64 xx-info triple)" assert_equal "loong64" "$(TARGETPLATFORM=linux/loong64 xx-info pkg-arch)" } diff --git a/src/test_helper.bash b/src/test_helper.bash index 19921a7..c607122 100644 --- a/src/test_helper.bash +++ b/src/test_helper.bash @@ -102,6 +102,8 @@ supportLoongArch() { else return 1 fi + elif [ -f /etc/alpine-release ]; then + return 1 fi return 0 } diff --git a/src/xx-apk b/src/xx-apk index fae5dee..df04062 100755 --- a/src/xx-apk +++ b/src/xx-apk @@ -51,12 +51,6 @@ setup() { echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >"$apk_dir/repositories" echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >>"$apk_dir/repositories" fi - # add loongarch support - if [ "$TARGETARCH" = "loong64" ]; then - echo "http://alpine.loongnix.cn/v3.11/main" >"$apk_dir/repositories" - echo "http://alpine.loongnix.cn/v3.11/community" >>"$apk_dir/repositories" - echo "http://alpine.loongnix.cn/v3.11/testing" >>"$apk_dir/repositories" - fi mkdir "$apk_dir/keys" mkdir "$apk_dir/protected_paths.d" echo "$XX_PKG_ARCH" >"$apk_dir/arch" diff --git a/src/xx-apt b/src/xx-apt index 6e8a2f7..3186abf 100755 --- a/src/xx-apt +++ b/src/xx-apt @@ -168,7 +168,7 @@ if [ "$TARGETARCH" = "loong64" ] && [ "$(xx-info vendor)" = "debian" ]; then apt-get update apt-get install -y debian-ports-archive-keyring echo "deb [ arch=loong64 ] http://ftp.ports.debian.org/debian-ports sid main - deb [ arch=loong64 ] http://ftp.ports.debian.org/debian-ports unreleased main" >>/etc/apt/sources.list.d/loong64-sid.list + deb [ arch=loong64 ] http://ftp.ports.debian.org/debian-ports unreleased main" >>/etc/apt/sources.list.d/loong64-sid.list fi if ! dpkg --print-foreign-architectures | grep "$XX_PKG_ARCH" >/dev/null; then diff --git a/src/xx-cargo b/src/xx-cargo index 7e869c1..849029f 100755 --- a/src/xx-cargo +++ b/src/xx-cargo @@ -79,12 +79,12 @@ if [ -n "$XX_RUSTFLAGS" ]; then fi export "CC_$(xx-info | tr - _)=$(xx-info)-clang" -if which "qemu-$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONG64_TARGET_ARCH='' xx-info march)" >/dev/null 2>&1; then - export "CARGO_TARGET_$(xx-info | tr '[:lower:]' '[:upper:]' | tr - _)_RUNNER=qemu-$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONG64_TARGET_ARCH='' xx-info march)" +if which "qemu-$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONGARCH64_TARGET_ARCH='' xx-info march)" >/dev/null 2>&1; then + export "CARGO_TARGET_$(xx-info | tr '[:lower:]' '[:upper:]' | tr - _)_RUNNER=qemu-$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONGARCH64_TARGET_ARCH='' xx-info march)" if [ -f /etc/alpine-release ]; then - export "QEMU_LD_PREFIX=/$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONG64_TARGET_ARCH='' xx-info)/" + export "QEMU_LD_PREFIX=/$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONGARCH64_TARGET_ARCH='' xx-info)/" else - export "QEMU_LD_PREFIX=/lib/$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONG64_TARGET_ARCH='' XX_VENDOR='' xx-info)/" + export "QEMU_LD_PREFIX=/lib/$(RISCV64_TARGET_ARCH='' ARM_TARGET_ARCH='' LOONGARCH64_TARGET_ARCH='' XX_VENDOR='' xx-info)/" fi fi diff --git a/src/xx-info b/src/xx-info index 0c85f31..627e8af 100755 --- a/src/xx-info +++ b/src/xx-info @@ -345,7 +345,7 @@ case "$TARGETARCH" in XX_DEBIAN_ARCH="loong64" XX_ALPINE_ARCH="loongarch64" XX_RHEL_ARCH="loong64" - XX_TRIPLE="loong64${vendor}-linux-${XX_LIBC}abi" + XX_TRIPLE="loong64${vendor}-linux-${XX_LIBC}" ;; esac