meson icon indicating copy to clipboard operation
meson copied to clipboard

Regression: No build machine compiler for xx with meson 0.64.1 on osx

Open Neumann-A opened this issue 2 years ago • 4 comments

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.

Neumann-A avatar Dec 06 '22 10:12 Neumann-A

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).

xclaesse avatar Dec 06 '22 18:12 xclaesse

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

Neumann-A avatar Dec 06 '22 19:12 Neumann-A

Can you try setting build.c_args option instead, I'm wondering if using a native file confuses Meson.

xclaesse avatar Dec 06 '22 19:12 xclaesse

Can you try setting build.c_args option instead, I'm wondering if using a native file confuses Meson.

doesn't make a difference.

Neumann-A avatar Dec 06 '22 21:12 Neumann-A

-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.

bonzini avatar Dec 24 '22 07:12 bonzini

-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.

Neumann-A avatar Dec 24 '22 22:12 Neumann-A

@bonzini Really? See e.g. https://github.com/mesonbuild/meson/blob/master/cross/iphone.txt.

Neumann-A avatar Jan 08 '23 10:01 Neumann-A

Cool you found a bug.

bonzini avatar Jan 08 '23 10:01 bonzini

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.

bonzini avatar Jan 11 '23 20:01 bonzini