-
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
Boost rewrite breaks build #7110
Comments
I should add that this only happens on our Gentoo system, not the Ubuntu one. It happens with gcc-9, gcc-10, and clang-10. Please let me know what I should provide to make it more reproducible, ideally in a CI test. One difference is that the Gentoo system features Boost 1.72, the Ubuntu one Boost 1.71. |
What is the output of Also can you post the output of This looks like a really weird bug since the |
(To keep the linker from dropping the shared library altogether, I changed #include <boost/filesystem.hpp>
int main()
{
return boost::filesystem::path("/path/to/something").filename().size() != 0;
} and added fiesh@wsbox /tmp/working % ldd a.out
linux-vdso.so.1 (0x00007fffbf9f7000)
libboost_filesystem.so.1.72.0 => /usr/lib64/libboost_filesystem.so.1.72.0 (0x00007f5305d7e000)
libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/libstdc++.so.6 (0x00007f5305b05000)
libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/libgcc_s.so.1 (0x00007f5305aec000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5305933000)
librt.so.1 => /lib64/librt.so.1 (0x00007f5305929000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5305909000)
libm.so.6 => /lib64/libm.so.6 (0x00007f53057d1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5305df8000) I suppose by "compiling by hand" you mean the following?
Unlike with static libraries, I don't think it is possible to specify a shared library by its name, one has to use the Running % find /usr -name "*boost_system*" -type f 2>/dev/null
/usr/lib/libboost_system.so.1.72.0
/usr/lib/debug/usr/lib64/libboost_system.so.1.72.0.debug
/usr/lib/debug/usr/lib/libboost_system.so.1.72.0.debug
/usr/lib/libboost_system.a
/usr/share/aclocal/ax_boost_system.m4
/usr/lib64/libboost_system.so.1.72.0
/usr/lib64/libboost_system.a |
Ah, seems like meson uses |
Oh wow awesome! I was just about to prepare a |
Library paths seem to be extremely important! Since meson uses full paths to shared libraries always, one must assume this works. However, you're getting an error message from I can trivially reproduce the error message on archlinux by trying to relink a random program using meson's command line but switching one lib to use /usr/lib32 and adding -fuse-ld=gold.
Using the boring old non-gold linker I get the error message:
|
This happens when boost is installed for multiple ABIs (eg. 32-bit and 64-bit). The 32-bit boost libraries end up in either /usr/lib or /usr/lib32, and the 64-bit libraries are in /usr/lib64. The new boost dependency code has a very naive algorithm for finding valid libdirs; it basically just uses anything that starts with "lib". There is probably some better code elsewhere in meson to enumerate valid libdirs for the host toolchain. |
Using the If you want to find a library, you need to use the compiler toolchain to do it. |
Some additional corner-cases: x86_64 has a special ABI called "x32" that uses 32-bit pointers on an otherwise 64-bit system. This ABI uses "libx32" on Gentoo. https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/arch/amd64/make.defaults#n20 RISC-V has separate libdirs depending whether or not hardware floating-point is used in the library ABI. These appear as subdirectories under lib64. I think this is true of both Gentoo and Debian. https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/arch/riscv/rv64gc/make.defaults#n15
|
MIPS has 2 separate 32-bit ABIs, that get installed in lib and lib32. https://gitweb.gentoo.org/repo/gentoo.git/tree/profiles/arch/mips/make.defaults#n14 |
Thanks for the pointers, but I am reluctant to add support for all these corner-cases since the directory layout might be different on other distributions. Also, meson currently does not distinguish between most of them anyway (I only found I would say that it would be fair to require |
A quite reliable way to find library directories would be to ask compiler:
Then you would just search for requested library in these directories. |
@Arfrever Thanks, that's what I am currently doing in #7117 now. There was some further discussion about this here: mensinda@41397e5#comments. |
I forgot to mention that
|
Consider the following meson.build file
(the file
main.cpp
can just containint main(){}
.)This no longer builds. The behavior was introduced with 08224da.
The problem is that instead of
-lboost_system
, the file/usr/lib/libboost_system.so.1.72.0
is passed as such to the linker:The text was updated successfully, but these errors were encountered: