bug-libtool
[Top][All Lists]
Advanced

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

Re: Problem with -R and external libraries


From: Todd Gamblin
Subject: Re: Problem with -R and external libraries
Date: Tue, 13 Oct 2009 16:42:04 -0700

On Oct 11, 2009, at 4:13 AM, Ralf Wildenhues wrote:

* Todd Gamblin wrote on Thu, Sep 24, 2009 at 09:40:37PM CEST:
I'm having trouble getting -R to work as advertised.  From the
libtool docs:

-R libdir
If output-file is a program, add libdir to its run-time path. If
output-file is a library, add -Rlibdir to its dependency_libs, so
that, whenever the library is linked into a program, libdir will
be added to its run-time path.

However, when I link libraries that were built with -R into
executables, it doesn't look like rpath is getting set properly.

This kooks like a Libtool bug to me.  Especially looking at the output
of
 make check-local \
      TESTSUITEFLAGS='-k "Runpath in libtool library files" -v -d -x'

I vaguely remember being there before; possibly the obvious fix caused
some other problems, need to look.

Hi Ralf,

Thanks for taking a look at this.  I found that I got the same behavior in 2.2.6 and in 1.5.26, if it's any help.  I also noticed this bit of code in ltmain.sh:

  if test "$linkmode" = lib; then
    if test -n "$dependency_libs" &&
       { test "$hardcode_into_libs" != yes ||
         test "$build_old_libs" = yes ||
         test "$link_static" = yes; }; then
      # Extract -R from dependency_libs                                                                                           
      temp_deplibs=
      for libdir in $dependency_libs; do
        case $libdir in
        -R*) func_stripname '-R' '' "$libdir"
             temp_xrpath=$func_stripname_result
       case " $xrpath " in
       *" $temp_xrpath "*) ;;
       *) xrpath="$xrpath $temp_xrpath";;
       esac;;
        *) temp_deplibs="$temp_deplibs $libdir";;
        esac
      done
      dependency_libs="$temp_deplibs"
    fi


Shouldn't -R args in the dependency libs be preserved and eventually added to the linker output?  This is just from a quick glance over the code.

-Todd





















reply via email to

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