This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Can collect2 just generate the c file?
- From: John Love-Jensen <eljay at adobe dot com>
- To: Perry Smith <pedz at easesoftware dot net>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Fri, 13 Jan 2006 15:32:01 -0600
- Subject: Re: Can collect2 just generate the c file?
Hi Perry,
> Can I call g++ with arguments so that it will generate the source file and
then stop.
Yes, there are two stopping places:
g++ -E foo.cpp -o foo.ii
Stops after the preprocessor.
g++ -S foo.cpp -o foo.s
Stops after the compilation to assembler.
>I assume it is a .c file
No, it is either a .ii (preprocessed) file or a .s (assembler) file.
> I want to call the linker myself. I think that is going to be easier to do in
my situation.
Ummm... well, to invoke the linker you probably want yet another stopping
place:
g++ -c foo.cpp -o foo.o
Stops after the creation of the .o (object) file.
But that's not a "generate the source file and then stop" kind of stopping
place.
Anyway, remember to use g++ to invoke the linker. The g++ front end is a
tool-chain driver, and will invoke the linker correctly.
HTH,
--Eljay