Re: getaddrinfo is not statically compiled

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

 



On 04/28/2010 02:57 PM, bassis wrote:
> 
> 
> 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:

Which version differences do you want to avoid?

> 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 ?

gcc liks with libc by default.  I don't know what you're asking.

If you really need getaddrinfo you can always shell out to an external
program.  I'm not sure that's a good idea, though.

Andrew.

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux