Re: Setting up build environment with Meson
Posted: Wed Mar 10, 2021 2:15 pm
So I was just looking at Meson's code to understand what I could do.
compiler.find_library('libgcc') doesn't actually ask GCC where libgcc is. What it does is ask the compiler for the library search path and then Meson itself walks the path looking for "libgcc.a". This means that C flags are not taken into account and the wrong libgcc is picked up. This is completely broken.
So Meson doesn't support multilib at all.
Meson could pass the C flags to the compiler when asking for the library search paths, but it doesn't appear to do so.
Doing this doesn't work either:
It doesn't work because Meson is smart enough to understand this is a library and then internally uses find_library() to find its path (without considering multilib, of course!).
I am sad. Time to move on from Meson I think.
compiler.find_library('libgcc') doesn't actually ask GCC where libgcc is. What it does is ask the compiler for the library search path and then Meson itself walks the path looking for "libgcc.a". This means that C flags are not taken into account and the wrong libgcc is picked up. This is completely broken.
So Meson doesn't support multilib at all.
Meson could pass the C flags to the compiler when asking for the library search paths, but it doesn't appear to do so.
Doing this doesn't work either:
Code: Select all
bootloader = executable('bootloader',
sources: sources,
link_args: [
'-lgcc',
],
)
I am sad. Time to move on from Meson I think.