Peculiar configure behavior

Brian J. Tarricone bjt23 at cornell.edu
Sat Aug 7 22:27:15 CEST 2004


Randy Chung wrote:

> -R is one of the options you can pass in via LDFLAGS, which specifies 
> run-time libraries to use (before the default path).  It's helpful 
> sibling flag (also in LDFLAGS) is -L, which also comes before the 
> default path, and specifies which libraries to link against during 
> compilation.  Similar flags include the -I from the CPPFLAGS 
> environment variable, which specifies headers.  For the pedants on the 
> list, they actually specify the path, but you know what I mean :)
>
> If you look at a line that running make outputs (e.g. the following, 
> from running make in the xfrun dir), you'll see that -R shows up in 
> the bash script which invokes libtool, which passes what's included 
> via -R, following a -Wl switch (which you mention):
>
> /bin/sh ../libtool --mode=link gcc  -g -O2  -L/usr/local/xfce4/lib 
> -R/usr/local/xfce4/lib -o xfrun4  xfrun4-xfrun.o -Wl,--export-dynamic 
> -L/usr/X11R6/lib -L/usr/local/xfce4/lib -lxfcegui4 -lgtk-x11-2.0 
> -lxfce4util -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm 
> -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 
> -ldl -lglib-2.0 -Wl,-R/usr/lib -ldbh -lm

blah, right.  i thought i looked at the libtool help, but i must have 
missed it in there.

> Said flags are also passed to gcc through the good graces of gcc, e.g. 
> below (same dir, same make):
>
> gcc -g -O2 -o xfrun4 xfrun4-xfrun.o -Wl,--export-dynamic 
> -Wl,-R/usr/lib  -L/usr/local/xfce4/lib -L/usr/X11R6/lib 
> /usr/local/xfce4/lib/libxfcegui4.so /usr/lib/libgtk-x11-2.0.so 
> /usr/local/xfce4/lib/libxfce4util.so /usr/lib/libgdk-x11-2.0.so 
> /usr/lib/libatk-1.0.so /usr/lib/libgdk_pixbuf-2.0.so 
> /usr/lib/libpangoxft-1.0.so /usr/lib/libpangox-1.0.so 
> /usr/lib/libpango-1.0.so /usr/lib/libgobject-2.0.so 
> /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so 
> /usr/lib/libdbh.so -lm -Wl,--rpath -Wl,/usr/local/xfce4/lib 
> -Wl,--rpath -Wl,/usr/local/xfce4/lib
>
> (also note that -R/usr/lib is again passed to gcc, only at the 
> beginning this time)

in this case, -R is actually passed the the linker (usually ld), and not 
gcc, as it's using the -Wl option.  for the GNU linker on linux-x86, ld 
says that -R is actually for passing a filename for ld to read symbol 
names from, but, for compatibility, if you give -R(directory) instead of 
-R(file), it'll act as if you gave it the -rpath option.  interesting.  
that _should_ hardcode those directories in the executable's library 
search path such that they get searched before other lib paths 
(including the standard system lib path).  of course, in your example 
above, -R/usr/lib is given first, so it'll just duplicate the search in 
the standard location, and it'll look there first, BEFORE it searches 
/usr/local/xfce4/lib (given in the -rpath options at the end of the 
line).  i haven't been following this thread as closely as i meant to, 
but i suspect that this may be related to your problem.

    -brian

>
> -- 
>
> Randy
>
> Brian J. Tarricone wrote:
>
>> what is the -R option?  according to the gcc manpage, it doesn't 
>> exist.  ditto for libtool.  perhaps you're thinking of the -rpath 
>> option (which is actually a linker option, and needs to be passed to 
>> gcc using -Wl).
>>
>>     -brian
>>
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> http://lunar-linux.org/mailman/listinfo/xfce4-dev
>
>



More information about the Xfce4-dev mailing list