[Boost-bugs] [Boost C++ Libraries] #9350: boost does not use prefix for rpath

Subject: [Boost-bugs] [Boost C++ Libraries] #9350: boost does not use prefix for rpath
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-06 21:24:10


#9350: boost does not use prefix for rpath
-------------------------------------+------------------------------
 Reporter: Georg Sauthoff <mail@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: Building Boost | Version: Boost 1.54.0
 Severity: Problem | Keywords:
-------------------------------------+------------------------------
 How to reproduce:

 {{{
 MY_PREFIX=/my/boost/target

 ./bootstrap.sh --prefix=$MY_PREFIX

 ./b2 -j 14 -d+2 address-model=64 install

 ldd $MY_PREFIX/lib/libboost_filesystem.so | grep boost
    libboost_system.so.1.54.0 => NOT FOUND
 }}}

 I've observed this issue with Boost 1.52 (using the sun toolset - sun.jam)
 and with Boost 1.54 (using the gcc toolset - gcc.jam).

 It seems that boost sets the rpath to the build directory and not to the
 specified prefix (during link time).

 Expected results:

 ldd $MY_PREFIX/lib/libboost_filesystem.so | grep boost
    libboost_system.so.1.54.0 => $MY_PREFIX/lib/libboost_system.so.1.54.0

 (note that I've picked libboost_filesystem as an example - other boost
 libraries have the same issue, e.g. chrono/log/time/...)

 Currently I use a dirty workaround to have the rpath set correctly:
 {{{
 --- a/tools/build/v2/tools/gcc.jam
 +++ b/tools/build/v2/tools/gcc.jam
 @@ -945,7 +945,7 @@ rule link ( targets * : sources * : properties * )

  actions link bind LIBRARIES
  {
 - "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
 -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) -Wl,-rpath-
 link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)"
 "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l
 $(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
 + "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
 -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(MY_PREFIX)/lib -Wl,-rpath-
 link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" $(START-GROUP) "$(>)"
 "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l
 $(FINDLIBS-SA) $(END-GROUP) $(OPTIONS) $(USER_OPTIONS)
  }


 @@ -1011,7 +1011,7 @@ rule link.dll ( targets * : sources * : properties *
 )
  # Differs from 'link' above only by -shared.
  actions link.dll bind LIBRARIES
  {
 - "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
 -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(RPATH) "$(.IMPLIB-COMMAND)$(<[1])"
 -o "$(<[-1])" $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=)
 -shared $(START-GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l
 $(FINDLIBS-ST) $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
 $(USER_OPTIONS)
 + "$(CONFIG_COMMAND)" -L"$(LINKPATH)"
 -Wl,$(RPATH_OPTION:E=-R)$(SPACE)-Wl,$(MY_PREFIX)/lib "$(.IMPLIB-
 COMMAND)$(<[1])" -o "$(<[-1])"
 $(HAVE_SONAME)-Wl,$(SONAME_OPTION)$(SPACE)-Wl,$(<[-1]:D=) -shared $(START-
 GROUP) "$(>)" "$(LIBRARIES)" $(FINDLIBS-ST-PFX) -l$(FINDLIBS-ST)
 $(FINDLIBS-SA-PFX) -l$(FINDLIBS-SA) $(END-GROUP) $(OPTIONS)
 $(USER_OPTIONS)
  }

  rule setup-threading ( targets * : sources * : properties * )
 }}}

 The workaround for {{{tools/build/v2/tools/sun.jam}}} is similar.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9350>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC