Loading ...
Sorry, an error occurred while loading the content.

Re: Cross-compiling for different glibc (and other libs) versions

Expand Messages
  • scarecrow
    ... It can actually be a very simple process. We ve used the Freesco firewall/router which is a mini Linux based on Slackware 3.5, and will fit on a single
    Message 1 of 7 , Oct 1, 2003
      --- In LINUX_Newbies@yahoogroups.com, Horror Vacui <horrorvacui@g...>
      > This is probably the wrong group to ask this, but what the hell...
      > I've got an embedded PC running Linux that I want to compile
      > software for on my laptop. Currently I'm doing some RTFM on
      > cross-compiling

      It can actually be a very simple process. We've used the Freesco
      firewall/router which is a 'mini' Linux based on Slackware 3.5, and
      will fit on a single floppy. All programs in it are based on the old
      libc5 libraries. On our Debian machines, it was just a matter of
      installing the libc5-compat packages, then making sure that these old
      libraries were pointed to at compile time when building a program for
      Freesco. It requires adding the path to the older libraries before
      compiling. A little care is needed so that the path to these older
      libs aren't made perminent, just used when doing the compile of a
      program, and after it's done, libs paths are again pointing to the
      current libs required by the current system. We've used a small shell
      script to accomplish it.....

      PATH=/usr/i486-linuxlibc1/bin:$PATH configure


      PATH=/usr/i486-linuxlibc1/bin:$PATH make

      The paths shown above are what is used on the Debian machines, and are
      not necessarily valid for other distributions, but it gives a general
      idea. It's not a 100% guaranteed process, there are some programs
      whose source code is written with the newer libraries in mind, and
      will cause some errors when compiled/linked to the older libraries. In
      these cases either an older version of the program is needed, or some
      hacks to the existing code to make it backwards compatible.
      The key to the whole thing is the libc5-compat packages which, at
      least in Debian, install the older libs and components in such a way
      that they can live in harmony with current libs. Other distros
      probably have similar packages, I'm just not familiar with them.
      Finally, the ldd command can be used to see which libraries a program
      is linked with...

      Linux #> ldd cp
      libc.so.6 => /lib/libc.so.6 (0x40029000)
      /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

      ...shows the cp program is linked against libc6, the latest, greatest,
      current libs.....

      Linux #> ldd dnsmasq
      libc.so.5 => /lib/libc.so.5 (0x4001d000)

      ...here the dnsmasq program was compiled on the current Debian machine
      using the old libs, and shows that in fact libc5 was used.
    Your message has been successfully submitted and would be delivered to recipients shortly.