Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] Compile program with older libraries Markos Chandras <hwoarang@g.o>