From e0801cae7661a607c92991426402603b7cef47a0 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Mon, 16 Mar 2026 23:27:14 -0400 Subject: [PATCH] lib/systems: fix `qemuArch` for `aarch64_be` `qemuArch` returned "aarch64" for both LE and BE, causing binfmt to register `qemu-aarch64` for `aarch64_be` binaries. QEMU ships separate `qemu-aarch64` and `qemu-aarch64_be` binaries, so the wrong interpreter was used, failing with "Invalid ELF image for this architecture". Since QEMU distinguishes endianness in the binary name, this adds the "_be" suffix via `isBigEndian`, which is similar to the approach MIPS uses a few lines below. --- lib/systems/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index b4f6c13feafa..5de640da8697 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -319,7 +319,7 @@ let if final.isAarch32 then "arm" else if final.isAarch64 then - "aarch64" + "aarch64${optionalString final.isBigEndian "_be"}" else if final.isS390 && !final.isS390x then null else if final.isx86_64 then