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"
could you post a small test case ? does 2.15.90.0.3-r3 fail too ?
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.
Created attachment 45244 [details] rpath.tar.bz2 even simpler test app
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/]
*** Bug 75914 has been marked as a duplicate of this bug. ***
Bug 75914 contains some additional info (confirms the bug for amd64 at least=) and another simple test case (largely equivalent to this one).
binutils-2.15.92.0.2-r1 is x86 stable now
(technically, that leaves at least amd64 unresolved, unless I missed an ebuild update)
that technically is probably correct, but non-x86 arches update their packages on their own schedule