Default compiler flags in specs file

Nix nix@esperi.org.uk
Mon Nov 22 14:58:00 GMT 2004


On 17 Nov 2004, Asfand Yar Qazi uttered the following:
> Does anybody know if its possible to change the default compiler flags
> gcc sends to the cc1 and cc1plus commands in the specs file?

You can change them there --- although as it makes your makefiles have
different effects on your system than on others', you might not like to
do that.

> I'm talking about flags like -mtune, etc. which seem to appear when
> gcc is called as 'gcc -v'.

You'd better add them in a new specs line called from *cpp:, *cc1:, and
*cc1plus:, since it should be defined before the *cpp_cpu line is
reached.

Myself, I'd prefer to use a site-config file and/or a makefile fragment.

-- 
`The sword we forged has turned upon us
 Only now, at the end of all things do we see
 The lamp-bearer dies; only the lamp burns on.'



More information about the Gcc-help mailing list