This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to add a flag to a tool if a particular define is present on the driver command line (using spec files)
- From: Ian Lance Taylor <iant at google dot com>
- To: asharif <asharif at gcc dot gnu dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 11 May 2011 11:52:23 -0700
- Subject: Re: How to add a flag to a tool if a particular define is present on the driver command line (using spec files)
- References: <BANLkTi=ooKL8UyedZ3x=K2upW_-adq5SMg@mail.gmail.com> <BANLkTi=xrFxCjgF-Bnpptp6_Syre1+h66g@mail.gmail.com>
asharif <asharif@gcc.gnu.org> writes:
> Up untilÂhttp://gcc.gnu.org/viewcvs?view=revision&revision=163770, you
> could have a line like this in the gcc driver spec file:
>
> cc1:
> %(cc1_cpu) %{profile:-p} %{DFOO: -foo}
>
> This would detect if -DFOO was given on the driver command line and
> would pass in -foo to cc1.
>
> However, after r163770 this stopped working.
>
> Is there a way to do this using current trunk (i.e., add a flag to a
> tool if a particular define is present on the gcc driver command
> line)? Was the old way broken or was there a bug introduced with
> revision r163770?
This doesn't work when preprocessing and compiling are separated, which
means that it doesn't work with distcc or ccache. I don't see any way
to fix that, so I don't think we're likely to resurrect this
functionality.
Ian