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}
This commit is contained in:
parent
ce08cb6803
commit
3ff178eb32
|
@ -103,7 +103,7 @@ def cpu_emulation_required(arch):
|
|||
not_required = {
|
||||
"x86_64": ["x86"],
|
||||
"armv7": ["armel", "armhf"],
|
||||
"aarch64": ["armel", "armhf", "armv7"],
|
||||
"aarch64": ["armv7"],
|
||||
}
|
||||
if pmb.config.arch_native in not_required:
|
||||
if arch in not_required[pmb.config.arch_native]:
|
||||
|
|
Loading…
Reference in New Issue