This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SUBTARGET_OPTIONS / SUBTARGET_SWITCHES with .opt
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 03 Apr 2005 22:04:56 +0100
- Subject: Re: SUBTARGET_OPTIONS / SUBTARGET_SWITCHES with .opt
- References: <20050331001554.GA25204@redhat.com>
Aldy Hernandez <aldyh@redhat.com> writes:
> I've been converting the ppc options to use the .opt machinery, and
> am confused as to how to approach subtargets.
>
> What's the deal with these?
>
> I need options only for certain subtargets. For example, aix.h has
> some options that should not be available by other targets.
>
> I don't see anything relevant in options.texi, and I don't see any
> converted backend that has this problem.
>
> Should we just include the options for all subtargets, or should we
> add generic functionality (I volunteer if so).
Sorry for the slow answer. I see Zack has already replied, and I guess
you've long figured this out, but just for the record:
The idea is that you only put the options that apply to all targets
in MACHINE.opt. If a subtarget has extra options, they should go
in their own .opt file and config.gcc should add those files to
$extra_options.
As for where this documented: well, it's actually in the "Anatomy of
a Target Back End" section (sourcebuild.texi):
A back end for a target architecture in GCC has the following parts:
[...]
@item
An optional @file{@var{machine}.opt} file in the @file{@var{machine}}
directory, containing a list of target-specific options. You can also
add other option files using the @code{extra_options} variable in
@file{config.gcc}. @xref{Options}.
...but as so often with gcc documentation, you can probably only find
it if you already know what it says.
Richard