Determining Versions of the Software

If you want to avoid compatibility problems, it's important to build cross-compiler targeted for particular version of Linux.

Unlike Windows, version numbers of specific distribution of Linux (for example, Ubuntu 9 or Debian 6) are unimportant in the context of cross-compilation.

What's important then? You should note the combination of "gcc version" + "binutils version" + "glibc version" + "kernel version".

1) Version of gcc (GNU compiler collection)
To determine it, log in to the installation of target Linux version (for example, Ubuntu 9) and run the following command in the console:
$ gcc --version

Sample output:

gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Also running "gcc -v" may be helpful, it shows options that were passed for "configure" script when gcc was built for the target system.

2) Version and target architecture of binutils (GNU linker, assembler etc)
To determine it:
$ ld --version
$ as --version

Sample output:

GNU ld (GNU Binutils for Ubuntu) 2.20
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

GNU assembler (GNU Binutils for Ubuntu) 2.20
Copyright 2009 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of
`i486-linux-gnu'.

Target architecture is also important to note, example above shows target architecture for GNU assember on 32-bit Ubuntu 9. GNU assembler on 64-bit Ubuntu 9 prints x64_64-linux-gnu .

3) Version of glibc (GNU libc)
To determine it:
$ ldd --version

Sample output:

ldd (EGLIBC) 2.10.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.

4) Kernel version
To determine it:
$ uname -r

Sample output:

2.6.31-14-generic


>> Read next section or buy already prepared cross-compiler (€10) to save your time.