Unverified Commit e0801cae authored by Amaan Qureshi's avatar Amaan Qureshi
Browse files

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.
parent 65feaa4c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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