-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Meson 0.47.1 breaks cross builds using Boost Python #3881
Comments
CCing @bruce-richardson There are three possible ways to fix this:
|
I was looking at 1, and made some progress. - need to get back to it However, I still think a test link is needed before we return a result to the app. Perhaps we can try with whole-archive only for static libs. |
@mtp401 the cross boost python library you're talking about is a static library or a shared library? |
The library I'm using is a shared library. I dropped by the meson IRC channel to discuss a solution yesterday but no one was available. I think an acceptable middle ground (if I understand the intent of #3792) would be to only pass |
Actually, what's really confusing is that this should not be happening at all. Boost uses the |
if the appropriate lib is not found in the dirs argument, there is still a check for system dirs. That should still be fixed. |
That's #3758, and we need to add new API to handle that. We changed the implementation to not do the link check against non-system libraries because of #3833, so linking against Boost Python should not fail because of the link check. |
And not only boost-python is broken. 0.47.1 breaks crosscompiling sshfs:
As you can see it tries to link host libs, which is obviously very wrong.
meson 0.47.0 builds the same sources just fine. |
For sshfs, the root cause commit is likely different though, since the commit referenced that breaks boost is present in 0.47.0 as well as 0.47.1 |
But the command line specifically points to |
Probably from wrong $LINK_ARGS. Notice that ld.gold is used, if ld.bfd is used meson succeeds in both versions. meson 0.47.0 working
meson 0.47.1 FAILS
The diference is -lpthread (ok) vs /home/asavah/kross/build/rock64/rootfs/usr/lib/libpthread.so (full path, NOT ok) You can see the contents of libpthread.so (LD SCRIPT) in my post above. |
This is a bug in Meson but you should note that GCC's documentation says you should use |
It comes from libfuse .pc Now I'm not 100% sure than this is a bug in meson itself, I've made a quick hack and removed |
@nirbheek yes, indeed this is fixed in master. Thank you! On a side note: I've already migrated to glibc-2.28 in which libpthread.so is no longer a linker script but a symlink and libpthread_nonshared.a no longer exists, it's libpthread.a now. However I replaced the symllink with the linker script and copied libpthread.a => libpthread_nonshared.a in order recreate this. All good, both ld.bfd and ld.gold link just fine. Thanks again. |
This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes mesonbuild#3881
This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes mesonbuild#3881
This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes #3881
@nirbheek @bruce-richardson just got a chance to test this out, sorry for the delay. This does fix the build issues I was having with Boost Python. Thanks! |
This means that we will take into account all the flags set in the cross file when fetching the list of library dirs, which means we won't incorrectly look for 64-bit libraries when building for 32-bit. Signed-off-by: Nirbheek Chauhan <nirbheek@centricular.com> Closes #3881
I've bisected between master and 0.46.1 and found that the changeset in #3792 has broken cross builds that utilize Boost Python. The issue is that there is an additional link dependency (libpythonX.Y) that is required to successfully link with
--whole-archive
. Meson ends up cycling through all of the cross binaries, failing along the way and then falls back and ends up incorrectly picking the host libboost_python.so which causes link errors later on in the build after dependency resolution is complete.The text was updated successfully, but these errors were encountered: