libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Question about: -R '$ORIGIN/../lib'


From: Boehne, Robert
Subject: RE: Question about: -R '$ORIGIN/../lib'
Date: Wed, 21 Aug 2002 10:37:24 -0400

The "relative hardcoded runpaths" aren't supported by all
systems, so adding support for it to Libtool wouldn't be
useful to those of us who use such systems.  It has been
requested 1000 times, but it would lead to confusion
and portability problems for most of us.

Can you "cheat" and use somthing like "-Wl,-R'$ORIGIN/../lib'" ?

HTH,

Robert


-----Original Message-----
From: Simon Ney [mailto:address@hidden]
Sent: Friday, August 16, 2002 10:14 AM
To: address@hidden
Subject: Question about: -R '$ORIGIN/../lib'


Hi,

will libtool support in the future "relative hardcoded runpaths" ?
This allow us to move installed "bin/*" and "lib/*" without
modification.
Or assume you install binary packages and are ask just before
installation
for the prefix directory to install into (e.g. /opt or /usr/opt ...
that may be BASEDIR in pkgadd of solaris).
All checksums of installed package files remain the same independent of
the installation directory.

Relative hardcoded runpaths are supported by solaris and possible
all ELF systems (?).

example how it works:
---------------------

# mkdir OBJ
# mkdir OBJ/lib
# cc -G -h libsupp.so.2 -o OBJ/lib/libsupp.so.2.1 support.o
# ln -s libsupp.so.2.1 OBJ/lib/libsupp.so.2
# ln -s libsupp.so.2 OBJ/lib/libsupp.so
# mkdir OBJ/bin
# cc -o OBJ/bin/main main.o -LOBJ/lib -R'$ORIGIN/../lib' -lsupp


in action:
----------

# ldd OBJ/bin/main      
        libsupp.so.2 =>  /tmp/libtool-question/OBJ/lib/libsupp.so.2
        ...snip...

# mv OBJ /tmp/moved

# ldd /tmp/moved/bin/main
        libsupp.so.2 =>  /tmp/moved/lib/libsupp.so.2
        ...snip...


# dump -Lv /tmp/moved/bin/main
/tmp/moved/bin/main:

  **** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag         Value
[1]     NEEDED          libsupp.so.2
[2]     NEEDED          libc.so.1
        ...snip...
[5]     RUNPATH         $ORIGIN/../lib
[6]     RPATH           $ORIGIN/../lib
        ...snip...


All what have to be done is replace the absolute part with '$ORIGIN'.
Careful observe the usage of $ORIGIN in Makefiles ( quotedstring and
dollarquote
is required ... e.g.: '$$ORIGIN' )

NOTE: this also works with:
        - Libraries hardcored to other libraries
                -R'$ORIGIN'
        - Other ABI or ISA
          example for 64bit (installed in OBJ/bin/sparcv9/main and
OBJ/lib/sparcv9/libsupp.so*):
                -R'$ORIGIN/../../lib/sparcv9'

(
 )imon

--
---------------------------------------------------------------------
| Simon Ney, Bischofsweg 46 60598 Frankfurt/M Tel: ++49 69 68600055 |
| Email address@hidden Fax: ++49 69 68600052 |
---------------------------------------------------------------------


_______________________________________________
Libtool mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/libtool


reply via email to

[Prev in Thread] Current Thread [Next in Thread]