Red Hat Bugzilla – Bug 971956
missing libboost_thread.so: ld fails to link against boost-thread but succeeds to link against boost-regex
Last modified: 2015-05-04 21:37:59 EDT
Created attachment 758250 [details]
output of $: ldconfig -p | grep boost
Description of problem:
ld fails to link against boost-thread with boost-thread installed
Version-Release number of selected component (if applicable):
ld: 184.108.40.206.1-6.fc18 20120806
Steps to Reproduce:
1. Install boost-thread and boost-devel (containing all headers for boost-thread)
2. run this:
ld -l boost_thread
ld fails with this output:
ld: cannot find -lboost_thread
but it must fail with this output like it does on other packages (e.g. boost_regex, boost_filesystem, boost_program_options):
ld: warning: cannot find entry symbol _start; not setting start address
ld should find boost_thread since header files (boost-devel) and the shared library (boost-thread) are installed.
I think the reason is that neither boost-devel nor boost-thread provide a libboost_thread.so file ld could link against.
Is there any reason why boost-devel does not provide this library? Afaik it did provide this file some time ago since it is e.g. required to build mapnik.
The library is called libboost_thread-mt. The -mt distinguishes between thread-aware and thread-agnostic variants, and Boost.Thread is naturally thread-aware, hence the suffix.
this is the non-standard way boost is compiled for Fedora. If you download the source from boost.org and compile it as described in boost's docs  it won't build a libboost-thread-mt.so but a libboost-thread.so and that's what fedora should provide in my opinion.
According to this mail http://lists.boost.org/boost-users/2010/09/62701.php boost dropped the -mt file name suffixes with version 1.40 released in august 2009. Most major distributions adopted that change (Debian, Ubuntu, Arch, OpenSUSE). So Fedora is doing it wrong.
This does not only affect the boost-thread library but all of them.
You're right, of course. We do pass --layout=tagged explicitly, which we do so that we can also build with threading=single,multi. I think I could build Boost.Thread in a separate pass without the tagged layout. Or maybe just making a symlink (or, failing that, a linker script) of that name would work. I'll get back to this.
Looking into this some more, I'm not sure that the single/multi distinction is meaningful. After a local build, all constituent .o's are pairwise bit-for-bit identical between single- and multi-threaded variant (except that Boost.Atomic, .Thread and .Locale are only built when multi-threaded). The resulting DSO's then differ, but that's probably due to two reasons: length of sonames differs (due to -mt having been added), which shifts everything in the file; and -pthread in linker command line causes -lpthread and libpthread_nonshared.a to be linked in, which adds one NEEDED entry (shifting the contents more), and some extra baggage from the .a.
In particular, there doesn't seem to be any magic that makes -mt libraries thread-safe. That also means there's no overhead involved in making everything -mt, and that means we can simply build everything with threading=multi, and drop the tagging which now serves no purpose.
Of course that constitutes an ABI breakage (all the sonames would change), so I'll do this in Rawhide. I might still patch over this in F18 by providing -mt-less symlinks.
This is now on pmachata/master-next. Currently many packages depend on the -mt variants, so I'll push this change with rebase to next Boost.
I'll add symlinks for Boost.Thread and Boost.Locale in F18 and F19. F18 build is spinning now.
boost-1.50.0-6.fc18 has been submitted as an update for Fedora 18.
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing boost-1.50.0-6.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
boost-1.50.0-6.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.