On 2/18/22 04:40, Jag Raman wrote:
On Feb 17, 2022, at 7:09 AM, Peter Maydell <peter.mayd...@linaro.org> wrote:
On Thu, 17 Feb 2022 at 07:56, Jagannathan Raman <jag.ra...@oracle.com> wrote:
The compiler path that cmake gets from meson is corrupted. It results in
the following error:
| -- The C compiler identification is unknown
| CMake Error at CMakeLists.txt:35 (project):
| The CMAKE_C_COMPILER:
| /opt/rh/devtoolset-9/root/bin/cc;-m64;-mcx16
| is not a full path to an existing compiler tool.
Explicitly specify the C compiler for cmake to avoid this error
This sounds like a bug in Meson. Is there a Meson bug report
we can reference in the commit message here ?
Hi Peter,
This issue reproduces with the latest meson [1] also.
0.60.0 or more recent versions should have a fix, which would do exactly
what this patch does: do not define CMAKE_C_COMPILER_LAUNCHER, and place
the whole binaries.c variable in CMAKE_C_COMPILER. What are the
contents of the genrated CMakeMesonToolchainFile.cmake and
CMakeCache.txt files, without and with your patch?
I noticed the following about the “binaries” section [2]. The manual
says meson could pass the values in this section to find_program [3].
As such I’m wondering if it’s OK to set compiler flags in this section
because find_program doesn’t seem to accept any compiler flags.
The full quote of the manual is "These can be used internally by Meson,
or by the find_program function", and the C compiler variable "c" is in
the former category.
There is an important difference between the flags in "binaries" and
those in "built-in options". What is in "binaries" is used when
requesting e.g. the compiler search path, while what is in "built-in
options" is not. So options like "-m32" are definitely part of
"binaries", not "built-in options":
$ gcc --print-multi-os-directory
../lib64
$ gcc -m32 --print-multi-os-directory
../lib
Paolo