Skip to content

Commit

Permalink
del alpine in loongarch64
Browse files Browse the repository at this point in the history
Signed-off-by: yzewei <[email protected]>
  • Loading branch information
yzewei committed Feb 18, 2024
1 parent 52e6955 commit bbd731b
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 26 deletions.
13 changes: 11 additions & 2 deletions src/test-cargo.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion src/test-clang.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions src/test-go.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 0 additions & 5 deletions src/test-info-alpine.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
Expand Down
2 changes: 1 addition & 1 deletion src/test-info-debian.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}

Expand Down
3 changes: 3 additions & 0 deletions src/test_helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ supportLoongArch() {
return 1
fi
fi
if [ -f /etc/alpine-release ]; then
return 1
fi
return 0
}

Expand Down
6 changes: 0 additions & 6 deletions src/xx-apk
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/xx-apt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/xx-cargo
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/xx-info
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bbd731b

Please sign in to comment.