This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: linking against libbfd without modify LD_LIBRARY_PATH


Many thanks for your help Mike.
The distro is gentoo (~amd64, up-to-dated) ;)

RPATH is /usr/lib64/binutils/x86_64-pc-linux-gnu/2.22

The problem is there is no such tool like pkg-config which can output
the lib path automatically, IE:

pkg-config --cflags --libs glib-2.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include  -lglib-2.0

Is it a known problem with Gentoo?

Best Regards
Baojun

On Mon, Dec 5, 2011 at 1:04 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Sunday 04 December 2011 02:51:04 Baojun Wang wrote:
>> When I create my own application liked to libbfd (-lbfd), ``ldd myapp''
>> shows:
>>
>> Â$ ldd myapp
>> Â Â Â Â linux-vdso.so.1 => Â(0x00007fff985ff000)
>> Â Â Â Â libbfd-2.21.1.so => not found
>> Â Â Â Â libc.so.6 => /lib64/libc.so.6 (0x00007f26dc31a000)
>>
>> I need set LD_LIBRARY_PATH to let ``myapp'' runs normally.
>
> this is a bug in your distro. Âyou should file a bug with them.
>
>> But for ``objdump'', why it doesn't need to do so?
>
> it has RPATH entries for it:
> Â Â Â Âreadelf -d `which objdump` | grep RPATH
> -mike


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]