[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: linking against an older glibc?



On Thu, Dec 09, 2004 at 05:45:13PM -0800, Chris Ruvolo wrote:
> Hello all.  This is a general glibc question, and does not have to deal with
> Debian directly.  Sorry for the off-topic posting, but I don't know of
> another open forum for glibc discussion (libc-hackers being closed).

That would be libc-alpha.  But it's not a very helpful list.

> If I use a simple gcc -I$prefix/include -L$prefix/lib, it fails to link,
> first using the system crt1.o (with missing symbols) and then showing
> missing versioned symbols that are present in the 2.2.4
> $prefix/lib/ld-linux.so.2 but not in the /lib/ld-linux.so.2 (eg:
> _dl_lazy@GLIBC_2.1.1, dl_out_of_memory@GLIBC_2.2, etc.).  Specifying
> -nostdlib and the $prefix/lib/crt1.o seems to solve that portion of the
> problem.

Use -B$prefix/lib/ instead.  You may also want -rpath-link $prefix/lib
(which only affects the static linker search path, unlike -rpath).

> However, if I include $prefix/lib/ld-linux.so.2 on the link line, it links,
> but then get a segfault when trying to run it, in fixup() from
> /lib/ld-linux.so.2.
> 
> If I try to use the -dynamic-linker $prefix/lib/ld-linux.so.2 option when
> linking, it won't execute the resulting binary:

You should not need to do either of those.  The segfault is presumably
because you misused -nostdlib (it takes away more than crt1.o!)

-- 
Daniel Jacobowitz



Reply to: