-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/systems: fix uname.processor for powerpc and mips64 #189967
Conversation
I originally opened this PR before #189958 merged. Now that that PR has merged, the motivation for this PR is much simpler: it makes
|
mips64el needs an analogous fix, so I've pushed 4383fe1b772f138a09b3ce09999335fbee7269aa onto this PR instead of opening a separate one in order to avoid creating a merge conflict with myself. Without 4383fe1b772f138a09b3ce09999335fbee7269aa, the qemu builds needed for cross-compiling to mips64el will fail. With it, they succeed. |
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.
Description of changes
Cross-compilation of anything downstream of gtk3 requires qemu (due to gobject-introspection); qemu is built with
--target-list=*-linux-user
. Without this commit, those qemu builds will fail on a powerpc64le buildPlatform 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.Things done
./result/bin/
)