44Chapter3 • Compilers and Assemblers
GNU assembler is often needed in projects where you want to have tight
control over a particular part of code and want to write it in assembly lan-
guage. Most of the time people also write boot code for embedded sys-
tems in assembly language. The compiler uses assembler during the
compilation process to generate object code.
In addition to the most common compilers, we shall also discuss the use
of some less common languages in the Linux environment. These lan-
guages include the following:
•Oberon
•Smalltalk
•Ada
The compilation process is completed in different stages. These stages
are:
•Preprocessing
•Compiling to generate assembly language code
•Assembling to generate object code
•Linking to generate executable code
The GNU compiler takes help from many programs during this process
and can be used to generate intermediate files. For example, the compiler
can generate Assembly language code from a C source code file.
This chapter provides information about the GNU set of compilers and
how to build a software development environment using GNU tools. Dur-
ing this process you will also learn the building process for the GNU C
library, most commonly known as glibc.
3.1Introduction to GNU C and C++ Compilers
The GNU compiler, most commonly known as GCC, is not a single program. It is a large set of
programs, libraries and other utilities that work together to build source code into executable
form. A user, however, mostly interacts with gcc command. The gcc program acts as sort of a
front end for compilers and other utilities. This section is an introduction to the compiler and its
capabilities.
3.1.1Languages Supported by GCC
GCC is a family of compilers, also known as the GNU Compiler Collection. GCC sup-
ports multiple languages, including: