Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Neumann-A opened this issue Dec 6, 2022 · 9 comments
Open

Comments

@Neumann-A
Copy link
Contributor

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.

@xclaesse
Copy link
Member

xclaesse commented Dec 6, 2022

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

@Neumann-A
Copy link
Contributor Author

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

@xclaesse
Copy link
Member

xclaesse commented Dec 6, 2022

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

@Neumann-A
Copy link
Contributor Author

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

doesn't make a difference.

@bonzini
Copy link
Collaborator

bonzini commented Dec 24, 2022

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

@Neumann-A
Copy link
Contributor Author

-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
Copy link
Contributor Author

@bonzini
Copy link
Collaborator

bonzini commented Jan 8, 2023

Cool you found a bug.

@bonzini
Copy link
Collaborator

bonzini commented Jan 11, 2023

picolibc/picolibc#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants