AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
 View Only
  • 1.  ld and $ORIGIN on AIX 5

    Posted Thu January 17, 2008 05:37 AM

    Originally posted by: SystemAdmin


    Greetings,

    I want to make my executable, which uses shared libraries, independent
    of any shared library path setings (LIBBPATH ...). Instead the shared libraries should
    always be searched for in the directory in which the executable resides.
    This is to ease installation and to ensure, my app always picks up the right libraries.

    On Platforms like linux, hpux and solaris this can easily be handeled
    by placing $ORIGIN in the link line (e.g. on linux: gcc -Wl,-rpath,$ORIGIN ...
    or on hpux: ld +b \$ORIGIN ... or on solaris: ld -R \$ORIGIN ...)

    By doing this and placing all shared libraries that my executbale needs in the same
    directory as the executbale itself, the shared libraries are always found from
    that location relative to the location of the executable in the filesystem.
    This works because $ORIGIN is resolved by the dynamic loader not at linktime but
    at execution time. It is resolved to the directory in which the executbale resides.

    I could not find anything like this for AIX.
    Is there such a mechanism on AIX as well?
    thanks

    Wolfgang-x
    #AIX-Forum