meson
meson copied to clipboard
Regression: No build machine compiler for xx with meson 0.64.1 on osx
Describe the bug
Error:
../src/v1.0.12-5d4a52388f.clean/gen.tab/meson.build:37:0: ERROR: No build machine compiler for 'gen.tab/gen-unicode-version.c'
Native File: meson-x64-osx-dbg.log
Config File: config-x64-osx-dbg-out.log config-x64-osx-dbg-meson-log.txt.log
Expected behavior Meson finds the specified compiler as the build system compiler
system parameters VCPKG CI; All worked fine with meson 063.0; Other platforms than OSX also works fine.
Your C compiler for build machine failed sanity checks:
Sanity check compile stderr:
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-----
Compiler for language c for the build machine not found.
The build machine compiler is optional by default when cross compiling, if you want to make it required, I think you need add_languages('c', native: true)
.
Your C compiler for build machine failed sanity checks:
Yeah because it is ignoring the required c_args
Also this is not a cross build but native build with compiler settings extracted from a cmake and fed into meson. So where is the code for the sanity check so that I can feed it c_args
Can you try setting build.c_args
option instead, I'm wondering if using a native file confuses Meson.
Can you try setting build.c_args option instead, I'm wondering if using a native file confuses Meson.
doesn't make a difference.
-isysroot, -m32/-m64 and similar options that affect the multilib search path must be specified directly in the c
, c_ld
, cpp
and cpp_ld
variables.
I agree that this should be documented better.
-isysroot, -m32/-m64 and similar options that affect the multilib search path must be specified directly in the c, c_ld, cpp and cpp_ld variables.
Why? Checking just the compiler is invalid. The check must always contain the required c_args
and c_link_args
because otherwise the sanity checks is in itself not correct and has no value. No buildsystem I know of does the check like that and there is a good reason for it. The combination of compiler+flags needs to be checked for correctnest and not just the compiler.
@bonzini Really? See e.g. https://github.com/mesonbuild/meson/blob/master/cross/iphone.txt.
Cool you found a bug.
https://github.com/picolibc/picolibc/pull/263 shows why using c_args for -sysroot is a bad idea independent of the problem you are reporting (which may still be worth fixing, mind—but you have a problem anyway in your native file):
it's expected to contain reasonable defaults for something that the user may choose to adjust on the command line, not settings which are required to make the compiler do anything useful at all.