Gentoo Archives: gentoo-user

From: Markos Chandras <hwoarang@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Compile program with older libraries
Date: Thu, 24 May 2012 13:36:14
Message-Id: CAG2jQ8jL4wQcVsRmtL7H-3y=Rmy0Y_c-=tkYzZMF0hV0C95Whw@mail.gmail.com
In Reply to: [gentoo-user] Compile program with older libraries by "Marko Košmerl"
1 On Thu, May 24, 2012 at 2:15 PM, Marko Košmerl <marko06@×××××.com> wrote:
2 > Hi!
3 >
4 > I have some program which I am using in a thin client  which has Gentoo
5 > stage 3 root fs (kernel 2.6.39.4),
6 > lets call it system A.
7 > I've also compiled that program chroot-ed in this stage 3 fs from my
8 > personal computer.
9 >
10 > I have an other thin clients which have older system (B) on it which is
11 > older linux kernel 2.6.16.27.
12 > Library version which are needed are of course different and for that reason
13 > my program
14 > can not be run in this sistem.
15 >
16 > System A:
17 > Linux redondo 2.6.39.4 #18 Mon Mar 19 13:14:32 CET 2012 i586 i586 i386
18 > GNU/Linux
19 > /lib/libc-2.12.2.so
20 > gcc version 4.0.3
21 >
22 > System B:
23 > Linux carlos  2.6.16.27 #1 Sun Mar 25 11:09:40 CEST 2007 i586 i586 i386
24 > GNU/Linux
25 > /lib/libc-2.3.6.so
26 > gcc version 4.0.3
27 >
28 > Shared libraries that my binary uses are (in system A):
29 > linux-gate.so.1 =>  (0xffffe000)
30 > libpthread.so.0 => /lib/libpthread.so.0 (0xf76d6000)
31 > libuuid.so.1 => /lib/libuuid.so.1 (0xf76d1000)
32 > libstdc++.so.6 => /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libstdc++.so.6
33 > (0xf75da000)
34 > libm.so.6 => /lib/libm.so.6 (0xf75b2000)
35 > libc.so.6 => /lib/libc.so.6 (0xf7468000)
36 > /lib/ld-linux.so.2 (0xf76f3000)
37 > libgcc_s.so.1 => /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libgcc_s.so.1
38 > (0xf7449000)
39 >
40 > If i try to compile my program using '-static' directive, I still have a
41 > problem with 4 functions:
42 > -initgroups,
43 > -getpwnam,
44 > -getaddrinfo,
45 > -gethostbyname.
46 >
47 > If I got that right, they use functions which are located in NSS shared
48 > libraries.
49 >
50 > I am looking for a way of compiling my program so that I can run it in
51 > system B.
52 > I have libraries available from system B and that is all that I have.
53 >
54 > I need help on getting this done.
55 > I guess gcc versions are the same and as well libgcc_s.so.1 shared library.
56 >
57 > My questions are:
58 > Can I pull those libraries from system B and use it in compilatin process?
59 > Would that work?
60 > I would still need to get include source files of that version, right?
61 > Is there some archive site where I can find so old version of linux kernel
62 > source?
63 > One thing that pops in to my mind is also trying to find gentoo stage 3
64 > tarball of the kernel version 2.6.16.27
65 > and compile the program there...I tried to search that but no luck in
66 > that...
67 >
68 > Any help would be welcomed!
69
70 You can statically compile your program on system A ( use gcc -static
71 -o test test.c for example ). Then you should be able to run it in
72 system B without any problem

Replies

Subject Author
Re: [gentoo-user] Compile program with older libraries "Marko Košmerl" <marko06@×××××.com>