Bug 971956 - missing libboost_thread.so: ld fails to link against boost-thread but succeeds to link against boost-regex
missing libboost_thread.so: ld fails to link against boost-thread but succeed...
Product: Fedora
Classification: Fedora
Component: boost (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Machata
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2013-06-07 13:13 EDT by Christian Stadelmann
Modified: 2015-05-04 21:37 EDT (History)
5 users (show)

See Also:
Fixed In Version: boost-1.50.0-6.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Fedora 18, all updates from "updates" repository installed
Last Closed: 2013-07-08 21:41:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
output of $: ldconfig -p | grep boost (7.72 KB, text/plain)
2013-06-07 13:13 EDT, Christian Stadelmann
no flags Details

  None (edit)
Description Christian Stadelmann 2013-06-07 13:13:23 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: 20120806
boost-*: 1.50.0

How reproducible:

Steps to Reproduce:
1. Install boost-thread and boost-devel (containing all headers for boost-thread)
2. run this:
ld -l boost_thread

Actual results:
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

Expected results:
ld should find boost_thread since header files (boost-devel) and the shared library (boost-thread) are installed.

Additional info:
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.
Comment 1 Petr Machata 2013-06-09 17:00:21 EDT
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.
Comment 2 Christian Stadelmann 2013-06-09 18:43:30 EDT
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 [1] 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. 

[1] http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#easy-build-and-install
Comment 3 Petr Machata 2013-06-12 14:52:50 EDT
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.
Comment 5 Petr Machata 2013-06-26 15:02:53 EDT
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.
Comment 6 Petr Machata 2013-06-27 14:53:30 EDT
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.
Comment 7 Fedora Update System 2013-06-27 15:32:22 EDT
boost-1.50.0-6.fc18 has been submitted as an update for Fedora 18.
Comment 8 Fedora Update System 2013-06-30 21:41:06 EDT
Package boost-1.50.0-6.fc18:
* 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).
Comment 9 Fedora Update System 2013-07-08 21:41:49 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.