User:Phillid

From OSDev Wiki
Jump to navigation Jump to search

Introduction

This page is a summary of successful builds of a GCC Cross-Compiler by members of OSDev.org. The numbers refer to the versions being built, not the host compiler doing the build.

GCC Version 4.x.x

GCC / Binutils 2.24 2.23.2 2.23.1 2.23 2.22 2.21.1a 2.21 2.20.1 2.20 2.19.1 2.19 2.18 2.17 2.16.1 2.16
4.9.2 Yes ? ? ? ? ? ? ? ? ? ? ? ? ? ?
4.9.1 Yes ? ? ? ? ? ? ? ? ? ? ? ? ? ?
4.8.2 Yes Yes ? ? ? ? ? ? ? ? ? ? ? ? ?
4.8.1 ? Yes Yes ? ? ? ? ? ? ? ? ? ? ? ?
4.8.0 ? Yes ? ? Yes ? ? ? ? ? ? ? ? ? ?
4.7.2 ? ? Yes Yes ? ? ? ? ? ? ? ? ? ? ?
4.7.1 ? ? ? Yes Yes ? ? ? ? ? ? ? ? ? ?
4.7.0 ? ? ? Yes Yes ? ? ? ? ? ? ? ? ? ?
4.6.3 ? ? ? Yes Yes Yes ? ? ? ? ? ? ? ? ?
4.6.2 ? ? ? Yes Yes Yes ? ? ? ? ? ? ? ? ?
4.6.1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
4.6.0 ? ? ? ? ? ? Yes ? ? ? ? ? ? ? ?
4.5.2 ? ? ? ? ? ? Yes ? Yes ? ? ? ? ? ?
4.5.1 ? ? ? ? ? ? ? Yes Yes ? Yes ? ? ? ?
4.5.0 ? ? ? ? ? ? ? Yes ? ? ? ? ? ? ?
4.4.3 ? ? ? ? ? ? ? ? Yes ? ? ? ? ? ?
4.4.2 ? ? ? ? ? ? ? ? Yes ? ? ? ? ? ?
4.4.1 ? ? ? ? ? ? ? ? ? Yes ? ? ? ? ?
4.4.0 ? ? ? ? ? ? ? ? ? Yes Yes Yes ? ? ?
4.3.3 ? ? ? ? ? ? ? ? ? Yes Yes ? ? ? Yes
4.3.2 ? ? ? ? ? ? ? ? ? ? Yes Yes ? ? ?
4.3.1 ? ? ? ? ? ? ? ? ? ? ? Yes ? ? ?
4.3.0 ? ? ? ? ? ? ? ? ? ? ? Yes ? ? ?
4.2.4 ? ? ? ? ? ? ? ? ? Yes Yes Yes Yes ? ?
4.2.3 ? ? ? ? ? ? ? ? ? ? ? Yes ? ? ?
4.2.1 ? ? ? ? ? ? ? ? ? ? ? Yes ? ? ?
4.2.0 ? ? ? ? ? ? ? ? ? ? ? ? Yes ? ?
4.1.2 ? ? ? ? ? ? ? ? ? ? ? ? Yes ? ?
4.1.1 ? ? ? ? ? ? ? ? ? ? ? ? Yes Yes ?
4.0.3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? Yes
4.0.2 ? ? ? ? ? ? ? ? ? ? ? ? ? Yes Yes
4.0.1 ? ? ? ? ? ? ? ? ? ? ? ? ? Yes Yes
4.0.0 ? ? ? ? ? ? ? ? Yes ? Yes ? ? Yes Yes


  • If you plan to use GCC 4.3.0 or a later version, you will also have to install the following (using your system's package management):
    • GNU GMP (libgmp-devel on Cygwin, libgmp3-dev on apt-based systems, dev-libs/gmp on Gentoo)
      • Tutorial covering MSYS and MinGW builds of GMP
    • GNU MPFR (libmpfr-devel on Cygwin, libmpfr-dev on apt-based systems, dev-libs/mpfr on Gentoo)
  • If you plan to use GCC 4.5.0 or a later version, you will also have to install the following (using your system's package management):
    • MPC (libmpc-devel on Cygwin, libmpc-dev on apt-based systems, dev-libs/mpc on Gentoo)
  • If you plan to use GCC 4.5.0 or a later version, and you would like to build libstdc++, you need to compile with a 4.5.x series compiler. Depending on your configuration, you may also need the --disable-libstdcxx-pch configure option.

GCC Version 3.x.x

If for some reason, you need a GCC 3 build, these combinations have been tested. Note that if your code does not work with GCC 4, you usually have bigger problems.

Binutils / GCC 3.4.6 3.4.5 3.4.4 3.4.3
2.23.2 ? ? ? ?
2.23.1 ? ? ? ?
2.23 ? ? ? ?
2.22 ? ? ? ?
2.21.1(a) ? ? ? ?
2.21 ? ? ? ?
2.20.1 ? ? ? ?
2.20 ? ? ? ?
2.19.1 Yes ? ? ?
2.19 ? ? ? Yes
2.18 Yes ? Yes ?
2.17 Yes ? Yes ?
2.16.1 ? Yes Yes Yes
2.16 ? Yes Yes Yes

There have been successful builds with older versions, but many have (serious) problems as well. Mention of their specifics has been removed to keep this page short; please use up-to-date software.

GCC on Mac OS

Binutils / GCC 4.6.2 4.6.1 4.5.2 4.5.1 4.5.0 4.4.2 4.4.0 4.2.4
2.23.2 ? ? ? ? ? ? ? ?
2.23.1 ? ? ? ? ? ? ? ?
2.23 ? ? ? ? ? ? ? ?
2.22 ? ? ? ? ? ? ? ?
2.21.1(a) ? ? ? ? ? ? ? ?
2.21 ? Yes Yes ? ? ? ? ?
2.20.1 ? ? ? Yes Yes ? ? ?
2.20 ? ? ? ? Yes Yes ? ?
2.19.1 ? ? ? ? ? Yes Yes ?
2.18 ? ? ? ? ? ? ? Yes

When compiling GCC 4.3 or higher on OS X 10.4 and 10.5, you may get unresolved symbol errors related to libiconv. This is because the version shipped with OS X is seriously out of date. Install a new version (compile it yourself or use macports) and add --with-libiconv-prefix=/opt/local (or /usr/local if you compiled it yourself) to GCC's ./configure line. Alternatively you may place the libiconv source in gcc-x.y.z/libiconv and it will be compiled as part of the GCC compilation process. (This trick also works for mpfr and gmp).

See Also

Articles