Sitemap
2 min readFeb 10, 2022

--

GNU Compiler Collection

GNU Compiler Collection

Definition

It is a compiler for GNU considered standard for Operating Systems derived from UNIX, Open Source or also proprietary Operating Systems.

GNU. As its name indicates, it is a collection of compilers and supports various languages: C,C++, Objetive C, Chill, Fortran, Ada y Java.

Compilation stages

The build process consists of four consecutive stages. From the human-written source program to the executable file, these four stages must be carried out in sequence. The Gcc and G++ commands can do the whole process in one go.

Preprocessed :

Statements in the preprocessing stage usually start with #, so the programs we write, such as #include and #define, are completed in this stage. We often use it when writing some stdio or iostream header file programs, not just simple In a sentence, there are some libraries that have been written, which we can directly reference here, so the preprocessing stage will open all the header files you reference and insert them into our own programs. On the other hand we have the comments, these comments are for our programmers to see, they have no effect on the program, so the machine cannot see the comments we write.

Get santiago osorno’s stories in your inbox

Join Medium for free to get updates from this writer.

Compilation :

The Compilation transforms the C Code into the Assembly Language of our machine's Processor.
Compilation will bring the programming of your program closer to machine language assembly language.

-S means that our file will only be compiled and not assembled to generate assembly code.

Assembly :

Assembly transforms the program written in Assembly Language into Object Code, a Binary File in Machine Language executable by the Processor.

-C means let our program execute the third stage to generate a machine language that the machine can understand.

Linked :

The link stage uses the existing code in the libraries to search for and assemble modules in object code. For example, some C functions like Printf are already inside the existing system libraries, the functions are already compiled and assembled.

--

--