Option files are a simple list of records in which each field occupies its own line and in which the records themselves are separated by blank lines. Comments may appear on their own line anywhere within the file and are preceded by semicolons. Whitespace is allowed before the semicolon.
The files can contain the following types of record:
gcc_optionsstructure, but these variables are also stored in the
cl_target_optionstructure. The variables are saved in the target save code and restored in the target restore code.
#ifdefsequences to properly set up the initialization. These records have two fields: the string ‘SourceInclude’ and the name of the include file.
This property is required; name must be a name (suitable for use
in C identifiers) used to identify the set of strings in
This property is required; type is the C type for variables set
by options using this enumeration together with
The message message will be used as an error message if the
argument is invalid; for enumerations without
generic error message is used. message should contain a single
‘%qs’ format, which will be used to format the invalid argument.
This property is required; name says which ‘Enum’ record this ‘EnumValue’ record corresponds to.
This property is required; string is the string option argument being described by this record.
This property is required; it says what value (representable as
int) should be used for the given string.
This property is optional. If present, it says the present string is the canonical one among all those with the given value. Other strings yielding that value will be mapped to this one so specs do not need to handle them.
This property is optional. If present, the present string will only be accepted by the driver. This is used for cases such as -march=native that are processed by the driver so that ‘gcc -v’ shows how the options chosen depended on the system on which the compiler was run.
By default, all options beginning with “f”, “W” or “m” are
implicitly assumed to take a “no-” form. This form should not be
listed separately. If an option beginning with one of these letters
does not have a “no-” form, you can use the
property to reject it.
The help text is automatically line-wrapped before being displayed. Normally the name of the option is printed on the left-hand side of the output and the help text is printed on the right. However, if the help text contains a tab character, the text to the left of the tab is used instead of the option’s name and the text to the right of the tab forms the help text. This allows you to elaborate on what type of argument the option takes.
target_flags(see Run-time Target) for each mask name x and set the macro
MASK_xto the appropriate bitmask. It will also declare a
TARGET_xmacro that has the value 1 when bit
MASK_xis set and 0 otherwise.
They are primarily intended to declare target masks that are not associated with user options, either because these masks represent internal switches or because the options are not available on all configurations and yet the masks always need to be defined.