1. Build binary utilities
2. Build bootstrap compiler without glibc
3. Build C library
4. Rebuild compiler with glibc
2. Build bootstrap compiler without glibc
3. Build C library
4. Rebuild compiler with glibc
By default, gcc compiles the source code, assembles the assembly language code the compiler produces, and invokes the UNIX loader, Id, to produce an executable file.
Preprocessing: This step resolves directives like #define, #include, and #if. Like many UNIX systems, gcc invokes a separate utility called cpp to do the preprocessing.Compilation: This produces assembly language from the input files; since the assembler is usually invoked right away, the output is not normally saved in files.Assembly: This takes the assembly language as input and produces object files with extensions. While some compilers build in the assembly capability, gcc does it by internally invoking a separate utility called the assembler, gas. GNU assemblers aren't available for all architectures; if the GNU assembler isn't available, gcc invokes the "native" assembler (as).Linking: This is the final stage, where the modules are placed in their proper places in the executable file. Library functions that the program refers to are also placed in the file. (Systems with shared libraries use a slightly more complicated method.)