From: Markos Chandras <hwoarang@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Compile program with older libraries
Date: Thu, 24 May 2012 14:33:23 +0100 [thread overview]
Message-ID: <CAG2jQ8jL4wQcVsRmtL7H-3y=Rmy0Y_c-=tkYzZMF0hV0C95Whw@mail.gmail.com> (raw)
In-Reply-To: <CAEapCsg0w=Cr=36EgR8L-0TrDGSb_tGFGdCQxbS2MK=hh+VgdQ@mail.gmail.com>
On Thu, May 24, 2012 at 2:15 PM, Marko Košmerl <marko06@gmail.com> wrote:
> Hi!
>
> I have some program which I am using in a thin client 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 is
> 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 2.6.16.27 #1 Sun Mar 25 11:09:40 CEST 2007 i586 i586 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 => (0xffffe000)
> libpthread.so.0 => /lib/libpthread.so.0 (0xf76d6000)
> libuuid.so.1 => /lib/libuuid.so.1 (0xf76d1000)
> libstdc++.so.6 => /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libstdc++.so.6
> (0xf75da000)
> libm.so.6 => /lib/libm.so.6 (0xf75b2000)
> libc.so.6 => /lib/libc.so.6 (0xf7468000)
> /lib/ld-linux.so.2 (0xf76f3000)
> libgcc_s.so.1 => /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 shared
> 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
next prev parent reply other threads:[~2012-05-24 13:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-24 13:15 [gentoo-user] Compile program with older libraries Marko Košmerl
2012-05-24 13:33 ` Markos Chandras [this message]
2012-05-24 13:58 ` Marko Košmerl
2012-05-24 14:10 ` Markos Chandras
2012-05-24 14:50 ` Marko Košmerl
2012-05-25 10:55 ` Joshua Murphy
2012-05-28 11:16 ` Marko Košmerl
2012-05-29 6:29 ` Joshua Murphy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAG2jQ8jL4wQcVsRmtL7H-3y=Rmy0Y_c-=tkYzZMF0hV0C95Whw@mail.gmail.com' \
--to=hwoarang@gentoo.org \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox