Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 73003

Summary: -rpath fails with binutils 2.15.90.0.1.1-r3
Product: Gentoo Linux Reporter: Ingo Krabbe <ikrabbe.ask>
Component: [OLD] DevelopmentAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: major CC: arnetheduck
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
URL: http://sources.redhat.com/bugzilla/show_bug.cgi?id=570
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: a small test program with library. You will need cweb for the make process.
rpath.tar.bz2

Description Ingo Krabbe 2004-12-01 00:57:37 UTC
The binutils 2.15.90.0.1.1 20040303 got updated in the stable branch last days, resulting in a development system that doesn't handles the rpath feature anymore.

Some tests revealed that -rpath doesn't work with binutils/ld of that version.  The binutils/ld of the cvs -co (2.15.94 20041130) works fine with the same object files here,  which I will take as a strong evidence that it is really a bug to use binutils 2.15.90.0.0.1 20040303 as a stable tool !  Please switch back or move towards a newer version in the portage distribution.

Reproducible: Always
Steps to Reproduce:
1.Write a small library loading program
2.link it with gcc -o prog obj.o -rpath ./lib
3.Try to start ./prog with the library in lib.
4.As a cross check you can start "LD_LIBRARY_PATH=./lib ./prog" to see
  that the program really works and loads the library from ./lib as expected.

Actual Results:  
LOAD ERROR in mysql_embed.so 
mysql_embed.so: cannot open shared object file: No such file or directory 
Aborted 
(message from my program that embeds a mysql server in a shared object) 

Expected Results:  
START MYSQL SERVER 
(that is the message about the successfull start of the mysql server after I    
start the same program text with LD_LIBRARY_PATH ;)) 
 

Portage 2.0.51-r3 (default-linux/x86/2004.3, gcc-3.3.4, 
glibc-2.3.4.20040808-r1, 2.6.8.1 i686) 
================================================================= 
System uname: 2.6.8.1 i686 AMD Athlon(tm) Processor 
Gentoo Base System version 1.4.16 
Autoconf: sys-devel/autoconf-2.59-r5 
Automake: sys-devel/automake-1.8.5-r1 
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3 
Headers:  sys-kernel/linux-headers-2.6.99,sys-kernel/linux-headers-2.4.21-r1 
Libtools: sys-devel/libtool-1.5.2-r7 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=athlon -O3 -pipe" 
CHOST="i686-pc-linux-gnu" 
COMPILER="" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" 
CXXFLAGS="-march=athlon -O3 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs autoconfig buildpkg candy ccache distlocks sandbox 
sfperms userpriv usersandbox" 
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo 
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ 
ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo 
ftp://ftp.gentoo.mesh-solutions.com/gentoo/" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="X Xaw3d acpi alsa apm arts avi berkdb bitmap-fonts bonobo bzlib cdr crypt 
ctype divx4linux doc dvb encode esd f77 fam fftw flac foomaticdb fortran ftp 
gcj gdbm gif gnome gpm gstreamer gtk gtk2 gtkhtml icq imagemagick imlib java 
jikes joystickjpeg junit kde kerberos ldap libg++ libwww lprng mad maildir 
mikmod mime motif mozilla moznocompose moznoirc mozp3p mozsvg mozxmlterm mpeg 
mysql ncurses nls odbc oggvorbis ooo-kde opengl oss pam pdflib perl php png 
posix python qt quicktime readline satellite scanner sdl slang soap sockets 
spell ssl svg svga tcpd tetex tiff truetype usb vim-with-x x86 xalan xml2 
xmlrpcxmms xv zlib"
Comment 1 SpanKY gentoo-dev 2004-12-01 10:15:25 UTC
could you post a small test case ?

does 2.15.90.0.3-r3 fail too ?
Comment 2 Ingo Krabbe 2004-12-01 22:33:23 UTC
Created attachment 45117 [details]
a small test program with library.  You will need cweb for the make process.

I don't have the 2.15.90.0.3-r3 version here so it would be nice if you could
test that.
Comment 3 SpanKY gentoo-dev 2004-12-03 23:39:54 UTC
Created attachment 45244 [details]
rpath.tar.bz2

even simpler test app
Comment 4 SpanKY gentoo-dev 2004-12-03 23:42:27 UTC
the test application you attached was a mess ... no idea how to use it :p

so i made one ... it builds a sample .so with a single func and then builds a small program which basically dlloads the .so, grabs the func with dlsym, and then runs the func

$ ld --version
GNU ld version 2.15.90.0.1.1 20040303
$ make
cc -Wall  -ldl -Wl,-rpath ./lib/  test-rpath.c   -o test-rpath
cc -shared -o libtest.so libtest.c
root@vapier 0 rpath # make clean all test
rm -f test-rpath libtest.so
rm -f lib/*
cc -Wall  -ldl -Wl,-rpath ./lib/  test-rpath.c   -o test-rpath
cc -shared -o libtest.so libtest.c
cp libtest.so lib/libtest-rpath.so
./test-rpath
hello!

$ readelf -d test-rpath | grep rpath
 0x0000000f (RPATH)                      Library rpath: [./lib/]
Comment 5 Jacek Sieka 2005-01-06 04:43:38 UTC
*** Bug 75914 has been marked as a duplicate of this bug. ***
Comment 6 Jacek Sieka 2005-01-06 04:46:03 UTC
Bug 75914 contains some additional info (confirms the bug for amd64 at least=) and another simple test case (largely equivalent to this one).
Comment 7 SpanKY gentoo-dev 2005-01-11 16:14:49 UTC
binutils-2.15.92.0.2-r1 is x86 stable now
Comment 8 Jacek Sieka 2005-01-18 01:52:42 UTC
(technically, that leaves at least amd64 unresolved, unless I missed an ebuild update)
Comment 9 SpanKY gentoo-dev 2005-01-18 07:36:12 UTC
that technically is probably correct, but non-x86 arches update their packages on their own schedule