DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-10-28 17:00:37

puterboy
Member
Registered: 2008-09-18
Posts: 306

How do applications know to find dynamic libraries in /ffp/lib?

I am not that familiar with dynamic library linking and I am running into the problem that when I compile new packages that have libraries that the binaries can't find the libraries that I place in /ffp/lib.

I don't see any /etc/ld.so.conf file and LD_LIBRARY_PATH doesn't seem to be used.

Are you compiling in the library path at compile time? (if so how do you pass the library path /ffp/lib to standard makefile/config scripts)
Do you run ldconfig somehow/somewhere? (I am really a newbie at this so if so what do you do)?

I know I can get things to work by creating a link: ln -s /ffp/lib /usr/lib (since there is no /usr/lib in the standard firmware root) but it seems like you are doing something better/more transparent

Offline

 

#2 2008-10-28 17:15:51

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How do applications know to find dynamic libraries in /ffp/lib?

puterboy wrote:

Are you compiling in the library path at compile time? (if so how do you pass the library path /ffp/lib to standard makefile/config scripts)

Yes, lib paths are compiled in. E.g:

Code:

root@bob:/# readelf -d /ffp/bin/busybox | grep RPATH
 0x0000000f (RPATH)                      Library rpath: [/ffp/lib]

RPATH linker flags are set in source/Conf.d/build-env/rpath.sh.

Code:

-Wl,-rpath -Wl,/ffp/lib

Usually, you can simply export LDFLAGS, sometimes you need to patch Makefiles.

Offline

 

#3 2008-10-29 06:09:57

puterboy
Member
Registered: 2008-09-18
Posts: 306

Re: How do applications know to find dynamic libraries in /ffp/lib?

I am building stuff now in the uclibc-toolchain cross-compiler environment.
I couldn't find any rpath.sh file in the toolchain.

Also the makefile/config scripts for things like fuse and ntfs-3g seem incredibly complicated (to my simple eyes) so I'm still not sure how I can be sure  what the right flags are and be sure that they get passed down through all the layers of Makefiles.

Any pointers?

Offline

 

#4 2008-10-29 09:40:11

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: How do applications know to find dynamic libraries in /ffp/lib?

puterboy wrote:

I am building stuff now in the uclibc-toolchain cross-compiler environment.
I couldn't find any rpath.sh file in the toolchain.

The path refers to my subversion repository.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB