Open arnout opened 5 years ago
Is there any status on this? Would a patch such as this be accepted? https://gitlab.com/buildroot.org/buildroot/-/blob/master/package/meson/0002-Prefer-ext-static-libs-when-default-library-static.patch
Building static libraries, and depending on static libraries are 2 different things. I don't think we should mix that.
It would be nice to write a test case to help understand exactly what's your use-case.
As far as I understand, it's the same case as https://github.com/mesonbuild/meson/pull/6629, isn't it?
I think it's more along the lines of this: https://github.com/mesonbuild/meson/pull/6697
When linking an external library A that was built statically and that itself depends on another library B, meson will try to link with the dynamic version of library B while it is supposed to be linked with the static version. This is because meson searches for the .so file explicitly instead of relying on the linker's
-l
expansion.This issue was introduced by 05b54b476.
It is not easy to create a simple reproducer, mainly because linking statically is not really well supported in meson. But we trigger the issue in Buildroot: http://autobuild.buildroot.net/results/db1740b4777f436324218c52bc7b08e5c21b667d/build-end.log
It can be reproduced with:
To work around this issue, we patch meson so that the --default-library option propagates to the order in which libraries are searched. It's not clear though if this is the best solution.