hacke the common code to get loongarch64 support

This commit is contained in:
exkc 2022-08-05 01:38:59 +08:00
parent 06cb1739d3
commit b8c44c2a22
1 changed files with 10 additions and 1 deletions

View File

@ -741,6 +741,7 @@ i386
i486
i586
i686
loongarch64
x86_64
EOF
}
@ -766,6 +767,7 @@ standardize_architecture() {
ppc64el | ppc64le | powerpc64el | powerpc64le) echo "ppc64le" ;;
s390x) echo "s390x" ;;
amd64 | x86_64) echo "x86_64" ;;
loongarch64) echo "loongarch64" ;;
esac
}
@ -792,7 +794,8 @@ check_arch_supported_natively() {
armv7hl:armv7l) return ;;
# Not technically true, but binfmt does not differentiate
armv7l:armv7hl) return ;;
ppc64:ppc) return ;;
loongarch64:loongarch64) return ;;
ppc64le:ppc) return ;;
ppc64le:ppc) return ;;
x86_64:i386) return ;;
x86_64:i486) return ;;
@ -820,6 +823,7 @@ qemu_binary_for_arch() {
ppc64le) echo "qemu-ppc64le-static" ;;
s390x) echo "qemu-s390x-static" ;;
x86_64) echo "qemu-x86_64-static" ;;
loongarch64) echo "qemu-loongarch64-static" ;;
esac
}
@ -910,6 +914,11 @@ setup_binfmt_misc() {
sum="823c58bdb19743335c68d036fdc795e3be57e243"
reg=':qemu-x86_64:M:0:\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-x86_64-static:OC'
;;
loongarch64)
name="qemu-loongarch64"
sum="823c58bdb19743335c68d036fdc795e3be57e243"
reg=':qemu-loongarch64-static:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x01:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-loongarch64-static:'
;;
*)
abort "Stratum \"${stratum}\" has unrecognized arch ${arch}"
;;