From: | "Marko Košmerl" <marko06@×××××.com> | ||
---|---|---|---|

To: | gentoo-user@l.g.o | ||

Subject: | Re: [gentoo-user] Compile program with older libraries |
||

Date: | Mon, 28 May 2012 11:18:14 | ||

Message-Id: | CAEapCshfVvEc=FT7LMzYr=5BtefBbtM7Ok7Wo81M+4sPkmGCPQ@mail.gmail.com |
||

In Reply to: | Re: [gentoo-user] Compile program with older libraries by Joshua Murphy |

1 | I was able to find suitable gentoo stage 3 tarball: |

2 | http://88.191.254.16/gentoo/releases/x86/2007.0/stages/ |

3 | |

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

5 | it worked! |

6 | |

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

8 | |

9 | > On Thu, May 24, 2012 at 9:15 AM, Marko Košmerl <marko06@×××××.com> wrote: |

10 | > > Hi! |

11 | > > |

12 | > > I have some program which I am using in a thin client which has Gentoo |

13 | > > stage 3 root fs (kernel 2.6.39.4), |

14 | > > lets call it system A. |

15 | > > I've also compiled that program chroot-ed in this stage 3 fs from my |

16 | > > personal computer. |

17 | > > |

18 | > > I have an other thin clients which have older system (B) on it which is |

19 | > > older linux kernel 2.6.16.27. |

20 | > > Library version which are needed are of course different and for that |

21 | > reason |

22 | > > my program |

23 | > > can not be run in this sistem. |

24 | > > |

25 | > > System A: |

26 | > > Linux redondo 2.6.39.4 #18 Mon Mar 19 13:14:32 CET 2012 i586 i586 i386 |

27 | > > GNU/Linux |

28 | > > /lib/libc-2.12.2.so |

29 | > > gcc version 4.0.3 |

30 | > > |

31 | > > System B: |

32 | > > Linux carlos 2.6.16.27 #1 Sun Mar 25 11:09:40 CEST 2007 i586 i586 i386 |

33 | > > GNU/Linux |

34 | > > /lib/libc-2.3.6.so |

35 | > > gcc version 4.0.3 |

36 | > > |

37 | > > Shared libraries that my binary uses are (in system A): |

38 | > > linux-gate.so.1 => (0xffffe000) |

39 | > > libpthread.so.0 => /lib/libpthread.so.0 (0xf76d6000) |

40 | > > libuuid.so.1 => /lib/libuuid.so.1 (0xf76d1000) |

41 | > > libstdc++.so.6 => /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libstdc++.so.6 |

42 | > > (0xf75da000) |

43 | > > libm.so.6 => /lib/libm.so.6 (0xf75b2000) |

44 | > > libc.so.6 => /lib/libc.so.6 (0xf7468000) |

45 | > > /lib/ld-linux.so.2 (0xf76f3000) |

46 | > > libgcc_s.so.1 => /usr/lib/gcc/i486-pc-linux-gnu/4.4.5/libgcc_s.so.1 |

47 | > > (0xf7449000) |

48 | > > |

49 | > > If i try to compile my program using '-static' directive, I still have a |

50 | > > problem with 4 functions: |

51 | > > -initgroups, |

52 | > > -getpwnam, |

53 | > > -getaddrinfo, |

54 | > > -gethostbyname. |

55 | > > |

56 | > > If I got that right, they use functions which are located in NSS shared |

57 | > > libraries. |

58 | > > |

59 | > > I am looking for a way of compiling my program so that I can run it in |

60 | > > system B. |

61 | > > I have libraries available from system B and that is all that I have. |

62 | > > |

63 | > > I need help on getting this done. |

64 | > > I guess gcc versions are the same and as well libgcc_s.so.1 shared |

65 | > library. |

66 | > > |

67 | > > My questions are: |

68 | > > Can I pull those libraries from system B and use it in compilatin |

69 | > process? |

70 | > > Would that work? |

71 | > > I would still need to get include source files of that version, right? |

72 | > > Is there some archive site where I can find so old version of linux |

73 | > kernel |

74 | > > source? |

75 | > > One thing that pops in to my mind is also trying to find gentoo stage 3 |

76 | > > tarball of the kernel version 2.6.16.27 |

77 | > > and compile the program there...I tried to search that but no luck in |

78 | > > that... |

79 | > > |

80 | > > Any help would be welcomed! |

81 | > |

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

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

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

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

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

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

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

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

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

91 | > other direction. |

92 | > |

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

94 | > |

95 | > -- |

96 | > Poison [BLX] |

97 | > Joshua M. Murphy |

98 | > |

99 | > |

Subject | Author |
---|---|

Re: [gentoo-user] Compile program with older libraries | Joshua Murphy <poisonbl@×××××.com> |

All times displayed are in UTC (GMT+0).

Contents reflect the opinion of the author, not the Gentoo project or the Gentoo Foundation.

Gentoo is a trademark of the Gentoo Foundation, Inc. The contents of this document, unless otherwise expressly stated, are licensed under the CC-BY-SA-4.0 license. The Gentoo Name and Logo Usage Guidelines apply.