Changes to gcc 3.x to invoke an external cpp (updated patch 2)
Ashif S. Harji
asharji@plg2.math.uwaterloo.ca
Tue Dec 25 03:03:00 GMT 2001
On Mon, 24 Dec 2001, Bernd Schmidt wrote:
> On Mon, 24 Dec 2001, Ashif S. Harji wrote:
>
> > For the past 10 years, we have
> > been developing concurrency software (uC++) that piggy-backs on g++. This
> > software uses an additional preprocessor to change the source text *after*
> > being processed by cpp. For the past 10 years, we have used the -B flag to
> > supply our own cpp driver that first invokes the standard cpp and then our cpp.
>
> > However, with the integrated cpp, we can no longer use this
> > mechanism as our user-supplied cpp in the -B directory is no longer invoked
> > unless the -save-temps flag is used, which produces unnecessary files so this
> > is not a clean solution.
>
> Seems to me that this would be most cleanly done in your Makefiles without
> relying on gcc internals. Pick a new filename extension (e.g. ".x"), then:
>
> .x.o:
> $(CC) -E $< -o tmp1
> my-preprocess tmp1 >tmp2.i
> $(CC) tmp2.i -o $@
> rm tmp1 tmp2.i
We have tried to address why using the -E flag is not sufficient in
previous messages. Please refer to:
http://gcc.gnu.org/ml/gcc-patches/2001-12/msg00441.html
http://gcc.gnu.org/ml/gcc-patches/2001-12/msg00762.html
and the follow up discussion.
As well, since Makefiles are created by the users of our software, the
above approach is not feasible.
ashif.
More information about the Gcc-patches
mailing list