Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Compile program with older libraries (http://www.linux-archive.org/gentoo-user/670490-compile-program-older-libraries.html)

Marko KoŇ°merl 05-24-2012 01:15 PM

Compile program with older libraries
 
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!

Markos Chandras 05-24-2012 01:33 PM

Compile program with older libraries
 
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

Marko KoŇ°merl 05-24-2012 01:58 PM

Compile program with older libraries
 
On compile time I get warnings:
watcher.cpp:(.text+0x85): warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
watcher.cpp:(.text+0x16f): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

client.cpp:(.text+0xb1a): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
reg.cpp:(.text+0x3d6): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version 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 <hwoarang@gentoo.org> wrote:

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

Markos Chandras 05-24-2012 02:10 PM

Compile program with older libraries
 
On Thu, May 24, 2012 at 2:58 PM, Marko KoŇ°merl <marko06@gmail.com> wrote:
> On compile time I get warnings:
> watcher.cpp:(.text+0x85): warning: Using 'initgroups' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
> watcher.cpp:(.text+0x16f): warning: Using 'getpwnam' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
> client.cpp:(.text+0xb1a): warning: Using 'getaddrinfo' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> used for linking
> reg.cpp:(.text+0x3d6): warning: Using 'gethostbyname' in statically linked
> applications requires at runtime the shared libraries from the glibc version
> 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 <hwoarang@gentoo.org>
> wrote:
>>
>> 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
>>
>

Why don't you want to compile the program in system B if you already
have the libraries around?

Marko KoŇ°merl 05-24-2012 02:50 PM

Compile program with older libraries
 
The following is the problem:
root@carlos:/tmp/temp# g++ hello.cc -o hello
g++: installation problem, cannot exec 'cc1plus': No such file or directory

Also there is no make tool in that system...



On Thu, May 24, 2012 at 4:10 PM, Markos Chandras <hwoarang@gentoo.org> wrote:

On Thu, May 24, 2012 at 2:58 PM, Marko KoŇ°merl <marko06@gmail.com> wrote:

> On compile time I get warnings:

> watcher.cpp:(.text+0x85): warning: Using 'initgroups' in statically linked

> applications requires at runtime the shared libraries from the glibc version

> used for linking

> watcher.cpp:(.text+0x16f): warning: Using 'getpwnam' in statically linked

> applications requires at runtime the shared libraries from the glibc version

> used for linking

> client.cpp:(.text+0xb1a): warning: Using 'getaddrinfo' in statically linked

> applications requires at runtime the shared libraries from the glibc version

> used for linking

> reg.cpp:(.text+0x3d6): warning: Using 'gethostbyname' in statically linked

> applications requires at runtime the shared libraries from the glibc version

> 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 <hwoarang@gentoo.org>

> wrote:

>>

>> 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

>>

>



Why don't you want to compile the program in system B if you already

have the libraries around?

Joshua Murphy 05-25-2012 10:55 AM

Compile program with older libraries
 
On Thu, May 24, 2012 at 9:15 AM, 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!

Well, you could use a chroot on system A to build it against an older
copy of the library. I can't find a stage3 with that range of glibc,
though if you can still track down sources to piece together a
toolchain, LFS 6.2 [1] is from right around that time frame (around
'06-'07). If anyone has a 2007.1 range stage3 laying around, though,
all the hard work's already done for setting up a perfect chroot as
long as it plays well with a newer kernel (or if you can do the build
in said chroot on system B), I've had issues with a too-new set of
libraries on older kernels more than once, not sure I've tried the
other direction.

[1] http://www.linuxfromscratch.org/lfs/view/6.2

--
Poison [BLX]
Joshua M. Murphy

Marko KoŇ°merl 05-28-2012 11:16 AM

Compile program with older libraries
 
I was able to find suitable gentoo stage 3 tarball:
http://88.191.254.16/gentoo/releases/x86/2007.0/stages/

Chrooted, compiled the source and tried to run binary it in old system. And it worked!


On Fri, May 25, 2012 at 12:55 PM, Joshua Murphy <poisonbl@gmail.com> wrote:

On Thu, May 24, 2012 at 9:15 AM, 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!



Well, you could use a chroot on system A to build it against an older

copy of the library. I can't find a stage3 with that range of glibc,

though if you can still track down sources to piece together a

toolchain, LFS 6.2 [1] is from right around that time frame (around

'06-'07). If anyone has a 2007.1 range stage3 laying around, though,

all the hard work's already done for setting up a perfect chroot as

long as it plays well with a newer kernel (or if you can do the build

in said chroot on system B), I've had issues with a too-new set of

libraries on older kernels more than once, not sure I've tried the

other direction.



[1] http://www.linuxfromscratch.org/lfs/view/6.2



--

Poison [BLX]

Joshua M. Murphy

Joshua Murphy 05-29-2012 06:29 AM

Compile program with older libraries
 
On Mon, May 28, 2012 at 7:16 AM, Marko KoŇ°merl <marko06@gmail.com> wrote:
> I was able to find suitable gentoo stage 3 tarball:
> http://88.191.254.16/gentoo/releases/x86/2007.0/stages/
>
> Chrooted, compiled the source and tried to run binary it in old system. And
> it worked!
>
>

Glad you got it working! I was worried you might have to go the long
way around...

--
Poison [BLX]
Joshua M. Murphy


All times are GMT. The time now is 02:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.