Re: Can collect2 just generate the c file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux