Skip to main content.
home | support | download

Back to List Archive

Re: CORRECTION: compiling on IRIX 6.5, Solaris 2.8, Linux 2.4.20

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Thu Jan 29 2004 - 15:08:40 GMT
On Thu, Jan 29, 2004 at 07:45:05AM -0600, Peter Karman wrote:

> Second, what I also failed to realize was that in order for LD_RUN_PATH 
> to actually be *used* by the compiler when compiling, I must specify the 
> LIBS="-L/path/to/lib" on my configure line.

I don't know this stuff very well, but -L is the path used to find the 
library when linking.  But it doesn't add in any paths the resulting 
program.  -R on the other hand adds paths into the binary that is used 
when running.  As far as I can tell using LD_RUN_PATH and -R are the 
same thing -- they add in run time search paths.

Maybe someone can explain why there needs to be both -L and -R.  I guess 
because -L might specify paths to static libraries and what "standard 
system directories" the linker searches at build time my be different 
directories from what the run-time linker searches.

> Third, and most important for IRIX, had I read more *carefully* the 
> little ld message when compiling other apps on IRIX, I would have 
> realized that LD_RUN_PATH is ignored on IRIX.

I need to ask about this on the autoconf list.  With current versions of 
autoconf (which creates the configure script) the recommend way to do 
all of this is with, I think:

   CPPFLAGS=-I/path/to/headers  LDFLAGS='-R/path/to/lib -L/path/to/lib'

> Here's the little ld 
> message from the IRIX ld output, for those (like me) who usually fail to 
> notice it as it whizzes by when running 'make':

That's not from the loader, this message below is generated by the 
libtool script.  It's generating that because we use libtool to install 
libswish-e and it's telling you how to link a program against it.

> =================================
> Libraries have been installed in:
>    /path/to/lib
> 
> If you ever happen to want to link against installed libraries
> in a given directory, LIBDIR, you must either use libtool, and
> specify the full pathname of the library, or use the `-LLIBDIR'
> flag during linking and do at least one of the following:
>    - add LIBDIR to the `LD_LIBRARYN32_PATH' environment variable
>      during execution
>    - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
> 
> See any operating system documentation about shared libraries for
> more information, such as the ld(1) and ld.so(8) manual pages.
> =================================

> NOTE too that I do not set the LD_RUN_PATH to include the zlib path. I 
> tried that, but despite the --use-zlib=/path/to/zlib/irix

I copied that usage from libxml2's configure setup.  I now think the 
correct "autoconf" way is to use CPPFLAGS and LDFLAGS to change paths.

> ld32: WARNING 85: definition of compress in 
> /path/to/zlib/irix/lib/libz.a(compress.o) preempts that definition in 
> /usr/lib32/libz.so

Interesting.


> I believe that at this point, the LD_RUN_PATH variable *is* used by the 
> Perl make process. Does anyone know if the Perl linker is different??

No, it's should not be different -- that would likely break things.  
It's not compiling perl code -- it's compiling C code.   What might be 
different is the way MakeMaker works.  Running perl Makefile.PL 
generates a normal (yet complex) Makefile and in that process it might 
be smart about using LD_RUN_PATH (like translating it into -R).

Isn't it amazing how much time this stuff can take up?  Isn't there a 
port of debian for SGI Iris machines (is that what you are running?)

Would anyone notice that the machine was running Debian?  Then you could 
have done:

   apt-get install swish-e

and then take the rest of the day off.




-- 
Bill Moseley
moseley@hank.org
Received on Thu Jan 29 07:08:41 2004