This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: getaddrinfo is not statically compiled
Andrew Haley wrote:
>
> You can't. The resolver library needs to load components dynamically,
> and the mechanism used to do that requires that they must come from
> the same glibc version as the code linked into the application.
>
> You can either
>
> a. Package these libraries with your app, or
> b. Don't statically link with libc.
>
> b. is far the best option, even if you statically link everything else.
>
> Andrew.
>
> http://people.redhat.com/drepper/no_static_linking.html
>
>
Ok, so statically is not possible so I'm trying to do it shared. I want to
provide the needed shared libraries rather than use the target system libs
to avoid version differences:
According to ldd, my program needs these libs:
linux-gate.so.1 => (0xf7f47000) (made by kernel)
libc.so.6 => /lib32/libc.so.6 (0xf7ddf000) (points to libc-2.7.so)
/lib/ld-linux.so.2 (0xf7f48000) (points to ld-2.7.so)
I have successfully linked ld-2.7.so by compiling like this:
gcc -std=c99 -D_POSIX_C_SOURCE=200112L -O2 -m32 -s
-Wl,-dynamic-linker,ld-2.7.so myprogram.c
But I have not managed to successfuly link libc-2.7.so. How can I do that ?
--
View this message in context: http://old.nabble.com/getaddrinfo-is-not-statically-compiled-tp28385701p28387972.html
Sent from the gcc - Help mailing list archive at Nabble.com.