From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SXYmS-0008Te-Jt for garchives@archives.gentoo.org; Thu, 24 May 2012 14:12:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 107BCE0859; Thu, 24 May 2012 14:12:15 +0000 (UTC) Received: from mail-bk0-f53.google.com (mail-bk0-f53.google.com [209.85.214.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 6380CE07C7 for ; Thu, 24 May 2012 14:10:22 +0000 (UTC) Received: by bkcjk13 with SMTP id jk13so8036695bkc.40 for ; Thu, 24 May 2012 07:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wBlFlnyGjsHw5pjg5ly0CmwyUpVV1wJ3xqHKPoQMx1Y=; b=Ldg/1ZlTJIbgWBZDXJlzwX/Ky+eIkH0Sv3D1vHi8pUubS+Sda7w+NAavFqE/Jscuwo ZDyhXWyjdV7qWBz1XxKupx0ZA1muu/3ZMrJ3gYyxtutb18Ga7yPyym9PjjS51RixKoQS y+10IKMwmqtLgdOOe3VZlI7k+FRJNQcJU6jnnursQ9JzjjX39QAvE3jTdrDaXTMcwWV8 sbD1Zkt4J1ucTcszY9hT+pkdoeOiYpHIhMahmEWwgnjcfQXsdYn592HQontdT6nG/2Jc o0f50SktSsslUVFAsbI0jqobMvZ3F7F/9r45DB7sf1+M6H6IEhYraUnqo51G3ZLQPKkN P/Uw== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.204.9.216 with SMTP id m24mr13272691bkm.67.1337868621463; Thu, 24 May 2012 07:10:21 -0700 (PDT) Sender: markos.chandras@gmail.com Received: by 10.204.231.75 with HTTP; Thu, 24 May 2012 07:10:21 -0700 (PDT) In-Reply-To: References: Date: Thu, 24 May 2012 15:10:21 +0100 X-Google-Sender-Auth: eVVT0krfG7LkeY4TNEWnXE6Le8w Message-ID: Subject: Re: [gentoo-user] Compile program with older libraries From: Markos Chandras To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7073a934-1a2a-4de0-b817-5b23f0555c58 X-Archives-Hash: 43b4926a0a9b0fac7f533f90d139a68a On Thu, May 24, 2012 at 2:58 PM, Marko Ko=C5=A1merl wro= te: > On compile time I get warnings: > watcher.cpp:(.text+0x85): warning: Using 'initgroups' in statically linke= d > applications requires at runtime the shared libraries from the glibc vers= ion > used for linking > watcher.cpp:(.text+0x16f): warning: Using 'getpwnam' in statically linked > applications requires at runtime the shared libraries from the glibc vers= ion > used for linking > client.cpp:(.text+0xb1a): warning: Using 'getaddrinfo' in statically link= ed > applications requires at runtime the shared libraries from the glibc vers= ion > used for linking > reg.cpp:(.text+0x3d6): warning: Using 'gethostbyname' in statically linke= d > applications requires at runtime the shared libraries from the glibc vers= ion > used for linking > > On running it: > ./watcher: /lib/libuuid.so.1: no version information available (required = by > ./watcher) > ./watcher: /lib/libc.so.6:e version `GLIBC_2.4' not found (required by > ./watcher) > ./watcher: /lib/libc.so.6: version `GLIBC_2.7' not found (required by > ./watcher) > ./watcher: /lib/libc.so.6: version `GLIBC_2.11' not found (required by > ./watcher) > > > On Thu, May 24, 2012 at 3:33 PM, Markos Chandras > wrote: >> >> On Thu, May 24, 2012 at 2:15 PM, Marko Ko=C5=A1merl = wrote: >> > Hi! >> > >> > I have some program which I am using in a thin client=C2=A0 which has = Gentoo >> > stage 3 root fs (kernel 2.6.39.4), >> > lets call it system A. >> > I've also compiled that program chroot-ed in this stage 3 fs from my >> > personal computer. >> > >> > I have an other thin clients which have older system (B) on it which i= s >> > older linux kernel 2.6.16.27. >> > Library version which are needed are of course different and for that >> > reason >> > my program >> > can not be run in this sistem. >> > >> > System A: >> > Linux redondo 2.6.39.4 #18 Mon Mar 19 13:14:32 CET 2012 i586 i586 i386 >> > GNU/Linux >> > /lib/libc-2.12.2.so >> > gcc version 4.0.3 >> > >> > System B: >> > Linux carlos=C2=A0 2.6.16.27 #1 Sun Mar 25 11:09:40 CEST 2007 i586 i58= 6 i386 >> > GNU/Linux >> > /lib/libc-2.3.6.so >> > gcc version 4.0.3 >> > >> > Shared libraries that my binary uses are (in system A): >> > linux-gate.so.1 =3D>=C2=A0 (0xffffe000) >> > libpthread.so.0 =3D> /lib/libpthread.so.0 (0xf76d6000) >> > libuuid.so.1 =3D> /lib/libuuid.so.1 (0xf76d1000) >> > libstdc++.so.6 =3D> /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libstdc++.so.= 6 >> > (0xf75da000) >> > libm.so.6 =3D> /lib/libm.so.6 (0xf75b2000) >> > libc.so.6 =3D> /lib/libc.so.6 (0xf7468000) >> > /lib/ld-linux.so.2 (0xf76f3000) >> > libgcc_s.so.1 =3D> /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libgcc_s.so.1 >> > (0xf7449000) >> > >> > If i try to compile my program using '-static' directive, I still have= a >> > problem with 4 functions: >> > -initgroups, >> > -getpwnam, >> > -getaddrinfo, >> > -gethostbyname. >> > >> > If I got that right, they use functions which are located in NSS share= d >> > libraries. >> > >> > I am looking for a way of compiling my program so that I can run it in >> > system B. >> > I have libraries available from system B and that is all that I have. >> > >> > I need help on getting this done. >> > I guess gcc versions are the same and as well libgcc_s.so.1 shared >> > library. >> > >> > My questions are: >> > Can I pull those libraries from system B and use it in compilatin >> > process? >> > Would that work? >> > I would still need to get include source files of that version, right? >> > Is there some archive site where I can find so old version of linux >> > kernel >> > source? >> > One thing that pops in to my mind is also trying to find gentoo stage = 3 >> > tarball of the kernel version 2.6.16.27 >> > and compile the program there...I tried to search that but no luck in >> > that... >> > >> > Any help would be welcomed! >> >> You can statically compile your program on system A ( use gcc -static >> -o test test.c for example ). Then you should be able to run it in >> system B without any problem >> > Why don't you want to compile the program in system B if you already have the libraries around?