Chapter 2 39
What Happens When You Compile and Link a Program
Looking “inside” a Compiler
-D__unix -D_PA_RISC1_1
cc: Entering Preprocessor.
/opt/ansic/lbin/ccom /var/tmp/ctmAAAa10102 func.o -O0 -Aa
cc: LPATH is /usr/lib/pa1.1:/usr/lib:/opt/langtools/lib:
/usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main main.o func.o \\
-lm -lc
cc: Entering Link editor.
This example shows that the cc driver calls the C preprocessor
(/opt/langtools/lbin/cpp.ansi) for each source file, then calls the
actual C compiler (/opt/ansic/lbin/ccom) to create the object files.
Finally, the driver calls the linker (/usr/ccs/bin/ld) on the object files
created by the compiler (main.o and func.o).