Skip to content
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

[DNM] build loong64 #153

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ jobs:
name: Test mainline
if: matrix.target == 'mainline'
run: |
docker run --rm --privileged tonistiigi/binfmt:test --uninstall amd64,arm64,arm,ppc64le,s390x,riscv64
docker run --rm --privileged tonistiigi/binfmt:test --uninstall amd64,arm64,arm,ppc64le,s390x,riscv64,loongarch64
docker run --rm --privileged tonistiigi/binfmt:test --install all
docker run --rm arm64v8/alpine uname -a
docker run --rm arm32v7/alpine uname -a
docker run --rm ppc64le/alpine uname -a
docker run --rm s390x/alpine uname -a
docker run --rm tonistiigi/debian:riscv uname -a
docker run --rm yangzewei2023/debian:loongarch64 uname -a
docker run --rm --platform=linux/s390x s390x/ubuntu apt update
docker run --rm --platform=linux/ppc64le ppc64le/ubuntu apt update
docker run --rm --platform=linux/arm64 arm64v8/ubuntu apt update
Expand Down
5 changes: 5 additions & 0 deletions cmd/binfmt/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ var configs = map[string]config{
magic: `\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08`,
mask: `\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff`,
},
"loongarch64": {
binary: "qemu-loongarch64",
magic: `\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01`,
mask: `\xff\xff\xff\xff\xff\xff\xff\xfc\x00\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff`,
},
}

func allArch() []string {
Expand Down
1 change: 1 addition & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ target "all-arch" {
"linux/s390x",
"linux/riscv64",
"linux/386",
"linux/loong64",
]
}

Expand Down
9 changes: 9 additions & 0 deletions hack/install-and-test
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,31 @@ echo $status | jq .supported | grep linux/riscv64
echo $status | jq .supported | grep linux/ppc64le
echo $status | jq .supported | grep linux/386

# TODO: needs https://github.com/moby/buildkit/pull/4392
#echo $status | jq .supported | grep linux/loong64

echo $status | jq .emulators | grep qemu-riscv64
echo $status | jq .emulators | grep qemu-arm
echo $status | jq .emulators | grep qemu-loongarch64

docker run --rm arm64v8/alpine uname -a
docker run --rm arm32v7/alpine uname -a
docker run --rm ppc64le/alpine uname -a
docker run --rm s390x/alpine uname -a
docker run --rm i386/alpine uname -a
docker run --rm tonistiigi/debian:riscv uname -a
docker run --rm yangzewei2023/debian:loongarch64 uname -a

if [ "$(uname -m)" != "x86_64" ]; then exit 0; fi

status=$(docker run --rm --privileged tonistiigi/binfmt:${TAG:-test} --uninstall aarch64,riscv64)

if echo $status | jq .supported | grep linux/arm64; then exit 1; fi
if echo $status | jq .supported | grep linux/riscv64; then exit 1; fi

# TODO: needs https://github.com/moby/buildkit/pull/4392
#if echo $status | jq .supported | grep linux/loong64; then exit 1; fi

echo $status | jq .supported | grep linux/ppc64le
echo $status | jq .supported | grep linux/arm/v7

Expand Down
3 changes: 3 additions & 0 deletions scripts/configure_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ if [ -z "$QEMU_TARGETS" ]; then
if [ "$arch" != "mips64" ] ; then
QEMU_TARGETS="$QEMU_TARGETS mips64-linux-user"
fi
if [ "$arch" != "loong64" ] ; then
QEMU_TARGETS="$QEMU_TARGETS loongarch64-linux-user"
fi
fi

set -x
Expand Down
Loading