The Debian GNU Compiler Collection Setup ======================================== Abstract -------- Debian uses a default version of GCC for most packages; however, some packages require another version. So, Debian allows several versions of GCC to coexist on the same system, and selects the default version by means of the gcc-defaults package, which creates symbolic links as appropriate. Versions of GCC present in Debian Lenny --------------------------------------- - GCC 4.3 is the default compiler for Ada, Fortran 95, and Java on all architectures. This package also provides libgcc1, libgcc2 (m68k) and libgcc4 (hppa) which contain the GCC intrinsics, and libstdc++6. GCC-4.3 is the default compiler for C, C++, Objective-C and Objective-C++ on all architectures except alpha, amd64, hppa and i386. - GCC-4.2 is the default compiler for C, C++, Objective-C and Objective-C++ on the architectures alpha, amd64, hppa and i386. - GCC 4.1 is the default compiler for D and Pascal. - GCC 3.4 is provided for the C, but is not the default for any language. - GCC 3.3 is not provided anymore; it is used to build libstdc++5 on the amd64 and i386 architectures. It is expected that libstdc++5 is not available anymore for the release following Lenny. - GCC 2.95 and GCC 2.7.2.3 were removed for the release of Lenny. How are the default compilers selected? --------------------------------------- Starting in Debian 3.0, there is now a gcc-defaults package set. This creates the actual packages for gcc, gnat, g++, gobjc, chill, gcj, gij, gdc and gpc. These packages will depend on the corresponding default compiler for that architecture. For Debian 4.0 for example, "gcc" depends on "gcc-4.1", which means that the "gcc-4.1" package will install a binary called "gcc-4.1", which is symlinked to in the "gcc" package as "gcc". This may seem confusing, but what it allows you do to is install more than one version of the GCC compiler collection at the same time, making sure you are always using the one preferred for that architecture. To use the other compiler, simply set CC=gcc-4.1, or similar. The default compiler versions for Debian GNU/Linux on i386 are (minor version numbers omitted): cpp : cpp-4.3 gcc : gcc-4.3 g++ : g++-4.3 gfortran : gfortran-4.3 gcj : gcj-4.3 gij : gij-4.3 gobjc : gobjc-4.3 gobjc++ : gobjc++-4.3 gnat : gnat-4.3 gpc : gpc-4.1 gdc : gdc-4.1 Most of the documentation for GCC including the manual pages is licensed under the GFDL and therefore not included in the main section. Thanks to gcc-defaults, each architecture can choose its own preferred compiler for each language, and that preference can change without requiring a complete rebuild of both compiler packages for all architectures. Practical implications ---------------------- The most important practical implications are in the merging/linking of object files built with different compilers; If you use the 4.1 C compiler, you should use the gcc-4.1 compiler driver for all your work. When configuring sources, use CC=gcc-4.1 ./configure # bash setenv CC gcc-4.1; ./configure # csh When calling make, use make CC=gcc-4.1. C Application Binary Interface ------------------------------ Starting with Lenny, gcc-4.1 and newer compilers do support the long double datatype with 128bit on the alpha, powerpc, s390 and sparc architectures. Libraries and applications using this datatype have to be rebuilt using the compiler versions in Lenny unless these depend on libc6/libc6.1 and libstdc++6, which still have compatibilty with a 64bit long double datatype. gcc/g++/... are not handled using alternatives ---------------------------------------------- The symlinks in /usr/bin (gcc, g++, ...) are not handled using the Debian alternative mechanism. There are differences in the architecture specific ABI on some architectures and the C++ ABI differs as well. Having the symlinks managed by alternatives doesn't allow reliable builds with the same major/minor version of the compiler. To use another compiler version, set the appropriate environment variables as described above in the section "Practical implications". C++ libraries ------------- To use the libstdc++ library for debugging (found in the libstd++-dbg package), add /usr/lib/debug to your LD_LIBRARY_PATH. For gdb to display the source you need to get the correspondig gcc-X.Y source package, unpack the source and point gdb to the location of the source (dir directive). C++ Application Binary Interface -------------------------------- Sometimes, the C++ ABI of GCC changes. It is impossible to link object files that obey different ABIs into an executable. When the ABI changes, Debian provides a new version of libstdc++ with a new soname. Version 4 of the ABI was used by GCC 3.0 and 3.1; it is no longer supported. Version 5 of the ABI is common to GCC 3.2 and 3.3; GCC 3.3 provides libstdc++5. It is only supported as a runtime library. Version 6 of the ABI is common to GCC 3.4 and later; GCC 4.3 provides libstdc++6. Bugs ---- Before submitting a bug, please read README.Bugs in this directory. Feedback appreciated -------------------- Feedback about this document is appreciated; preferably as a Severity: wishlist bug against Package: gcc . For general discussions and questions, subscribe and/or email the debian-gcc@lists.debian.org mailing list. Maintainers of these packages ----------------------------- Matthias Klose Ray Dassen Philip Blundell (arm-linux) Jeff Bailey (hurd-i386) Joel Baker (netbsd-i386) Ben Collins (sparc-linux) Falk Hueffner (alpha-linux) Randolph Chung (ia64-linux, hppa-linux) Thiemo Seufer (mips*-linux) Dan Jacobowitz (powerpc-linux) Gerhard Tonn (s390-linux) Roman Zippel (m68k-linux) Ludovic Brenta (gnat) Arthur Loiret (gdc) ===============================================================================