This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ld and rpath in .so
I have learned that the conda toolchain is built as a cross-toolchain,
which I believe explains ld ignoring rpath for secondary dependencies.
Thanks for reading.
On Wed, Jan 23, 2019, 5:38 PM Andrew Bell <andrew.bell.ia@gmail.com wrote:
> Hi,
>
> My understanding is that ld will use the RPATH in a shared object to
> locate secondary shared objects when linking an executable.
>
> I'm trying to build a conda package and this doesn't seem to be
> happening. I can use readelf to verify that the RPATH is set in the linked
> library to point to the directory containing the secondary libraries, but
> when I link my executable with the linked library, I get an error saying
> that the secondary libraries can't be found. Using -rpath-link on the
> command line to explicitly specify the path that's embedded in the linked
> library rpath resolves the issue (though -rpath on the command line
> fails). I'm using ld through g++ 7.3.
>
> Is there some circumstance that would cause ld to ignore the
> rpath embedded in a linked library when attempting to locate a NEEDED
> item? Am I misunderstanding something in the way ld locates secondary
> libraries?
>
> Thanks,
>
> --
> Andrew Bell
> andrew.bell.ia@gmail.com
>