Answer the question
In order to leave comments, you need to log in
What are the advantages of compiling in 4 steps rather than 1?
Good evening, dear connoisseurs!
The following question arose:
In the gcc compiler for the C language, you can write several options for commands to get an executable file:
1st way: gcc -o main.exe main.c
2nd way:
gcc –E main.c > main.i
gcc –S main.i
gcc –c main.s
gcc –o main.exe main.o
Answer the question
In order to leave comments, you need to log in
gcc is a collection of tools, each doing its own thing. In the first case, everything is automatically redirected to the next one in the chain, in the second, step by step. The ability to fully control the compilation process is useful - maybe I want to look at the assembler listing, or look at the result of the optimizer and understand why the code in these assembly parameters suddenly stopped working, look for compiler bugs .. well, or tritely try different linker parameters without affecting the rest of the compilation steps .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question