Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256697 - dev-libs/boost-1.37.0 creates bad symlinks
Summary: dev-libs/boost-1.37.0 creates bad symlinks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tiziano Müller (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-28 21:43 UTC by Adam Nielsen
Modified: 2009-05-13 19:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Nielsen 2009-01-28 21:43:49 UTC
Emerging boost-1.37.0 creates these symlinks: (only boost_system shown, happens for all the installed libraries)

$ ls /usr/lib/libboost_system*
-rw-r--r-- 1 root root  28K 2009-01-26 17:37 libboost_system-1_37.a
lrwxrwxrwx 1 root root   23 2009-01-26 17:39 libboost_system-1_37.so -> libboost_system-1_37.so
-rwxr-xr-x 1 root root  19K 2009-01-26 17:37 libboost_system-1_37.so.1.37.0
-rw-r--r-- 1 root root  28K 2009-01-26 17:37 libboost_system-mt-1_37.a
lrwxrwxrwx 1 root root   26 2009-01-26 17:39 libboost_system-mt-1_37.so -> libboost_system-mt-1_37.so
-rwxr-xr-x 1 root root  19K 2009-01-26 17:37 libboost_system-mt-1_37.so.1.37.0
-rw-r--r-- 1 root root  28K 2009-01-26 17:37 libboost_system-mt-s-1_37.a
-rw-r--r-- 1 root root  28K 2009-01-26 17:37 libboost_system-s-1_37.a

The base symlinks (libboost_system-1_37.so and libboost_system-mt-1_37.so) show up as red because they're pointing to themselves.  This means certain uses of the library fail:

$ g++ -fPIC -c -o main.o main.cpp -I/usr/include/boost-1_37/ && g++ -fPIC -o test.so main.o -shared -lboost_system-1_37
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libboost_system-1_37.a(error_code.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib64/libboost_system-1_37.a: could not read symbols: Bad value
collect2: ld returned 1 exit status 

If I delete the broken symlinks and recreate them the way they should be:

$ ls libboost_system*
-rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-1_37.a
lrwxrwxrwx 1 root root  30 2009-01-29 07:36 libboost_system-1_37.so -> libboost_system-1_37.so.1.37.0
-rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-1_37.so.1.37.0
-rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-1_37.a
lrwxrwxrwx 1 root root  33 2009-01-29 07:36 libboost_system-mt-1_37.so -> libboost_system-mt-1_37.so.1.37.0
-rwxr-xr-x 1 root root 19K 2009-01-26 17:37 libboost_system-mt-1_37.so.1.37.0
-rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-mt-s-1_37.a
-rw-r--r-- 1 root root 28K 2009-01-26 17:37 libboost_system-s-1_37.a

Then the above compilation succeeds.
Comment 1 Tiziano Müller (RETIRED) gentoo-dev 2009-01-30 09:54:00 UTC
Can you please tell me which versions of boost-build you have installed?
Do you have any other versions of boost installed (like dev-libs/boost-1.36.0)?
Are the ebuilds from my overlay or from the official gentoo tree?
Comment 2 Łukasz Michalik 2009-01-30 10:18:43 UTC
Adam, are you building boost with USE=debug maybe?
Comment 3 Adam Nielsen 2009-01-30 12:58:49 UTC
Yes, you're right!  I was building with 'debug' - is that a bad idea?  I tried rebuilding without debug and all the symlinks are correct.

I'm building with boost-build-1.37.0, and Portage automatically uninstalled the previous version I had which was 1.35.  This is all from the official Gentoo tree.
Comment 4 dongxu li 2009-04-08 13:53:08 UTC
(In reply to comment #3)
> Yes, you're right!  I was building with 'debug' - is that a bad idea?  I tried
> rebuilding without debug and all the symlinks are correct.

I got the broken symlinks, while USE="-debug" for boost from the beginning.

[ebuild   R   ] dev-util/boost-build-1.37.0  USE="python -examples" 0 kB
[ebuild   R   ] dev-libs/boost-1.37.0-r1  USE="eselect expat icu python -debug -doc -mpi -tools"
Comment 5 dongxu li 2009-04-08 14:03:19 UTC
the broken symlinks for:

USE="-debug" emerge boost

ls -l /usr/lib64/libboost_thread-1_37-debug.*
lrwxrwxrwx 1 root root 31 2009-04-08 08:40 /usr/lib64/libboost_thread-1_37-debug.a -> libboost_thread-mt-1_37-debug.a
lrwxrwxrwx 1 root root 32 2009-04-08 08:40 /usr/lib64/libboost_thread-1_37-debug.so -> libboost_thread-mt-1_37-debug.so
Comment 6 Adam Nielsen 2009-04-08 22:14:16 UTC
Are you sure those symlinks aren't left over from a previous Boost install?  I don't have those debug libraries:

$ ls -l /usr/lib64/libboost_thread-1_37*
lrwxrwxrwx 1 root root 25 2009-01-30 22:53 /usr/lib64/libboost_thread-1_37.a -> libboost_thread-mt-1_37.a
lrwxrwxrwx 1 root root 26 2009-01-30 22:53 /usr/lib64/libboost_thread-1_37.so -> libboost_thread-mt-1_37.so

I'm still not sure why the "debug" USE flag would completely break everything though...
Comment 7 dongxu li 2009-04-09 12:39:46 UTC
(In reply to comment #6)
> Are you sure those symlinks aren't left over from a previous Boost install?  I
> don't have those debug libraries:

yes, I first "emerge -C boost", the links were gone.

"emerge boost" brings them back.

also,

$ qlist boost|grep debug
/usr/lib64/libboost_thread-1_37-debug.so
/usr/lib64/libboost_thread-1_37-debug.a

emerge -pv boost
[ebuild   R   ] dev-libs/boost-1.37.0-r1  USE="eselect expat icu python -debug -doc -mpi -tools" 0 kB
Comment 8 eric.hoyt 2009-05-13 02:13:07 UTC
For me, I had boost-1.35.0-r2 and attempted to upgrade to boost-1.37.0-r1.  Portage complained about a blocking condition and said it was uninstalling 1.35 before installing 1.37.  After the 1.37 install I noticed that /usr/include and /usr/lib had all kinds of broken symlinks from the 1.35 rev.  I had to remove all boost installations and then clean up all broken symlinks before re-emerging 1.37.
Comment 9 Tiziano Müller (RETIRED) gentoo-dev 2009-05-13 19:16:00 UTC
That was a bug in the part creating the symlinks.
That should be solved by now.