Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
difference between cc and cc1?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
LoTeK
Apprentice
Apprentice


Joined: 26 Jul 2012
Posts: 270

PostPosted: Fri Jan 25, 2013 8:33 pm    Post subject: difference between cc and cc1? Reply with quote

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
View user's profile Send private message
tony-curtis
Tux's lil' helper
Tux's lil' helper


Joined: 20 May 2006
Posts: 111

PostPosted: Sun Jan 27, 2013 9:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 8993
Location: beyond the rim

PostPosted: Mon Jan 28, 2013 7:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum