linking against libbfd without modify LD_LIBRARY_PATH

Baojun Wang wangbj@gmail.com
Mon Dec 5 13:05:00 GMT 2011


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



More information about the Binutils mailing list