Subject: OT:info on linking object files together
To: None <netbsd-help@netbsd.org>
From: Sam Carleton <sam@linux-info.net>
List: netbsd-help
Date: 01/03/2003 15:10:44
Folks,
This is off topic, but out of all the mailing lists you folks
are the brightest and nicest of them all!
On another OS a GPL software package, which uses the configure
scritp, is having problems find all the libraries it needs. I
know that many folks would simply tell me to set the
LD_LIBRARY_PATH. But I also know, thanks to someone on this
mailing list, that it is possible to link the path into the
executable. I learned this while trying to get my own source
code compiled and running.
I added this to my link command line:
-Wl,-rpath -Wl,/usr/pkg/lib
My first question is derived from the -Wl flag, it is my
understanding that this will passes commands onto the linker.
This gives me the impression that gcc is NOT the linker. What
IS the linker? Why is gcc launching the linker rather then
directly running the linker? Is the linker part of the gcc
package or is the linker separate from the gcc package?
I tried added the two -Wl, params to the LDFLAGS enviornment
variable before running configure and recieved the error that
the C compiler cannot create executables.
I am guess that this is not because the LDFLAGS is wrong, but
that the linker on this other UNIX OS is not the same one as
what is on NetBSD.
Does anyone have any insight on this matter?
P.S. The other OS is Solaris 8 (SPARC)
Sam