|
From: | Todd Gamblin |
Subject: | Problem with -R and external libraries |
Date: | Thu, 24 Sep 2009 12:40:37 -0700 |
I'm having trouble getting -R to work as advertised. From the libtool docs:
However, when I link libraries that were built with -R into executables, it doesn't look like rpath is getting set properly. Here's the complete description of the problem. I'm using libtool 2.2.6 on an AMD RedHat system (specifically Chaos). I've got a tool, 'ef', that depends on a libtool library, 'libeffort.la'. I build libeffort.la like this:
with the various variables set by configure like this (from the actual Makefile):
libcallpath.la is built like this:
The flags there are set like this (again, by configure, so they're automatically generated and contain a few superfluous -L and -R's).
libcallpath.la has dependencies like this: dependency_libs=' -R/g/g21/gamblin2/projects/dawn-sw/sw_beta5/x86_64-unknown-linux2.4/lib -R/usr/local/tools/libdwarf-2008.10.13/lib -L/g/g21/gamblin2/projects/dawn-sw/sw_beta5/x86_64-unknown-linux2.4/lib -lstackwalk -lsymtabAPI -lcommon -lxml2 -L/usr/local/tools/libdwarf-2008.10.13/lib -ldwarf -lelf -liberty -lrt' And libeffort.la has dependencies set like this: dependency_libs='-R/usr/local/tools/papi/lib64 -R/g/g21/gamblin2/projects/dawn-sw/sw_beta5/x86_64-unknown-linux2.4/lib -R/usr/local/tools/libdwarf-2008.10.13/lib -R/g/g21/gamblin2/projects/dawn-sw/sw_beta5/x86_64-unknown-linux2.4/lib/lib -L/usr/local/tools/papi/lib64 -lpapi /g/g21/gamblin2/src/libra/chaos_4_x86_64_ib/callpath/libcallpath.la -L/g/g21/gamblin2/projects/dawn-sw/sw_beta5/x86_64-unknown-linux2.4/lib -L/usr/local/tools/libdwarf-2008.10.13/lib -lstackwalk -lsymtabAPI -lcommon -lxml2 -ldwarf -lelf -liberty /g/g21/gamblin2/src/libra/chaos_4_x86_64_ib/libwavelet/libwavelet.la -lrt' Finally, I want to build an executable, ef, with these libs, but the rpath doesn't get set right. Here's how I build ef:
But, when I run ldd on the executable, it doesn't know where any of the deps are, though the docs above lead me to believe it should:
And, indeed, the rpath isn't in the executable:
I tried installing the whole package, as well, and the installed executable has the same problems. Is this what's supposed to happen? Am I missing something? From the docs, it seems like these executables should pick up the rpath of all their dependencies, but that isn't what's happening. I could supply the -R args directly on the ef_LDFLAGS = line, but that's not really acceptable because i'd then have to remember what all the libraries and all their dependencies depend on, which can change. I noticed things worked as I'd expect them to if I supply -rpath instead of -R, but the docs say that is for telling libtool the *install* directory of a library, and it won't let me install things if I do that. I was excited briefly when things worked in my build directory, but then libtool refused to install with a message about the rpath directories. Thanks, -Todd |
[Prev in Thread] | Current Thread | [Next in Thread] |