This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFC] Let's kill specs, completely rewrite gcc.c

Hi Neil,

: I would like to suggest a different approach, along the following 
: rough lines:

This sounds like a good idea to me.

: 7) Each compiler has a hook, and it is passed the flagged command-line
:    argument list from 4).  This, and the usage counts in 4), makes it
:    easy to do cleanly extra processing of the kind currently handled
:    by specs like
:    %{ffast-math:-D__FAST_MATH__}
:    %{MMD:-MM -MF %b.d}
:    At the same time, the compiler-specific hook extracts all the
:    switches flagged for use by its compiler, builds the relevant
:    command line, and invokes its compiler.

The compiler specific hook will also need to call a backend specific
hook, since targets can have target-specific and language-specific
command line option processing requirements.  Eg certain target
specific options may be incompatible with each other, or certain
options may require that certain strings get -D defined to the

There is still a need for permanent run-time configuration of command
line options.  SPEC scripts used to be able to do this, but if we do
not support them, then we will need to provide another mechanism.
Perhaps a new command line option which takes a file name argument,
reads the file, parses it and adds the contents as new entries in the
builtin command line option table.  Possibly there should be an
environment variable which would have the same effect as well.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]