Is there a possibility to let gcc (MinGW/Windows) to show all command lines called?
Example:
gcc -o test.exe test.c -desiredOption
... should output something like this:
cc1 -o intermediate.s test.c
as -o intermediate.o intermediate.s
ld - o test.exe intermediate.o crt0.o -lsomelibrary -e __start
Background:
Sometimes some assembler-related options work well when I call "gcc" but they do not work at all when I try to call "ld.exe" directly. Therefore I want to know which option is really passed to "ld.exe" by "gcc.exe".
Under Linux I would use something like:
strace -f gcc -o test.exe test.c
... to see the command lines (as arguments of the execve
system calls).
Make sure to set value in the System variable and not in the user variable. Add gcc compiler path upto bin folder in the variable value as shown below and click OK. Close all windows and open new command prompt and compile your program. Now it will compile your program without any error.
In the Command Prompt window type “gcc” and hit enter. If the output says something like “gcc: fatal error: no input files”, that is good, and you pass the test. Save this answer.
Location and Overview: City Centre 1 in Salt Lake City Sector 1, Kolkata is a top player in the category Malls in the Kolkata.
cc1 is also referred to as the compiler proper. cc1 preprocesses a c translation unit and compiles it into assembly code. The assembly code is converted into an object file with the assembler. Earlier versions of cc1 used /usr/bin/cpp for the preprocessing stage.
Read the Invoking GCC chapter of the GCC documentation.You want the -v
option:
Print (on standard error output) the commands executed to run the stages of compilation. Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.
Notice that on Linux, strace(1) does not show command lines, but system calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With