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

extra/qemu: to make qemu installable for aarch64 #1959

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adam900710
Copy link

Currently qemu package group has its problems, making it almost impossible to run libvirt with qemu:

  • qemu-user-static build will fail using native tool chain This will prevent the whole package, including qemu-system-* which can compile without any problem.

  • qemu-base and qemu-desktop depends on qemu-system-x86 Which makes completely no sense. This is something from the Archlinux PKGBUILD.

  • No way to install qemu-system-aarch64 As it has hard dependency on edk2-armvirt, which is not buildable yet natively on aarch64 (missing arm toolchain AFAIK).

This update will solve the problems by:

  • Split qemu-user-static into its own PKGBUILD Qemu-user-statis has a completely different use-case compared to system emulators. The most common usage is allowing the host to chroot into rootfs for another arch.

    Thus it is not suitable to contain qemu-user-static into qemu package. There is already a feature request to upstream Archlinux: https://bugs.archlinux.org/task/76556

  • Make qemu-base and qemu-desktop to change its default system emulator dependecy Now the PKGBUILD will choose the default system emulator depending on the target arch.

  • Make edk2-armvirt as optional dependency In fact we can directly install the same package from upstream Archlinux, as that package is just the edk2 uefi firmware, which is arch independent.

Have tested qemu PKGBUILD natively on both x86_64 and aarch64, and resulted qemu can work with libvirt using KVM.

Signed-off-by: Qu Wenruo [email protected]

Currently qemu package group has its problems, making it almost
impossible to run libvirt with qemu:

- qemu-user-static build will fail using native tool chain
  This will prevent the whole package, including qemu-system-* which
  can compile without any problem.

- qemu-base and qemu-desktop depends on qemu-system-x86
  Which makes completely no sense.
  This is something from the Archlinux PKGBUILD.

- No way to install qemu-system-aarch64
  As it has hard dependency on edk2-armvirt, which is not buildable
  yet natively on aarch64 (missing arm toolchain AFAIK).

This update will solve the problems by:

- Split qemu-user-static into its own PKGBUILD
  Qemu-user-statis has a completely different use-case compared to
  system emulators.
  The most common usage is allowing the host to chroot into rootfs
  for another arch.

  Thus it is not suitable to contain qemu-user-static into qemu package.
  There is already a feature request to upstream Archlinux:
  https://bugs.archlinux.org/task/76556

- Make qemu-base and qemu-desktop to change its default system emulator
  dependecy
  Now the PKGBUILD will choose the default system emulator depending on
  the target arch.

- Make edk2-armvirt as optional dependency
  In fact we can directly install the same package from upstream
  Archlinux, as that package is just the edk2 uefi firmware, which
  is arch independent.

Have tested qemu PKGBUILD natively on both x86_64 and aarch64, and
resulted qemu can work with libvirt using KVM.

Signed-off-by: Qu Wenruo <[email protected]>
@Rippanda12
Copy link

Rippanda12 commented Nov 24, 2022

does not compile qemu-user-static
/usr/bin/ld: (.text+0x10): warning: too many GOT entries for -fpic, please recompile with -fPIC
EDIT: How are you ment to compile the static package for arm if the native toolchain doesnt work?

@adam900710
Copy link
Author

@Rippanda12 Static build failure is the reason to split that package out.
No matter if using the old or the new PKLGBUILD. What I do here is to make the qemu-system-* work as the primary objective.

And I have already mentioned, Have tested qemu PKGBUILD natively on both x86_64 and aarch64, that only means the PKGBUILD for qemu, not qemu-user-static.

I only care about the qemu-system-* for now.

Feel free if you can fix the static part.

@adam900710
Copy link
Author

adam900710 commented Nov 25, 2022

Another thing is, there isn't much usage for qemu-user-static on aarch64 AFAIK.

Firstly, qemu-user-static is only better than qemu-user if you're chrooting into a rootfs of another arch.

While under most cases, aarch64 is the weaker target, thus we want qemu-user-static on a stronger host (mostly x86_64).

The only exception is Apple M1, where Asahi Linux users may want qemu-user-static to chroot into x86_64 world.
(Or some fancy server grade hardware, which is not that easily accessible for regular guys)

@adam900710
Copy link
Author

For the static build failure, it's in fact the problem of the glibc package.
https://gitlab.com/qemu-project/qemu/-/issues/1340#note_1186317121

In fact the newer glibc should be compiled with -fPIC now, which means ArchlinuxARM should also update its glibc first.

@Strit
Copy link
Contributor

Strit commented Jan 24, 2023

Seems some of these changes where added recently:

91c6b8c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants