Add initial support for loongarch64
Context
Add support for new architecture: loongarch64
LoongArch is a new instruction set of Loongson 3A5000 CPU, you can read the documents or visit the development community to get more information.
Some projects like Debian and Golang use loong64 as the architecture ID. But I think the Flatpak ecological environment prefers the same one with uname -m.
At this moment, with respect to the minimal VM target, only libseccomp, gnu-efi and systemd need patches or separate branches.
Description
Merge requests for different projects:
-
freedesktop-sdk !11528 (merged) !11527 (merged) !11526 (merged) !11525 (merged) !11513 (merged) !11559 (merged) !11510 (merged) -
freedesktop-sdk-docker-images freedesktop-sdk/infrastructure/freedesktop-sdk-docker-images!382 (closed) -
bazelbuild/remote-apis -
Buildstream -
buildbox-common -
arch-test -
Initial support https://github.com/kilobyte/arch-test/pull/5 -
Support f64fabi suffix https://github.com/kilobyte/arch-test/pull/7
-
Acceptance Criteria
-
Minimal VM is built.
How to build it on an x86_64 system
- Setup loongarch64 binfmt with qemu-user version 7.2
- Apply the patch for arch-test and build the
loong64target with a cross toolchain on your host. Or just make a fakearch-testcommand in your$PATHthat prints the stringloong64. - Apply the patch for buildbox-common and re-build buildbox-common and buildbox-run-bubblewrap.
- Checkout the branch of freedesktop-sdk MR
- Apply the patch for Buildstream
- Run to build:
bst -o target_arch loongarch64 build vm/minimal/efi.bst
How to boot the VM on an x86_64 system
- Prepare
qemu-system-loongarch64version 7.2 - Get the firmware edk2-loongarch64-code.fd
- Checkout disk.img from
vm/minimal/efi.bst - Run it:
qemu-system-loongarch64 -m 4G -smp 2 --cpu la464 --machine virt -bios ./edk2-loongarch64-code.fd --nographic -drive file=./disk.img,format=raw
Edited by Jürg Billeter