Open smcv opened 2 months ago
For native builds and the build architecture, detect_cpu_family()
has a special case that normalizes powerpc64*
and ppc64*
to ppc64
, but detect_cpu()
does not have a matching special case, resulting in this inconsistency.
For cross-builds, env2mfile
seems to be trying to map powerpc64le
to ppc64
in its lookup tables for both cpu_family()
and cpu()
, but this is ineffective, because the key that is used for the lookup for cpu()
is a Debian architecture name (amd64
, ppc64el
) and not a GNU CPU name (x86_64
, powerpc64le
). For amd64, this is fixed by #13722, which has the side-effect of changing the cpu()
for ppc64el
to ppc64
, matching the cpu_family()
.
The downstream debcrossgen
tool written by @jpakkane is currently used in Debian for cross-compiling (with the goal of having meson env2mfile
replace it), and it similarly appears to be trying to map powerpc64le
to ppc64
, but similarly this is ineffective because powerpc64le
is not the key that is looked up.
I think this maybe means that ppc64
would be the correct answer?
Describe the bug On Debian ppc64el (64-bit PowerPC little-endian), Meson detects the
host_machine.cpu()
to beppc64le
during native builds, butmeson env2mfile
saysppc64el
instead.Which of these should it ideally be?
ppc64
, matching thecpu_family()
and disregarding the endianness;ppc64le
, matching a typical Linuxuname -m
output on these machines;ppc64el
, matching the Debian architecture name (probably not this one)For completeness, GNU tools call this architecture
powerpc64le-linux-gnu
.To Reproduce For a native build: https://buildd.debian.org/status/package.php?p=libglvnd is a convenient example of a package that logs the
cpu()
andcpu_family()
duringmeson setup
.For a cross-build: source code inspection, or run the unit test that I'm going to propose as a PR, or install ppc64el cross-compilers and run
meson env2mfile
(a precise reproducer is left as an exercise to the reader).Expected behavior If I do a native build and a cross-build, both with
ppc64el
as the host architecture, they should agree on the name of the CPU.system parameters
meson --version
? 1.5.2 or git masterninja --version
? irrelevant