Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #334

Re: Linking problem

From Rainer Weikusat <rweikusat@mssgmbh.com>
Newsgroups comp.os.linux.development.apps
Subject Re: Linking problem
Date 2011-12-16 17:46 +0000
Message-ID <871us4z9x9.fsf@sapphire.mobileactivedefense.com> (permalink)
References <20111215001104.13eda1b8@efreet.linux> <8762himaw3.fsf@sapphire.mobileactivedefense.com> <20111215162948.60b95d1c@efreet.linux> <874nx17375.fsf@sapphire.mobileactivedefense.com> <20111215234243.40f9ed06@efreet.linux>

Show all headers | View raw


Kevin Nathan <knathan@project54.com> writes:
> On Fri, 16 Dec 2011 00:47:10 +0000
> Rainer Weikusat <rweikusat@mssgmbh.com> wrote:
>
>>Forget --sysroot. You need to add your include directories with -I,
>>add your library directories with -L and add them again with -Wl,-R
>>and that's it. If the binaries are still linked against system
>>libraries you don't want, something is still missing in your custom
>>library directory.
>
> That was the ticket! I am 99% there, now. By using this:
>
> export LDFLAGS=" -Wl,-R /home/username/progroot/lib/

[...]

> all the libs listed in "ldd program" are properly pointed to my local
> libs locations. However, I still have one lib that will not get the
> local subdir: /lib/ld-linux.so.2 (the dynamic loader).

I have to deal with a couple of 'legacy' Debian 5 installations where
I have a 'manually compiled' glibc-2.11 in /usr/local/glibc-2.11 in
order to get access to some newer kernel features. There are also
a couple of additional libraries linked with this C library which need
to be used in place of the system-provided ones. I'm using this script
as 'gcc frontend':

[rw@error]~/build/ipsec-tools/build $cat /usr/local/glibc-2.11/bin/gcc
#!/bin/sh
#
G2_11=/usr/local/glibc-2.11
exec gcc -isystem $G2_11/include -L $G2_11/lib -Wl,-dynamic-linker -Wl,$G2_11/lib/ld-linux.so.2 -Wl,-R$G2_11/lib "$@"

An example configure invocation could then look like this:

	CC=/usr/local/glibc-2.11/bin/gcc ./configure ....

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Linking problem Kevin Nathan <knathan@project54.com> - 2011-12-15 00:11 -0700
  Re: Linking problem Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-12-15 09:39 +0000
    Re: Linking problem Kevin Nathan <knathan@project54.com> - 2011-12-15 16:29 -0700
      Re: Linking problem Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-12-16 00:47 +0000
        Re: Linking problem Kevin Nathan <knathan@project54.com> - 2011-12-15 23:42 -0700
          Re: Linking problem Rainer Weikusat <rweikusat@mssgmbh.com> - 2011-12-16 17:46 +0000
            Re: Linking problem Kevin Nathan <knathan@project54.com> - 2011-12-16 10:55 -0700
            Re: Linking problem Kevin Nathan <knathan@project54.com> - 2012-01-01 10:49 -0700
          Re: Linking problem Lusotec <nomail@nomail.not> - 2011-12-19 00:27 +0000
            Re: Linking problem Kevin Nathan <knathan@project54.com> - 2011-12-19 10:16 -0700

csiph-web