This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: linking against an alternate ld.so
- From: Kai Ruottu <kai dot ruottu at wippies dot com>
- To: "Matthew A. R. Sherian" <msherian at liquidnet dot com>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 25 Nov 2008 11:56:12 +0200
- Subject: Re: linking against an alternate ld.so
- References: <26AA63832ED7774DBFB9FFB39B337C009E8EDDBA@nj0cech03.lnholdings.com>
Matthew A. R. Sherian wrote:
I have been trying and trying to get glibc/binutils/gcc
> built into a locally rooted tree. for example
> /foo/bar/glibc/2.5/lib/ld-2.5.so as opposed to /lib/ld-2.5.so.
Would someone point me in the right direction on this.
RTFM :
http://sourceware.org/binutils/docs/ld/Options.html#Options
For instance :
--dynamic-linker file
Set the name of the dynamic linker. This is only meaningful when
generating dynamically linked ELF executables. The default dynamic
linker is normally correct; don't use this unless you know what you
are doing.
for changing the place of 'ld.so'. Another and much quicker way to learn
"usual options" in GNU tools is to try the '--help' option, for
instance:
ld --help
Setting the primary search place for the shared libs (besides the
dynamic linker aka 'program interpreter') at runtime should succeed
with the option '--rpath <directory>'. Meanwhile the '--rpath-link
<directory>' will control the linktime situation. The '--help' should
give all the previous options with a short explanation.
The special GCC's 'specs' file may be the right place to set these
options being the defaults. Just editing it (without breaking its
rigid scheme) should succeed easily. For instance there should be
the original '--dynamic-linker /lib/ld.so' to be changed...
/tired of banging my head against this.