1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

meson: Correctly handle endianness for PowerPC CPU families

I've missed this while reviewing 6db6190002.
I only built big endian ppc64, so that didn't occur to me.

From meson manual:

> Those porting from autotools should note that Meson does not add
> endianness to the name of the cpu_family. For example, autotools will
> call little endian PPC64 "ppc64le", Meson will not, you must also check
> the .endian() value of the machine for this information.

This code should handle that correctly.
This commit is contained in:
Sergei Zimmerman 2025-07-22 03:27:27 +03:00
parent e2b0ff18f8
commit ebd311b7b7
No known key found for this signature in database

View file

@ -1,9 +1,10 @@
nix_system_cpu = { powerpc_system_cpus = [ 'ppc64', 'ppc' ]
'ppc64' : 'powerpc64',
'ppc64le' : 'powerpc64le', nix_system_cpu = {'ppc64' : 'powerpc64', 'ppc' : 'powerpc'}.get(
'ppc' : 'powerpc',
'ppcle' : 'powerpcle',
}.get(
host_machine.cpu_family(), host_machine.cpu_family(),
host_machine.cpu_family(), host_machine.cpu_family(),
) )
if powerpc_system_cpus.contains(host_machine.cpu_family()) and host_machine.endian() == 'little'
nix_system_cpu += 'le'
endif