What all gcc does

S

Sorav Bansal

Is there a way to print out all the operations performed in a gcc call:

eg. gcc foo.c -o foo

perhaps performs

foo.c --> foo.s (using compiler)
foo.s --> foo.o (using assembler as)
foo.o --> foo (using linker ld)

I am interested in the options gcc used when assembling and linking at the
intermediate steps.

thanks,
Sorav
 
A

Artie Gold

Sorav said:
Is there a way to print out all the operations performed in a gcc call:

eg. gcc foo.c -o foo

perhaps performs

foo.c --> foo.s (using compiler)
foo.s --> foo.o (using assembler as)
foo.o --> foo (using linker ld)

I am interested in the options gcc used when assembling and linking at the
intermediate steps.

thanks,
Sorav
As a matter of fact, there is. Though it's off topic here on
if you want verbose output, perhaps you should look at
your documentation to see how to get it.

Or, you could take the hint above.

HTH,
--ag
 
E

E. Robert Tisdale

Sorav said:
Is there a way to print out all the operations performed in a gcc call:

eg. gcc foo.c -o foo

perhaps performs

foo.c --> foo.s (using compiler)
foo.s --> foo.o (using assembler as)
foo.o --> foo (using linker ld)

I am interested in the options gcc used
when assembling and linking at the intermediate steps.

Try the gnu.gcc.help newsgroup.

gcc -v -Wall -std=c99 -pedantic -o main main.c
Reading specs from \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc-3.4.1.src/configure
Thread model: posix
gcc version 3.4.1
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.1/cc1 \
-quiet -v main.c -quiet -dumpbase main.c -mtune=pentiumpro \
-auxbase main -Wall -pedantic -std=c99 -version \
-o /tmp/ccKyMHYc.s
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/include
/usr/include
End of search list.
GNU C version 3.4.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.4.1.
GGC heuristics: --param ggc-min-expand=64 \
--param ggc-min-heapsize=64329
as -V -Qy -o /tmp/ccQvmn4g.o /tmp/ccKyMHYc.s
GNU assembler version 2.15.90.0.3 (i386-redhat-linux) \
using BFD version 2.15.90.0.3 20040415
/usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.1/collect2 \
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 \
-o main /usr/lib/crt1.o /usr/lib/crti.o \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/crtbegin.o \
-L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1 \
-L/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/../../.. \
/tmp/ccQvmn4g.o -lgcc --as-needed -lgcc_s --no-as-needed \
-lc -lgcc --as-needed -lgcc_s --no-as-needed \
/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.1/crtend.o \
/usr/lib/crtn.o
 
N

No_One

Is there a way to print out all the operations performed in a gcc call:

eg. gcc foo.c -o foo

perhaps performs

foo.c --> foo.s (using compiler)
foo.s --> foo.o (using assembler as)
foo.o --> foo (using linker ld)

I am interested in the options gcc used when assembling and linking at the
intermediate steps.

thanks,
Sorav

maybe the -v option

ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,163
Messages
2,570,897
Members
47,434
Latest member
TobiasLoan

Latest Threads

Top