Starting with C: The GCC command
Well, this moves fast.
Hi again, I’m Lucía and I’m a student at Holberton School Colombia. We finished the second week yesterday and honestly, it has been harsh but also fun. I hope I’ll get better at programming as time goes.
We just started the C language and we met the gcc command. It stands for GNU Compiler Collection and its function is create an executable file through translation between languages. For example, in C we use an source code written in a .c file and when we “call” the gcc command it starts a process performed in 4 stages. First, we preprocess the code, in other words we ask the machine to take the code and prepare it to be processed and generate an assembly code, which is written considering the compatibility between the original code statements and the code instruction for the architecture’s machine.
Using some options of gcc command we can see what’s happening when we start this order to some .c file.
So, this is one of my codes. Let me introduce you to 3-prints-alphabet.c, a c code file which prints the alphabet in lower and uppercase. I run the gcc command in verbose mode and the -E option. I’ve got this:

It’s difficult to track what’s going on at that very moment, but the result of this process is a file which contains a code ready to be read for the second stage, the compile one.
Compiling makes the preprocessing code be treated as input and generates an assembly code. I run the command again, this time with an -S option and this is what happened:

This code isn’t ready to be read by the machine yet. The assemble stage translate it into machine code a.k.a object code. Using the command gcc and the option -c (which compile or assemble without the next process) I got this:

Finally we met the linker process. When you write your code, you make an statement about the libraries your code is going to use in order to make an executable as output. On this stage the gcc command links code and libraries to do so. So, in order to know what happens when all the process is complete, I ran gcc in verbose mode and this is the output:

Altough the input in every option is almost the same, we can see where the libraries are being searched through the system. After that, we can see the output when we execute the compilation process output. Maybe this code is too simple for this exercise but I’ll make some test with more complex code.