From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9305 invoked by alias); 28 Apr 2010 13:58:00 -0000 Received: (qmail 9297 invoked by uid 22791); 28 Apr 2010 13:57:59 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 28 Apr 2010 13:57:51 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1O77lt-0007US-B8 for gcc-help@gcc.gnu.org; Wed, 28 Apr 2010 06:57:49 -0700 Message-ID: <28387972.post@talk.nabble.com> Date: Wed, 28 Apr 2010 14:52:00 -0000 From: bassis To: gcc-help@gcc.gnu.org Subject: Re: getaddrinfo is not statically compiled In-Reply-To: <4BD7F591.2070109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <28385701.post@talk.nabble.com> <4BD7F591.2070109@redhat.com> X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00313.txt.bz2 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.