3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/lib/systems
Adam Joseph de88969f12 lib/systems: fix uname.processor for powerpc{32,64}, mips64
Cross-compilation of anything downstream of gtk3 requires qemu (due to
gobject-introspection) with --target-list=*-linux-user.  Without this commit,
those qemu builds will fail on a powerpc64le host due to qemu being configured
with --cpu=powerpc64le instead of --cpu=ppc64le.  Unfortunately the build
failure message from qemu in this situation is extremely cryptic.

The root cause turns out not to be the qemu expression, but rather the fact that
on powerpc64le hostPlatform.uname.processor returns the gnu-name (powerpc64le)
for the cpu instead of the linux-name (ppc64le) for the cpu.

uname.processor on mips64el also needs adjustment -- the Linux-name is "mips64"
for both big and little endian (unlike powerpc64, where the Linux-name includes
a "le" suffix):

```
nix@oak:/tmp$ uname -m; lscpu | head -n2
mips64
Architecture:        mips64
Byte Order:          Little Endian
```

uname.processor on powerpc32 has also been adjusted.
2023-01-01 16:20:50 -08:00
..
architectures.nix lib: fix typos 2022-12-17 18:59:29 -05:00
default.nix lib/systems: fix uname.processor for powerpc{32,64}, mips64 2023-01-01 16:20:50 -08:00
doubles.nix
examples.nix
flake-systems.nix lib: fix typos 2022-12-17 18:59:29 -05:00
inspect.nix
parse.nix lib/systems/parse.nix: mkSkeletonFromList: improve readability 2022-11-13 23:08:57 -08:00
platforms.nix Merge pull request #170737 from amjoseph-nixpkgs/fix-mips32-detection 2022-11-21 19:40:18 +02:00