Subject: Re: libtool problem with runtime shlib path propagation
To: Todd Vierling , Nick Hudson <skrll@netbsd.org>
From: Nick Hudson <skrll@netbsd.org>
List: tech-toolchain
Date: 02/15/2002 16:02:30
On Friday 15 February 2002 3:48 pm, Todd Vierling wrote:
> On Fri, 15 Feb 2002, Nick Hudson wrote:
> : > Yah, I see what you mean now.  Looking at libtool's doc, I'm going to
> : > do a 180 here and say that the appropriate flag *is*
> : > -Wl,-R${X11BASE}....
> :
> : The problem with -Wl, is that nothing gets put into the .la file which is
> : what Matthias needs (I think).
> 
> Then *both* options should be specified.
> 
> -Wl, is for the library currently being created.  -rpath is for the .la
> file, and thus for things which link against the library being created.
> (This is right from libtool's doc.)

Agreed.

> : This description is not strictly correct. -Wl, gets interpretted by 
> : libtool into the equivalent compiler and linker options. When you use a
> : compiler to link it should get the compiler options and if you use a
> : linker to link it should get the linker options. So, I don't believe a
> : compiler will ever see -R.
> 
> -Wl, is always passed through libtool.  (Actually, if the link command is
> "cc -shared", it appears to preserve the -Wl, part.)

Right, because (modified libtool config stuff)

   netbsd*)
    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
      archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
      ...
    else
      archive_cmds='$CC -shared ...libobjs $deplibs $compiler_flags...'
      ...
    fi

note the $linker_flags vs $compiler_flags.

Nick