pmbootstrap/pmb/parse
Clayton Craft 3ff178eb32
pmb.parse.arch: use qemu for running armhf on aarch64 (MR 2285)
This works around an issue where some armhf apps are compiled with
instructions that are not compatible with aarch64, for example apk uses
MCR, and that does not exist on aarch64 causing apk to fail in a chroot
with SIGILL. It's impossible to build armhf images on aarch64 hosts, and
this also fixes a crash when running `pmbootstrap zap -a`, since pmb zap
will init an armhf chroot and blow up with apk generates a SIGILL.

For reference, here's how I arrived at the conclusion that apk (and gdb,
and probably others...) are executing invalid instructions on aarch64
when not using binfmt+qemu emulation:

$ uname -m
aarch64

$ file sbin/apk.static
sbin/apk.static: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, BuildID[sha1]=997a8ef97b17cb4951a6220b7807a66fed67bc10, stripped

$ gdb sbin/apk.static
(gdb) r
Starting program: /run/user/10000/foo/sbin/apk.static
Program received signal SIGILL, Illegal instruction.
0x0012843c in ?? ()
(gdb) x /1i $pc
=> 0x12843c:    mcr     15, 0, r0, cr7, cr10, {5}
2024-03-30 00:03:56 +00:00
..
__init__.py parse/init: allow importing arguments_install and arguments_flasher 2023-11-01 20:40:11 +01:00
_apkbuild.py pmb.parse._apkbuild: Fix subpackages with set arch but no custom function (MR 2267) 2024-02-26 20:55:49 +01:00
apkindex.py pmb.helpers.pmaports.get: deal with operators 2023-11-29 22:31:11 +01:00
arch.py pmb.parse.arch: use qemu for running armhf on aarch64 (MR 2285) 2024-03-30 00:03:56 +00:00
arguments.py pmb.sideload: Query architecture from foreign device (MR 2282) 2024-03-28 11:03:25 +01:00
binfmt_info.py Bump copyright to 2023 2023-01-22 19:18:06 +01:00
bootimg.py pmb.parse.bootimg: implement detection of QCDT types (MR 2276) 2024-03-17 18:45:51 +00:00
cpuinfo.py Bump copyright to 2023 2023-01-22 19:18:06 +01:00
depends.py parse.depends: consider selected providers when resolving providers 2023-11-26 11:01:35 +01:00
deviceinfo.py deviceinfo: make parse_kernel_suffix private 2023-07-21 08:54:10 +02:00
kconfig.py pmb.parse.kconfig: Raise NonBugError on invalid kernel config (MR 2279) 2024-03-27 21:50:28 +01:00
version.py Bump copyright to 2023 2023-01-22 19:18:06 +01:00