Boost logo

Boost-Build :

Subject: [Boost-build] semi-broken support for $ORIGIN in gcc.jam?
From: Holger Joukl (Holger.Joukl_at_[hidden])
Date: 2011-06-14 11:33:01


Hi,

I'm having trouble using $ORIGIN to put a relative runtime library search
path into my target.

Referring to this thread:
     http://lists.boost.org/boost-build/2010/02/23155.php
and this (accompanying?) ticket
    https://svn.boost.org/trac/boost/ticket/3479

I think that support for $ORIGIN usage is still somewhat broken. While I
can successfully use an isolated '$ORIGIN' for my <dll-path>, like so

<variant>release:<dll-path>'$ORIGIN'

resulting in such an RPATH (elfdump -d output):

Dynamic Section: .dynamic
     index tag value
       [0] NEEDED 0xb718 libboost_python.so.1.44.0
       [1] NEEDED 0xb732 librt.so.1
       [2] NEEDED 0xb73d libstdc++.so.6
       [3] NEEDED 0xb74c libm.so.2
       [4] NEEDED 0xb756 libgcc_s.so.1
       [5] SONAME 0xb783 sample.so
       [6] RPATH 0xb78d
$ORIGIN:/apps/local/gcc/4.5.1/lib/
       [7] INIT 0x1108c
[...]

I can't get it to use a $ORIGIN-*based* path, though, i.e.

<variant>release:<dll-path>'$ORIGIN/../../../stage/release/system/lib'

or

<variant>release:<dll-path>'$ORIGIN'/../../../stage/release/system/lib

won't work, both ending up like this:

Dynamic Section: .dynamic
     index tag value
       [0] NEEDED 0xb718 libboost_python.so.1.44.0
       [1] NEEDED 0xb732 librt.so.1
       [2] NEEDED 0xb73d libstdc++.so.6
       [3] NEEDED 0xb74c libm.so.2
       [4] NEEDED 0xb756 libgcc_s.so.1
       [5] SONAME 0xb783 sample.so
       [6] RPATH
0xb78d ../../stage/release/system/lib':/apps/local/gcc/4.5.1/lib/
[...]

or
[...]
        [6] RPATH
0xb78d ../../stage/release/system/lib:/apps/local/gcc/4.5.1/lib/
[...]

I tried instrumenting quote-rpath() in tools/build/v2/tools/gcc.jam with
ECHO output and it looks like
$ORIGIN has already been expanded for the non-working examples, before the
special handling
for single quotes is reached (?)

I could work around this by not using <dll-path> at all but <linkflags>
instead:

<variant>release:<linkflags>-Wl,-rpath,'$ORIGIN/../../../stage/release/system/lib'

==>
Dynamic Section: .dynamic
     index tag value
       [0] NEEDED 0xb718 libboost_python.so.1.44.0
       [1] NEEDED 0xb732 librt.so.1
       [2] NEEDED 0xb73d libstdc++.so.6
       [3] NEEDED 0xb74c libm.so.2
       [4] NEEDED 0xb756 libgcc_s.so.1
       [5] SONAME 0xb783 sample.so
       [6] RPATH
0xb78d /apps/local/gcc/4.5.1/lib/:$ORIGIN/../../../stage/release/system/lib

But the rpath search order is not quite what I want, bringing the (global)
lib path before the relative local one.

Is there a way to achieve an RPATH of
$ORIGIN/../../../stage/release/system/lib:/apps/local/gcc/4.5.1/lib/ ?

Thanks,
Holger
Landesbank Baden-Wuerttemberg
Anstalt des oeffentlichen Rechts
Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz
HRA 12704
Amtsgericht Stuttgart


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk