You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The typical way to target 64 bits on AIX is to set CC to something like gcc -maix64. However that causes anything trying to run binaries to fail with "ERROR: Can not run test applications in this cross environment.".
Repro:
project('repro', 'c')
cc =meson.get_compiler('c')
cc.sizeof('void *')
rm -rf build/ && CC='gcc -maix64' m setup build
The Meson build system
Version: 0.63.99
Source dir: /home/andres/repro
Build dir: /home/andres/repro/build
Build type: native build
Project name: repro
Project version: undefined
C compiler for the host machine: gcc -maix64 (gcc 7.2.0 "gcc (GCC) 7.2.0")
C linker for the host machine: gcc -maix64 ld.aix 7.2.4
Host machine cpu family: ppc64
Host machine cpu: powerpc
meson.build:5:3: ERROR: Can not run test applications in this cross environment.
This can be worked around, by specifying -maix64 via CFLAGS:
The Meson build system
Version: 0.63.99
Source dir: /home/andres/repro
Build dir: /home/andres/repro/build
Build type: native build
Project name: repro
Project version: undefined
C compiler for the host machine: gcc (gcc 7.2.0 "gcc (GCC) 7.2.0")
C linker for the host machine: gcc ld.aix 7.2.4
Host machine cpu family: ppc
Host machine cpu: powerpc
Checking for size of "void *" : 8
Build targets in project: 0
Note the difference in "Host machine cpu family". With the CFLAGS approach it is wrong, which avoids the error above, but obviously isn't good either.
The cause of the failure is that machine_info_can_run() determines the native cpu family without the compiler:
ISTM that detect_cpu_family() needs to correctly determine the CPU independent of the compiler. Unfortunately python does not natively provide a way for that. The documented way to get the effective bitness of the hardware is getconf HARDWARE_BITMODE.
Note that the cpu is wrong in both cases, but that's an issue for another day.
I can open a PR to call getconf HARDWARE_BITMODE. But it seems that the result should be cached somewhere - but I am not sure where?
Regards,
Andres
The text was updated successfully, but these errors were encountered:
Hi,
The typical way to target 64 bits on AIX is to set
CC
to something likegcc -maix64
. However that causes anything trying to run binaries to fail with "ERROR: Can not run test applications in this cross environment.".Repro:
This can be worked around, by specifying
-maix64
viaCFLAGS
:Note the difference in "Host machine cpu family". With the
CFLAGS
approach it is wrong, which avoids the error above, but obviously isn't good either.The cause of the failure is that machine_info_can_run() determines the native cpu family without the compiler:
meson/mesonbuild/environment.py
Lines 429 to 438 in e574eba
which in turn prevents meson from detecting ppc64:
meson/mesonbuild/environment.py
Lines 352 to 355 in e574eba
ISTM that
detect_cpu_family()
needs to correctly determine the CPU independent of the compiler. Unfortunately python does not natively provide a way for that. The documented way to get the effective bitness of the hardware isgetconf HARDWARE_BITMODE
.Note that the cpu is wrong in both cases, but that's an issue for another day.
I can open a PR to call
getconf HARDWARE_BITMODE
. But it seems that the result should be cached somewhere - but I am not sure where?Regards,
Andres
The text was updated successfully, but these errors were encountered: