View previous topic :: View next topic |
Author |
Message |
LoTeK Apprentice
Joined: 26 Jul 2012 Posts: 270
|
Posted: Fri Jan 25, 2013 8:33 pm Post subject: difference between cc and cc1? |
|
|
hi,
I'm reading "computer systems - a programmer's perspective" at the moment and there is an explanation of the "lifetime" of a C-program (hello.c):
hello.c (source) [cpp]--> hello.i (modified source) [cc1]--> hello.s (assembly program) [as]--> hello.o (object code) [ld]--> hello (ex. binary)
so I've done: Code: | cpp hello.c -o hello.i | then I didn't found cc1 on my system expect for:
Code: | /usr/lib64/nacl-toolchain-newlib/libexec/gcc/x86_64-nacl/4.4.3/cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.6.3/cc1 | so I've run:
Code: | cc hello.i -o hello.s | but now I can't run: Code: | as hello.s -o hello.o | because:http://bpaste.net/show/72822/ (my program is called systemcode.c not hello.c) the hello.s file is an executable assembly-code program.
I didn't found anything on google.. _________________ "I want to see gamma rays! I want to hear X-rays! Do you see the absurdity of what I am? I can't even express these things properly because I have to conceptualize complex ideas in this stupid limiting spoken language!"
Last edited by LoTeK on Sun Jan 27, 2013 10:08 pm; edited 1 time in total |
|
Back to top |
|
|
tony-curtis Tux's lil' helper
Joined: 20 May 2006 Posts: 111
|
Posted: Sun Jan 27, 2013 9:42 pm Post subject: |
|
|
Those are internal compiler phases invoked by the userland driver program (gcc, icc, etc) and aren't generally meant for separate use by the programmer.
(And the phases invoked vary from compiler to compiler and depend on which flags are used) |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9527 Location: beyond the rim
|
Posted: Mon Jan 28, 2013 7:54 am Post subject: |
|
|
Don't know if it differs when being called as cc, but gcc by default will try to generate object files from its input. You will have to pass extra options to avoid the assembly stage being invoked automatically. |
|
Back to top |
|
|
|