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

add support for loongarch64 #151

Merged
merged 1 commit into from
Feb 9, 2024
Merged
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
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