GCC Middle and Back End API Reference
gcc.c File Reference

Data Structures

struct  default_spec
struct  user_specs
struct  compiler
struct  prefix_list
struct  path_prefix
struct  spec_list
struct  spec_list_1
struct  temp_name
struct  temp_file
struct  add_to_obstack_info
struct  file_at_path_info
struct  switchstr
struct  infile
struct  spec_path_info
struct  mdswitchstr

Typedefs

typedef char * char_p
typedef const char * const_char_p

Enumerations

enum  save_temps { SAVE_TEMPS_NONE, SAVE_TEMPS_CWD, SAVE_TEMPS_OBJ }
enum  path_prefix_priority { PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST }

Functions

static void init_spec (void)
static void store_arg (const char *, int, int)
static void insert_wrapper (const char *)
static char * load_specs (const char *)
static void read_specs (const char *, bool, bool)
static void set_spec (const char *, const char *, bool)
static struct compilerlookup_compiler (const char *, size_t, const char *)
static char * build_search_list (const struct path_prefix *, const char *, bool, bool)
static void xputenv (const char *)
static void putenv_from_prefixes (const struct path_prefix *, const char *, bool)
static int access_check (const char *, int)
static char * find_a_file (const struct path_prefix *, const char *, int, bool)
static void add_prefix (struct path_prefix *, const char *, const char *, int, int, int)
static void add_sysrooted_prefix (struct path_prefix *, const char *, const char *, int, int, int)
static char * skip_whitespace (char *)
static void delete_if_ordinary (const char *)
static void delete_temp_files (void)
static void delete_failure_queue (void)
static void clear_failure_queue (void)
static int check_live_switch (int, int)
static const char * handle_braces (const char *)
static bool input_suffix_matches (const char *, const char *)
static bool switch_matches (const char *, const char *, int)
static void mark_matching_switches (const char *, const char *, int)
static void process_marked_switches (void)
static const char * process_brace_body (const char *, const char *, const char *, int, int)
static struct spec_functionlookup_spec_function (const char *)
static const char * eval_spec_function (const char *, const char *)
static const char * handle_spec_function (const char *)
static char * save_string (const char *, int)
static void set_collect_gcc_options (void)
static int do_spec_1 (const char *, int, const char *)
static int do_spec_2 (const char *)
static void do_option_spec (const char *, const char *)
static void do_self_spec (const char *)
static const char * find_file (const char *)
static int is_directory (const char *, bool)
static const char * validate_switches (const char *, bool)
static void validate_all_switches (void)
static void validate_switches_from_spec (const char *, bool)
static void give_switch (int, int)
static int used_arg (const char *, int)
static int default_arg (const char *, int)
static void set_multilib_dir (void)
static void print_multilib_info (void)
static void perror_with_name (const char *)
static void display_help (void)
static void add_preprocessor_option (const char *, int)
static void add_assembler_option (const char *, int)
static void add_linker_option (const char *, int)
static void process_command (unsigned int, struct cl_decoded_option *)
static int execute (void)
static void alloc_args (void)
static void clear_args (void)
static void fatal_signal (int)
static void init_gcc_specs (struct obstack *, const char *, const char *, const char *)
static const char * convert_filename (const char *, int, int)
static const char * getenv_spec_function (int, const char **)
static const char * if_exists_spec_function (int, const char **)
static const char * if_exists_else_spec_function (int, const char **)
static const char * replace_outfile_spec_function (int, const char **)
static const char * remove_outfile_spec_function (int, const char **)
static const char * version_compare_spec_function (int, const char **)
static const char * include_spec_function (int, const char **)
static const char * find_file_spec_function (int, const char **)
static const char * find_plugindir_spec_function (int, const char **)
static const char * print_asm_header_spec_function (int, const char **)
static const char * compare_debug_dump_opt_spec_function (int, const char **)
static const char * compare_debug_self_opt_spec_function (int, const char **)
static const char * compare_debug_auxbase_opt_spec_function (int, const char **)
static const char * pass_through_libs_spec_func (int, const char **)
static const char * replace_extension_spec_func (int, const char **)
static char * convert_white_space (char *)
static char * skip_whitespace ()
static void set_spec ()
static void store_arg ()
static char * load_specs ()
static void read_specs ()
void record_temp_file ()
static void delete_if_ordinary ()
static void * for_each_path (const struct path_prefix *paths, bool do_multi, size_t extra_space, void *(*callback)(char *, void *), void *callback_info)
static void * add_to_obstack ()
static void xputenv ()
static int access_check ()
static void * file_at_path ()
static void add_preprocessor_option ()
static void add_assembler_option ()
static void add_linker_option ()
static void alloc_infile ()
static void add_infile ()
static void alloc_switch ()
static void save_switch (const char *opt, size_t n_args, const char *const *args, bool validated, bool known)
static bool driver_unknown_option_callback ()
static void driver_wrong_lang_callback (const struct cl_decoded_option *decoded, unsigned int lang_mask)
static bool driver_handle_option (struct gcc_options *opts, struct gcc_options *opts_set, const struct cl_decoded_option *decoded, unsigned int lang_mask, int kind, location_t loc, const struct cl_option_handlers *handlers, diagnostic_context *dc)
static void set_option_handlers ()
static void end_going_arg ()
static void insert_wrapper ()
int do_spec ()
static int do_spec_2 ()
static void do_option_spec ()
static void do_self_spec ()
static void * spec_path ()
static void create_at_file ()
static bool compile_input_file_p ()
static void do_specs_vec ()
static int do_spec_1 ()
static struct spec_functionlookup_spec_function ()
static const char * eval_spec_function ()
static const char * handle_spec_function ()
static bool input_suffix_matches ()
static bool input_spec_matches ()
static bool switch_matches ()
static void mark_matching_switches ()
static const char * handle_braces ()
static int check_live_switch ()
static void give_switch ()
static const char * find_file ()
static int is_directory ()
void set_input ()
static void fatal_signal ()
static int compare_files ()
int main (int, char **)
int main ()
static struct compilerlookup_compiler ()
static char * save_string ()
void pfatal_with_name ()
static void perror_with_name ()
static void validate_switches_from_spec ()
static const char * validate_switches ()
static int used_arg ()
static int default_arg ()
static const char * getenv_spec_function ()
static const char * if_exists_spec_function ()
static const char * if_exists_else_spec_function ()
static const char * replace_outfile_spec_function ()
static const char * remove_outfile_spec_function ()
static int compare_version_strings ()
static const char * version_compare_spec_function ()
static const char * include_spec_function ()
static const char * find_file_spec_function ()
static const char * find_plugindir_spec_function ()
static unsigned HOST_WIDE_INT get_random_number ()
const char * pass_through_libs_spec_func ()
const char * replace_extension_spec_func ()
static char * convert_white_space ()

Variables

static const char dir_separator_str [] = { DIR_SEPARATOR, 0 }
int is_cpp_driver
static bool at_file_supplied
static int print_help_list
static int print_version
static int verbose_only_flag
static int print_subprocess_help
FILE * report_times_to_file = NULL
static const char * target_system_root = TARGET_SYSTEM_ROOT
static int target_system_root_changed
static const char * target_sysroot_suffix = 0
static const char * target_sysroot_hdrs_suffix = 0
static enum save_temps save_temps_flag
static char * save_temps_prefix = 0
static size_t save_temps_length = 0
static const char * compiler_version
static const char *const spec_version = DEFAULT_TARGET_VERSION
static const char * spec_machine = DEFAULT_TARGET_MACHINE
static const char * cross_compile = "1"
static int greatest_status = 1
static struct obstack obstack
static struct obstack collect_obstack
static const char * asm_debug = ASM_DEBUG_SPEC
static const char * cpp_spec = CPP_SPEC
static const char * cc1_spec = CC1_SPEC
static const char * cc1plus_spec = CC1PLUS_SPEC
static const char * link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC
static const char * link_ssp_spec = LINK_SSP_SPEC
static const char * asm_spec = ASM_SPEC
static const char * asm_final_spec = ASM_FINAL_SPEC
static const char * link_spec = LINK_SPEC
static const char * lib_spec = LIB_SPEC
static const char * mfwrap_spec = MFWRAP_SPEC
static const char * mflib_spec = MFLIB_SPEC
static const char * link_gomp_spec = ""
static const char * libgcc_spec = LIBGCC_SPEC
static const char * endfile_spec = ENDFILE_SPEC
static const char * startfile_spec = STARTFILE_SPEC
static const char * linker_name_spec = LINKER_NAME
static const char * linker_plugin_file_spec = ""
static const char * lto_wrapper_spec = ""
static const char * lto_gcc_spec = ""
static const char * link_command_spec = LINK_COMMAND_SPEC
static const char * link_libgcc_spec = LINK_LIBGCC_SPEC
static const char * startfile_prefix_spec = STARTFILE_PREFIX_SPEC
static const char * sysroot_spec = SYSROOT_SPEC
static const char * sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC
static const char * sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC
static const char * self_spec = ""
static const char * trad_capable_cpp = "cc1 -E %{traditional|traditional-cpp:-traditional-cpp}"
static const char * cpp_unique_options
static const char * cpp_options
static const char * cpp_debug_options = "%{d*}"
static const char * cc1_options
static const char * asm_options = "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}"
static const char * invoke_as
!fwpa __pad0__
static struct obstack multilib_obstack
static const char * multilib_select
static const char * multilib_matches
static const char * multilib_defaults
static const char * multilib_exclusions
static const char * multilib_reuse
static const char *const multilib_defaults_raw [] = MULTILIB_DEFAULTS
static const char *const driver_self_specs []
static struct default_spec option_default_specs [] = { OPTION_DEFAULT_SPECS }
static struct user_specsuser_specs_head
static struct user_specsuser_specs_tail
static struct compilercompilers
static int n_compilers
static struct compiler default_compilers []
static const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1
static vec< char_plinker_options
static vec< char_passembler_options
static vec< char_ppreprocessor_options
static struct path_prefix exec_prefixes = { 0, 0, "exec" }
static struct path_prefix startfile_prefixes = { 0, 0, "startfile" }
static struct path_prefix include_prefixes = { 0, 0, "include" }
static const char * machine_suffix = 0
static const char * just_machine_suffix = 0
static const char * gcc_exec_prefix
static const char * gcc_libexec_prefix
static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX
static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX
static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX
static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX
static const char * md_exec_prefix = MD_EXEC_PREFIX
static const char * md_startfile_prefix = MD_STARTFILE_PREFIX
static const char * md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1
static const char *const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1
static const char *const standard_startfile_prefix_2 = STANDARD_STARTFILE_PREFIX_2
static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX
static const char * multilib_dir
static const char * multilib_os_dir
static const char * multiarch_dir
static struct spec_list static_specs []
static struct spec_list_1 extra_specs_1 [] = { EXTRA_SPECS }
static struct spec_listextra_specs = (struct spec_list *) 0
static struct spec_listspecs = (struct spec_list *) 0
static struct spec_function static_spec_functions []
static int processing_spec_function
static vec< const_char_pargbuf
static int have_o_argbuf_index = 0
static int have_c = 0
static int have_o = 0
static struct temp_nametemp_names
static int execution_count
static int signal_count
static const char * temp_filename
static int temp_filename_length
static struct temp_filealways_delete_queue
static struct temp_filefailure_delete_queue
static struct switchstrswitches
static int n_switches
static int n_switches_alloc
int compare_debug
int compare_debug_second
const char * compare_debug_opt
static struct switchstrswitches_debug_check [2]
static int n_switches_debug_check [2]
static int n_switches_alloc_debug_check [2]
static char * debug_check_temp_file [2]
static struct infileinfiles
int n_infiles
static int n_infiles_alloc
static bool combine_inputs
static int added_libraries
const char ** outfiles
static const char * spec_lang = 0
static int last_language_n_infiles
static const char * gcc_input_filename
static int input_file_number
size_t input_filename_length
static int basename_length
static int suffixed_basename_length
static const char * input_basename
static const char * input_suffix
static struct stat input_stat
static int input_stat_set
static struct compilerinput_file_compiler
static int arg_going
static int delete_this_arg
static int this_is_output_file
static int this_is_library_file
static int this_is_linker_script
static int input_from_pipe
static const char * suffix_subst
static struct mdswitchstrmdswitches
static int n_mdswitches
static const char * debug_auxbase_opt

Typedef Documentation

typedef char* char_p
typedef const char* const_char_p
Accumulate a command (program name and args), and run it.   

Enumeration Type Documentation

Ranking of prefixes in the sort list. -B prefixes are put before
   all others.   
Enumerator:
PREFIX_PRIORITY_B_OPT 
PREFIX_PRIORITY_LAST 
enum save_temps
Nonzero means write "temp" files in source directory
   and use the source file's name in them, and don't delete them.   
Enumerator:
SAVE_TEMPS_NONE 
SAVE_TEMPS_CWD 
SAVE_TEMPS_OBJ 

Function Documentation

static int access_check ( const char *  ,
int   
)
static

Referenced by file_at_path(), and process_command().

static int access_check ( )
static
Check whether NAME can be accessed in MODE.  This is like access,
   except that it never considers directories to be executable.   
static void add_assembler_option ( const char *  ,
int   
)
static

Referenced by driver_handle_option().

static void add_assembler_option ( )
static

References save_string().

static void add_infile ( )
static
Store an input file with the given NAME and LANGUAGE in
   infiles.   

References alloc_infile(), infile::language, n_infiles, and infile::name.

Referenced by driver_handle_option(), and process_command().

static void add_linker_option ( const char *  ,
int   
)
static

Referenced by do_spec_1(), and driver_handle_option().

static void add_linker_option ( )
static

References save_string().

static void add_prefix ( struct path_prefix pprefix,
const char *  prefix,
const char *  component,
int  priority,
int  require_machine_suffix,
int  os_multilib 
)
static
Add an entry for PREFIX in PLIST.  The PLIST is kept in ascending
   order according to PRIORITY.  Within each PRIORITY, new entries are
   appended.

   If WARN is nonzero, we will warn if no file is found
   through this prefix.  WARN should point to an int
   which will be set to 1 if this entry is used.

   COMPONENT is the value to be passed to update_path.

   REQUIRE_MACHINE_SUFFIX is 1 if this prefix can't be used without
   the complete value of machine_suffix.
   2 means try both machine_suffix and just_machine_suffix.   

References len, path_prefix::max_len, prefix_list::next, prefix_list::os_multilib, path_prefix::plist, prefix_list::prefix, priority(), prefix_list::priority, prefix_list::require_machine_suffix, strlen(), and update_path().

static void add_preprocessor_option ( const char *  ,
int   
)
static

Referenced by driver_handle_option().

static void add_preprocessor_option ( )
static

References save_string().

static void add_sysrooted_prefix ( struct path_prefix pprefix,
const char *  prefix,
const char *  component,
int  priority,
int  require_machine_suffix,
int  os_multilib 
)
static
Same as add_prefix, but prepending target_system_root to prefix.   
The target_system_root prefix has been relocated by gcc_exec_prefix.   

References add_prefix(), fatal_error(), free(), strlen(), target_sysroot_suffix, and target_system_root.

Referenced by main().

static void alloc_args ( )
static
Allocate the argument vector.   

Referenced by eval_spec_function(), and main().

static void alloc_infile ( )
static
Allocate space for an input file in infiles.   

Referenced by add_infile(), and process_command().

static void alloc_switch ( )
static
Allocate space for a switch in switches.   

Referenced by do_self_spec(), process_command(), and save_switch().

static char * build_search_list ( const struct path_prefix paths,
const char *  prefix,
bool  check_dir,
bool  do_multi 
)
static
Build a list of search directories from PATHS.
   PREFIX is a string to prepend to the list.
   If CHECK_DIR_P is true we ensure the directory exists.
   If DO_MULTI is true, multilib paths are output first, then
   non-multilib paths.
   This is used mostly by putenv_from_prefixes so we use `collect_obstack'.
   It is also used by the --print-search-dirs flag.   

References add_to_obstack(), add_to_obstack_info::check_dir, collect_obstack, add_to_obstack_info::first_time, for_each_path(), add_to_obstack_info::ob, and strlen().

Referenced by main(), and putenv_from_prefixes().

static int check_live_switch ( int  ,
int   
)
static
static int check_live_switch ( )
static
Return 0 iff switch number SWITCHNUM is obsoleted by a later switch
   on the command line.  PREFIX_LENGTH is the length of XXX in an {XXX*}
   spec, or -1 if either exact match or %* is used.

   A -O switch is obsoleted by a later -O switch.  A -f, -g, -m, or -W switch
   whose value does not begin with "no-" is obsoleted by the same value
   with the "no-", similarly for a switch with the "no-" prefix.   

References switchstr::live_cond, n_switches, spec_function::name, switchstr::part1, and switchstr::validated.

static void clear_args ( )
static
Clear out the vector of arguments (after a command is executed).   

Referenced by do_spec_1(), and do_spec_2().

static void clear_failure_queue ( void  )
static

Referenced by main().

static const char * compare_debug_auxbase_opt_spec_function ( int  arg,
const char **  argv 
)
static
%:compare-debug-auxbase-opt spec function.  Expands to the auxbase
    options that are to be passed in the second compilation of
    compare-debug.  It expects, as an argument, the basename of the
    current input file name, with the .gk suffix appended to it.   

References debug_auxbase_opt, fatal_error(), len, memcpy(), and strlen().

static const char * compare_debug_dump_opt_spec_function ( int  arg,
const char **  argv 
)
static
%:compare-debug-dump-opt spec function.  Save the last argument,
   expected to be the last -fdump-final-insns option, or generate a
   temporary.   

References do_spec_1(), do_spec_2(), fatal_error(), free(), get_random_number(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT, and HOST_WIDE_INT_PRINT_HEX.

static const char * compare_debug_self_opt_spec_function ( int  arg,
const char **  argv 
)
static
%:compare-debug-self-opt spec function.  Expands to the options
    that are to be passed in the second compilation of
    compare-debug.   

References do_spec_1(), do_spec_2(), and fatal_error().

static int compare_files ( )
static
Compare the contents of the two files named CMPFILE[0] and
   CMPFILE[1].  Return zero if they're identical, nonzero
   otherwise.   

References error(), and map.

Referenced by main().

static int compare_version_strings ( )
static
Given two version numbers, compares the two numbers.
   A version number must match the regular expression
   ([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*

References abort(), and fatal_error().

Referenced by version_compare_spec_function().

static bool compile_input_file_p ( )
static
True if we should compile INFILE.  

References infile::incompiler, and infile::language.

Referenced by do_spec_1().

static const char * convert_filename ( const char *  name,
int  do_exe,
int  do_obj 
)
static
Convert NAME to a new name if it is the standard suffix.  DO_EXE
   is true if we should look for an executable suffix.  DO_OBJ
   is true if we should look for an object suffix.   

References len, infile::name, obstack, and strlen().

Referenced by driver_handle_option(), and process_command().

static char* convert_white_space ( char *  )
static

Referenced by main().

static char* convert_white_space ( )
static
Insert backslash before spaces in ORIG (usually a file path), to 
   avoid being broken by spec parser.

   This function is needed as do_spec_1 treats white space (' ' and '\t')
   as the end of an argument. But in case of -plugin /usr/gcc install/xxx.so,
   the file name should be treated as a single argument rather than being
   broken into multiple. Solution is to insert '\\' before the space in a 
   file name.
   
   This function converts and only converts all occurrence of ' ' 
   to '\\' + ' ' and '\t' to '\\' + '\t'.  For example:
   "a b"  -> "a\\ b"
   "a  b" -> "a\\ \\ b"
   "a\tb" -> "a\\\tb"
   "a\\ b" -> "a\\\\ b"

   orig: input null-terminating string that was allocated by xalloc. The
   memory it points to might be freed in this function. Behavior undefined
   if ORIG wasn't xalloced or was freed already at entry.

   Return: ORIG if no conversion needed. Otherwise a newly allocated string
   that was converted from ORIG.   

References free(), and len.

static void create_at_file ( )
static
Create a temporary FILE with the contents of ARGV. Add @FILE to the
   argument list.  

References fatal_error(), record_temp_file(), save_temps_flag, and store_arg().

Referenced by do_spec_1().

static int default_arg ( const char *  ,
int   
)
static
static int default_arg ( )
static

References n_mdswitches.

static void delete_failure_queue ( )
static
Delete all the files to be deleted on error.   

References delete_if_ordinary(), temp_file::name, and temp_file::next.

Referenced by fatal_signal(), and main().

static void delete_if_ordinary ( const char *  )
static
static void delete_if_ordinary ( )
static
static void delete_temp_files ( void  )
static
static void display_help ( )
static
Display the command line switches accepted by gcc.   

References progname.

Referenced by main().

static void do_option_spec ( const char *  ,
const char *   
)
static

Referenced by main().

static void do_option_spec ( )
static
Process the given spec string and add any new options to the end
   of the switches/n_switches array.   

References do_self_spec(), memcpy(), compiler::spec, strlen(), and strstr().

static void do_self_spec ( const char *  )
static

Referenced by do_option_spec(), and main().

static void do_self_spec ( )
static
Process the given spec string and add any new options to the end
   of the switches/n_switches array.   

References alloc_switch(), decode_cmdline_options_to_array(), do_spec_1(), do_spec_2(), fatal_error(), free(), global_dc, switchstr::live_cond, memcpy(), n_switches, switchstr::part1, read_cmdline_option(), save_switch(), and set_option_handlers().

int do_spec ( )
Process the spec SPEC and run the commands specified therein.
   Returns 0 if the spec is successfully processed; -1 if failed.   

References do_spec_2(), execute(), and set_collect_gcc_options().

Referenced by main().

static int do_spec_1 ( )
static
Process the sub-spec SPEC as a portion of a larger spec.
   This is like processing a whole spec except that we do
   not initialize at the beginning and we do not supply a
   newline by default at the end.
   INSWITCH nonzero means don't process %-sequences in SPEC;
   in this case, % is treated as an ordinary character.
   This is used while substituting switches.
   INSWITCH nonzero also causes SPC not to terminate an argument.

   Value is zero unless a line was finished
   and the command on that line reported an error.   

References add_linker_option(), spec_path_info::append, spec_path_info::append_len, asm_final_spec, asm_spec, at_file_supplied, cc1_spec, cc1plus_spec, clear_args(), compile_input_file_p(), infile::compiled, cpp_spec, compiler::cpp_spec, create_at_file(), dir_separator_str, do_spec_1(), do_specs_vec(), end_going_arg(), endfile_spec, error(), execute(), fatal_error(), temp_name::filename, temp_name::filename_length, fnotice(), for_each_path(), free(), gcc_exec_prefix, handle_braces(), handle_spec_function(), inform(), input_file_number, input_stat, lang_specific_extra_outfiles, len, temp_name::length, lib_spec, libgcc_spec, link_spec, switchstr::live_cond, memcpy(), multiarch_dir, multilib_dir, multilib_os_dir, n_infiles, n_switches, spec_list::name, spec_list::name_len, spec_list::next, temp_name::next, obstack, spec_path_info::omit_relative, spec_path_info::option, processing_spec_function, spec_list::ptr_spec, record_temp_file(), save_string(), save_temps_flag, save_temps_length, save_temps_prefix, spec_path_info::separate_options, set_collect_gcc_options(), sl, spec_path(), startfile_spec, store_arg(), strlen(), temp_name::suffix, sysroot_hdrs_suffix_spec, target_sysroot_hdrs_suffix, target_sysroot_suffix, target_system_root, target_system_root_changed, temp_filename, temp_filename_length, temp_names, temp_name::unique, and switchstr::validated.

static int do_spec_2 ( )
static
static void do_specs_vec ( )
static
Process each member of VEC as a spec.   

References do_spec_1().

Referenced by do_spec_1().

static bool driver_unknown_option_callback ( )
static
static void driver_wrong_lang_callback ( const struct cl_decoded_option decoded,
unsigned int  lang_mask 
)
static
static void end_going_arg ( )
static
If there is an argument being accumulated, terminate it and store it.   

References error(), find_a_file(), find_file(), input_file_number, obstack, and store_arg().

Referenced by do_spec_1(), and do_spec_2().

static const char* eval_spec_function ( const char *  ,
const char *   
)
static

Referenced by handle_spec_function().

static int execute ( )
static
Execute the command specified by the arguments on the current line of spec.
   When using pipes, this includes several piped-together commands
   with `|' between them.

   Return 0 if successful, -1 if failed.   

References errno, execution_count, fatal_error(), find_a_file(), fnotice(), free(), greatest_status, insert_wrapper(), internal_error(), pfatal_with_name(), print_help_list, processing_spec_function, progname, report_times_to_file, signal_count, strsignal(), temp_filename, times(), and verbose_only_flag.

Referenced by do_spec(), and do_spec_1().

static void fatal_signal ( int  )
static

Referenced by main().

static void fatal_signal ( )
static
On fatal signals, delete all the temporary files.   

References delete_failure_queue(), and delete_temp_files().

static char * find_a_file ( const struct path_prefix pprefix,
const char *  name,
int  mode,
bool  do_multi 
)
static
Search for NAME using the prefix list PREFIXES.  MODE is passed to
   access to check permissions.  If DO_MULTI is true, search multilib
   paths then non-multilib paths, otherwise do not search multilib paths.
   Return 0 if not found, otherwise return its name, allocated with malloc.   

References file_at_path(), for_each_path(), file_at_path_info::mode, file_at_path_info::name, file_at_path_info::name_len, strlen(), file_at_path_info::suffix, and file_at_path_info::suffix_len.

static const char* find_file ( const char *  )
static
static const char* find_file ( )
static
Search for a file named NAME trying various prefixes including the
   user's -B prefix and some standard ones.
   Return the absolute file name found.  If nothing is found, return NAME.   

References find_a_file(), and spec_function::name.

static const char* find_file_spec_function ( int  ,
const char **   
)
static
static const char* find_file_spec_function ( )
static
%:find-file spec function.  This function replaces its argument by
    the file found through find_file, that is the -print-file-name gcc
    program option.  

References abort(), and find_file().

static const char* find_plugindir_spec_function ( int  ,
const char **   
)
static
static const char* find_plugindir_spec_function ( )
static
%:find-plugindir spec function.  This function replaces its argument
    by the -iplugindir=<dir> option.  `dir' is found through find_file, that
    is the -print-file-name gcc program option.  

References abort(), find_file(), and option().

static void* for_each_path ( const struct path_prefix paths,
bool  do_multi,
size_t  extra_space,
void *(*)(char *, void *)  callback,
void *  callback_info 
)
static
Call CALLBACK for each path in PATHS, breaking out early if CALLBACK
   returns non-NULL.
   If DO_MULTI is true iterate over the paths twice, first with multilib
   suffix then without, otherwise iterate over the paths once without
   adding a multilib suffix.  When DO_MULTI is true, some attempt is made
   to avoid visiting the same path twice, but we could do better.  For
   instance, /usr/lib/../lib is considered different from /usr/lib.
   At least EXTRA_SPACE chars past the end of the path passed to
   CALLBACK are available for use by the callback.
   CALLBACK_INFO allows extra parameters to be passed to CALLBACK.

   Returns the value returned by CALLBACK.   

References dir_separator_str, free(), just_machine_suffix, len, machine_suffix, path_prefix::max_len, memcpy(), multiarch_dir, multilib_dir, multilib_os_dir, prefix_list::next, prefix_list::os_multilib, path, path_prefix::plist, prefix_list::prefix, prefix_list::require_machine_suffix, and strlen().

Referenced by build_search_list(), do_spec_1(), and find_a_file().

static unsigned HOST_WIDE_INT get_random_number ( )
static
Get a random number for -frandom-seed  

References HOST_WIDE_INT.

Referenced by compare_debug_dump_opt_spec_function().

static const char* getenv_spec_function ( int  ,
const char **   
)
static
static const char* getenv_spec_function ( )
static
getenv built-in spec function.

   Returns the value of the environment variable given by its first
   argument, concatenated with the second argument.  If the
   environment variable is not defined, a fatal error is issued.   

References fatal_error(), getenv(), len, and strlen().

static void give_switch ( int  ,
int   
)
static
static void give_switch ( )
static
Pass a switch to the current accumulating command
   in the same form that we received it.
   SWITCHNUM identifies the switch; it is an index into
   the vector of switches gcc received, which is `switches'.
   This cannot fail since it never finishes a command line.

   If OMIT_FIRST_WORD is nonzero, then we omit .part1 of the argument.   

References do_spec_1(), strlen(), and switchstr::validated.

static const char* handle_braces ( const char *  )
static

Referenced by do_spec_1().

static const char* handle_braces ( )
static
Handle a %{ ... } construct.  P points just inside the leading {.
   Returns a pointer one past the end of the brace block, or 0
   if we call do_spec_1 and that returns -1.   

References fatal_error(), input_spec_matches(), input_suffix_matches(), mark_matching_switches(), process_brace_body(), process_marked_switches(), and switch_matches().

static const char* handle_spec_function ( const char *  )
static

Referenced by do_spec_1().

static const char* handle_spec_function ( )
static
Handle a spec function call of the form:

   %:function(args)

   ARGS is processed as a spec in a separate context and split into an
   argument vector in the normal fashion.  The function returns a string
   containing a spec which we then process in the caller's context, or
   NULL if no processing is required.   

References count, do_spec_1(), eval_spec_function(), fatal_error(), free(), spec_function::func, processing_spec_function, and save_string().

static const char* if_exists_else_spec_function ( int  ,
const char **   
)
static
static const char* if_exists_else_spec_function ( )
static
if-exists-else built-in spec function.

   This is like if-exists, but takes an additional argument which
   is returned if the first argument does not exist.   
static const char* if_exists_spec_function ( int  ,
const char **   
)
static
static const char* if_exists_spec_function ( )
static
if-exists built-in spec function.

   Checks to see if the file specified by the absolute pathname in
   ARGS exists.  Returns that pathname if found.

   The usual use for this function is to check for a library file
   (whose name has been expanded with %s).   
static const char* include_spec_function ( int  ,
const char **   
)
static
static const char* include_spec_function ( )
static
%:include builtin spec function.  This differs from %include in that it
   can be nested inside a spec, and thus be conditionalized.  It takes
   one argument, the filename, and looks for it in the startfile path.
   The result is always NULL, i.e. an empty expansion.   

References abort(), find_a_file(), and read_specs().

static void init_gcc_specs ( struct obstack obstack,
const char *  shared_name,
const char *  static_name,
const char *  eh_name 
)
static

References free(), and strlen().

Referenced by init_spec().

static bool input_spec_matches ( )
static
Subroutine of handle_braces.  Returns true if the current
   input file's spec name matches the atom bracketed by ATOM and END_ATOM.   

References compiler::suffix.

Referenced by handle_braces().

static bool input_suffix_matches ( const char *  ,
const char *   
)
inlinestatic

Referenced by handle_braces().

static bool input_suffix_matches ( )
inlinestatic
Inline subroutine of handle_braces.  Returns true if the current
   input suffix matches the atom bracketed by ATOM and END_ATOM.   
static void insert_wrapper ( const char *  )
static

Referenced by execute().

static void insert_wrapper ( )
static
Parse the WRAPPER string which is a comma separated list of the command line
   and insert them into the beginning of argbuf.   
static int is_directory ( const char *  ,
bool   
)
static
static int is_directory ( )
static
Determine whether a directory exists.  If LINKER, return 0 for
   certain fixed names not needed by the linker.   

References memcpy(), path, and strlen().

static char* load_specs ( const char *  )
static

Referenced by read_specs().

static char* load_specs ( )
static
Load specs from a file name named FILENAME, replacing occurrences of
   various different types of line-endings, \r\n, \n\r and just \r, with
   a single \n.   

References buffer, fnotice(), free(), pfatal_with_name(), and specs.

static struct compiler* lookup_compiler ( const char *  ,
size_t  ,
const char *   
)
staticread

Referenced by lookup_compiler(), and main().

static struct compiler* lookup_compiler ( )
staticread
Find the proper compilation spec for the file name NAME,
   whose length is LENGTH.  LANGUAGE is the specified language,
   or 0 if this file is to be passed to the linker.   

References compilers, error(), lookup_compiler(), n_compilers, compiler::spec, strlen(), and compiler::suffix.

static struct spec_function* lookup_spec_function ( const char *  )
staticread

Referenced by eval_spec_function().

static struct spec_function* lookup_spec_function ( )
staticread
Look up a spec function.   

References spec_function::name.

int main ( int  ,
char **   
)
int main ( )

References add_prefix(), add_sysrooted_prefix(), alloc_args(), cl_decoded_option::arg, at_file_supplied, atexit(), bug_report_url, build_search_list(), clear_failure_queue(), collect_obstack, compiler::combinable, compare_debug, compare_files(), infile::compiled, compiler_version, convert_white_space(), cross_compile, decode_cmdline_options_to_array(), delete_failure_queue(), delete_temp_files(), diagnostic_initialize(), dir_separator_str, display_help(), do_option_spec(), do_self_spec(), do_spec(), do_spec_1(), do_spec_2(), driver_self_specs, error(), execution_count, fatal_error(), fatal_signal(), user_specs::filename, find_a_file(), find_file(), finish_params(), fnotice(), free(), gcc_exec_prefix, gcc_init_libintl(), gcc_input_filename, global_dc, global_init_params(), greatest_status, have_c, have_o, infile::incompiler, inform(), init_options_struct(), init_spec(), just_machine_suffix, lang_specific_extra_outfiles, lang_specific_pre_link(), link_command_spec, link_spec, linker_name_spec, linker_plugin_file_spec, lookup_compiler(), lto_gcc_spec, lto_wrapper_spec, machine_suffix, md_exec_prefix, md_startfile_prefix, md_startfile_prefix_1, memcpy(), multiarch_dir, multilib_defaults, multilib_defaults_raw, multilib_dir, multilib_exclusions, multilib_matches, multilib_obstack, multilib_os_dir, multilib_reuse, multilib_select, n_compilers, n_default_compilers, n_infiles, n_switches, n_switches_alloc, spec_list::name, infile::name, spec_list::name_len, user_specs::next, spec_list::next, obstack, pkgversion_string, PREFIX_PRIORITY_LAST, infile::preprocessed, print_help_list, print_multilib_info(), print_subprocess_help, print_version, process_command(), progname, spec_list::ptr_spec, putenv_from_prefixes(), read_specs(), save_temps_flag, SAVE_TEMPS_NONE, seen_error(), set_input(), set_multilib_dir(), set_spec(), signal_count, sl, compiler::spec, spec_machine, spec_version, standard_exec_prefix, standard_startfile_prefix, standard_startfile_prefix_1, standard_startfile_prefix_2, startfile_prefix_spec, strlen(), switch_matches(), switches, sysroot_hdrs_suffix_spec, sysroot_suffix_spec, target_sysroot_hdrs_suffix, target_sysroot_suffix, target_system_root, validate_all_switches(), version_string, warning(), and xputenv().

static void mark_matching_switches ( const char *  ,
const char *  ,
int   
)
inlinestatic

Referenced by handle_braces().

static void mark_matching_switches ( )
inlinestatic
Inline subroutine of handle_braces.  Mark all of the switches which
   match ATOM (extends to END_ATOM; STARRED indicates whether there
   was a star after the atom) for later processing.   

References check_live_switch(), len, n_switches, and switchstr::ordering.

static const char* pass_through_libs_spec_func ( int  ,
const char **   
)
static
const char* pass_through_libs_spec_func ( )
%:pass-through-libs spec function.  Finds all -l options and input
   file names in the lib spec passed to it, and makes a list of them
   prepended with the plugin option to cause them to be passed through
   to the final link after all the new object files have been added.   

References free(), and strlen().

static void perror_with_name ( const char *  )
static
static void perror_with_name ( )
static

References error().

void pfatal_with_name ( )

References delete_temp_files(), and perror_with_name().

Referenced by execute(), and load_specs().

static const char * print_asm_header_spec_function ( int  arg,
const char **  argv 
)
static
%:print-asm-header spec function.  Print a banner to say that the
   following output is from the assembler.   
static void print_multilib_info ( )
static
Print out the multiple library subdirectory selection
   information.  This prints out a series of lines.  Each line looks
   like SUBDIRECTORY;@OPTION@OPTION, with as many options as is
   required.  Only the desired options are printed out, the negative
   matches.  The options are print without a leading dash.  There are
   no spaces to make it easy to use the information in the shell.
   Each subdirectory is printed only once.  This assumes the ordering
   generated by the genmultilib script. Also, we leave out ones that match
   the exclusions.   

References default_arg(), fatal_error(), len, multilib_exclusions, and multilib_select.

Referenced by main().

static const char * process_brace_body ( const char *  p,
const char *  atom,
const char *  end_atom,
int  starred,
int  matched 
)
static
Subroutine of handle_braces.  Scan and process a brace substitution body
   (X in the description of %{} syntax).  P points one past the colon;
   ATOM and END_ATOM bracket the first atom which was found to be true
   (present) in the current disjunction; STARRED indicates whether all
   the atoms in the current disjunction were starred (for syntax validation);
   MATCHED indicates whether the disjunction matched or not, and therefore
   whether or not the body is to be processed through do_spec_1 or just
   skipped.  Returns a pointer to the closing } or ;, or 0 if do_spec_1
   returns -1.   

References check_live_switch(), do_spec_1(), fatal_error(), give_switch(), n_switches, and save_string().

Referenced by handle_braces().

static void process_marked_switches ( )
inlinestatic
Inline subroutine of handle_braces.  Process all the currently
   marked switches through give_switch, and clear the marks.   

References give_switch(), n_switches, and switchstr::ordering.

Referenced by handle_braces().

static void putenv_from_prefixes ( const struct path_prefix paths,
const char *  env_var,
bool  do_multi 
)
static
Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
   for collect.   

References build_search_list(), and xputenv().

Referenced by main().

static void read_specs ( const char *  ,
bool  ,
bool   
)
static
static void read_specs ( )
static
Read compilation specs from a file named FILENAME,
   replacing the default ones.

   A suffix which starts with `*' is a definition for
   one of the machine-specific sub-specs.  The "suffix" should be
   *asm, *cc1, *cpp, *link, *startfile, etc.
   The corresponding spec is stored in asm_spec, etc.,
   rather than in the `compilers' vector.

   Anything invalid in the file is a fatal error.   

References spec_list::alloc_p, buffer, fatal_error(), find_a_file(), fnotice(), free(), link_command_spec, load_specs(), memset(), n_compilers, spec_list::name, spec_list::name_len, spec_list::next, spec_list::ptr_spec, read_specs(), save_string(), set_spec(), skip_whitespace(), sl, compiler::spec, and compiler::suffix.

void record_temp_file ( )
Record FILENAME as a file to be deleted automatically.
   ALWAYS_DELETE nonzero means delete it if all compilation succeeds;
   otherwise delete it in any case.
   FAIL_DELETE nonzero means delete it if a compilation step fails;
   otherwise delete it in any case.   

References always_delete_queue, failure_delete_queue, free(), temp_file::name, and temp_file::next.

Referenced by create_at_file(), do_spec_1(), and store_arg().

static const char* remove_outfile_spec_function ( int  ,
const char **   
)
static
static const char* remove_outfile_spec_function ( )
static
remove-outfile built-in spec function.
 *
 *    This looks for the first argument in the outfiles array's name and
 *       removes it.   

References abort(), and n_infiles.

static const char* replace_extension_spec_func ( int  ,
const char **   
)
static
const char* replace_extension_spec_func ( )
%:replace-extension spec function.  Replaces the extension of the
   first argument with the second argument.   

References fatal_error(), free(), and strlen().

static const char* replace_outfile_spec_function ( int  ,
const char **   
)
static
static const char* replace_outfile_spec_function ( )
static
replace-outfile built-in spec function.

   This looks for the first argument in the outfiles array's name and
   replaces it with the second argument.   

References abort(), and n_infiles.

static char* save_string ( )
static

References len, and memcpy().

static void save_switch ( const char *  opt,
size_t  n_args,
const char *const *  args,
bool  validated,
bool  known 
)
static
Save an option OPT with N_ARGS arguments in array ARGS, marking it
   as validated if VALIDATED and KNOWN if it is an internal switch.   

References alloc_switch(), switchstr::args, switchstr::known, switchstr::live_cond, memcpy(), n_switches, switchstr::ordering, switchstr::part1, and switchstr::validated.

Referenced by do_self_spec(), driver_handle_option(), driver_unknown_option_callback(), driver_wrong_lang_callback(), and process_command().

static void set_collect_gcc_options ( )
static
Store switches not filtered out by %<S in spec in COLLECT_GCC_OPTIONS
   and place that in the environment.   

References collect_obstack, switchstr::part1, strlen(), and xputenv().

Referenced by do_spec(), and do_spec_1().

void set_input ( )
Set up the various global variables to indicate that we're processing
   the input file named FILENAME.   

References basename_length, input_basename, and strlen().

Referenced by main().

static void set_multilib_dir ( )
static
Work out the subdirectory to use based on the options. The format of
   multilib_select is a list of elements. Each element is a subdirectory
   name followed by a list of options followed by a semicolon. The format
   of multilib_exclusions is the same, but without the preceding
   directory. First gcc will check the exclusions, if none of the options
   beginning with an exclamation point are present, and all of the other
   options are present, then we will ignore this completely. Passing
   that, gcc will consider each multilib_select in turn using the same
   rules for matching the options. If a match is found, that subdirectory
   will be used.
   A subdirectory name is optionally followed by a colon and the corresponding
   multiarch name.   

References default_arg(), fatal_error(), first, free(), mdswitchstr::len, memcpy(), multiarch_dir, multilib_defaults, multilib_dir, multilib_exclusions, multilib_obstack, multilib_os_dir, multilib_reuse, multilib_select, mdswitchstr::str, strlen(), and used_arg().

Referenced by main().

static void set_spec ( const char *  ,
const char *  ,
bool   
)
static

Referenced by main(), and read_specs().

static void set_spec ( )
static
Change the value of spec NAME to SPEC.  If SPEC is empty, then the spec is
   removed; If the spec starts with a + then SPEC is added to the end of the
   current spec.   

References spec_list::alloc_p, fnotice(), free(), spec_list::name, spec_list::name_len, spec_list::next, spec_list::ptr, spec_list::ptr_spec, sl, specs, strlen(), and spec_list::user_p.

static char* skip_whitespace ( char *  )
static

Referenced by read_specs().

static char* skip_whitespace ( )
static
static void store_arg ( const char *  ,
int  ,
int   
)
static
static void store_arg ( )
static
Add one argument to the vector at the end.
   This is done when a space is seen or at the end of the line.
   If DELETE_ALWAYS is nonzero, the arg is a filename
    and the file should be deleted eventually.
   If DELETE_FAILURE is nonzero, the arg is a filename
    and the file should be deleted if this compilation fails.   

References have_o_argbuf_index, and record_temp_file().

static bool switch_matches ( const char *  ,
const char *  ,
int   
)
inlinestatic

Referenced by handle_braces(), and main().

static bool switch_matches ( )
static
Subroutine of handle_braces.  Returns true if a switch
   matching the atom bracketed by ATOM and END_ATOM appeared on the
   command line.   

References check_live_switch(), len, and n_switches.

static int used_arg ( const char *  ,
int   
)
static

Referenced by set_multilib_dir(), and used_arg().

static int used_arg ( )
static
Check whether a particular argument was used.  The first time we
   canonicalize the switches to keep only the ones we care about.   

References fatal_error(), len, mdswitchstr::len, multilib_matches, n_mdswitches, n_switches, mdswitchstr::str, strlen(), and used_arg().

static void validate_all_switches ( void  )
static
static const char* validate_switches ( const char *  ,
bool   
)
static
static const char* validate_switches ( )
static
Look at the switch-name that comes after START
   and mark as valid all supplied switches that match it.   

References len, n_switches, validate_switches(), and switchstr::validated.

static void validate_switches_from_spec ( const char *  ,
bool   
)
inlinestatic

Referenced by validate_all_switches().

static void validate_switches_from_spec ( )
inlinestatic
static const char* version_compare_spec_function ( int  ,
const char **   
)
static
static const char* version_compare_spec_function ( )
static
version_compare built-in spec function.

   This takes an argument of the following form:

   <comparison-op> <arg1> [<arg2>] <switch> <result>

   and produces "result" if the comparison evaluates to true,
   and nothing if it doesn't.

   The supported <comparison-op> values are:

   >=  true if switch is a later (or same) version than arg1
   !>  opposite of >=
   <   true if switch is an earlier version than arg1
   !<  opposite of <
   ><  true if switch is arg1 or later, and earlier than arg2
   <>  true if switch is earlier than arg1 or is arg2 or later

   If the switch is not present, the condition is false unless
   the first character of the <comparison-op> is '!'.

   For example,
   %:version-compare(>= 10.3 mmacosx-version-min= -lmx)
   adds -lmx if -mmacosx-version-min=10.3.9 was passed.   

References abort(), check_live_switch(), compare_version_strings(), fatal_error(), n_switches, switchstr::part1, and strlen().

static void xputenv ( const char *  )
static
static void xputenv ( )
static
Add or change the value of an environment variable, outputting the
   change to standard error if in verbose mode.   

References fnotice().


Variable Documentation

!fwpa __pad0__
int added_libraries
static
This counts the number of libraries added by lang_specific_driver, so that
   we can tell if there were any user supplied any files or libraries.   
struct temp_file* always_delete_queue
static
Queue of files to delete on success or failure of compilation.   

Referenced by record_temp_file().

int arg_going
static
These are variables used within do_spec and do_spec_1.   
Nonzero if an arg has been started and not yet terminated
   (with space, tab or newline).   

Referenced by eval_spec_function().

vec<const_char_p> argbuf
static
Vector of pointers to arguments in the current line of specifications.   

Referenced by eval_spec_function().

const char* asm_debug = ASM_DEBUG_SPEC
static
const char* asm_final_spec = ASM_FINAL_SPEC
static

Referenced by do_spec_1().

const char* asm_options = "%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}"
static
const char* asm_spec = ASM_SPEC
static

Referenced by do_spec_1(), and init_spec().

vec<char_p> assembler_options
static
A vector of options to give to the assembler.
   These options are accumulated by -Wa,
   and substituted into the assembler command with %Y.   
bool at_file_supplied
static
Flag set to nonzero if an @file argument has been supplied to gcc.   

Referenced by do_spec_1(), and main().

int basename_length
static

Referenced by set_input().

const char* cc1_options
static
Initial value:
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
%1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{aux-info*}\
%{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \
%{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
%{v:-version} %{pg:-p} %{p} %{f*} %{undef}\
%{Qn:-fno-ident} %{Qy:} %{-help:--help}\
%{-target-help:--target-help}\
%{-version:--version}\
%{-help=*:--help=%*}\
%{!fsyntax-only:%{S:%W{o*}%{!o*:-o %b.s}}}\
%{fsyntax-only:-o %j} %{-param*}\
%{fmudflap|fmudflapth:-fno-builtin -fno-merge-constants}\
%{coverage:-fprofile-arcs -ftest-coverage}"
NB: This is shared amongst all front-ends, except for Ada.   
const char* cc1_spec = CC1_SPEC
static

Referenced by do_spec_1().

const char* cc1plus_spec = CC1PLUS_SPEC
static

Referenced by do_spec_1().

struct obstack collect_obstack
static
This is the obstack to build an environment variable to pass to
   collect2 that describes all of the relevant switches of what to
   pass the compiler in building the list of pointers to constructors
   and destructors.   

Referenced by build_search_list(), main(), and set_collect_gcc_options().

bool combine_inputs
static
True if multiple input files are being compiled to a single
   assembly file.   
int compare_debug
Set to zero if -fcompare-debug is disabled, positive if it's
   enabled and we're running the first compilation, negative if it's
   enabled and we're running the second compilation.  For most of the
   time, it's in the range -1..1, but it can be temporarily set to 2
   or 3 to indicate that the -fcompare-debug flags didn't come from
   the command-line, but rather from the GCC_COMPARE_DEBUG environment
   variable, until a synthesized -fcompare-debug flag is added to the
   command line.   

Referenced by main().

const char* compare_debug_opt
Set to the flags that should be passed to the second compilation in
   a -fcompare-debug compilation.   
int compare_debug_second
Set to nonzero if we've seen the -fcompare-debug-second flag.   
const char* compiler_version
static
The compiler version.   

Referenced by main(), and process_command().

struct compiler* compilers
static
Pointer to a vector of `struct compiler' that gives the spec for
   compiling a file, based on its suffix.
   A file that does not end in any of these suffixes will be passed
   unchanged to the loader and nothing else will be done to it.

   An entry containing two 0s is used to terminate the vector.

   If multiple entries match a file, the last matching one is used.   

Referenced by lookup_compiler().

const char* cpp_debug_options = "%{d*}"
static
This contains cpp options which are not passed when the preprocessor
   output will be used by another program.   
const char* cpp_options
static
Initial value:
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
%{f*} %{g*:%{!g0:%{g*} %{!fno-working-directory:-fworking-directory}}} %{O*}\
%{undef} %{save-temps*:-fpch-preprocess}"
This contains cpp options which are common with cc1_options and are passed
   only when preprocessing only to avoid duplication.  We pass the cc1 spec
   options to the preprocessor so that it the cc1 spec may manipulate
   options used to set target flags.  Those special target flags settings may
   in turn cause preprocessor symbols to be defined specially.   

Referenced by register_include_chains(), and remove_duplicates().

const char* cpp_spec = CPP_SPEC
static

Referenced by do_spec_1().

const char* cpp_unique_options
static
Initial value:
"%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I\
%{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\
%{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
%{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
%{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
%{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
%{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
%{H} %C %{D*&U*&A*} %{i*} %Z %i\
%{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
%{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
%{E|M|MM:%W{o*}}"
We don't wrap .d files in %W{} since a missing .d file, and
   therefore no dependency entry, confuses make into thinking a .o
   file that happens to exist is up-to-date.   
static const char * cross_compile = "1"
static
Nonzero if cross-compiling.
   When -b is used, the value comes from the `specs' file.   

Referenced by main(), and process_command().

const char* debug_auxbase_opt
static
char* debug_check_temp_file[2]
static
struct compiler default_compilers[]
static
The default list of file name suffixes and their compilation specs.   
int delete_this_arg
static
Nonzero means %d or %g has been seen; the next arg to be terminated
   is a temporary file name.   

Referenced by eval_spec_function().

const char dir_separator_str[] = { DIR_SEPARATOR, 0 }
static
const char* const driver_self_specs[]
static
Initial value:
{
"%{fdump-final-insns:-fdump-final-insns=.} %<fdump-final-insns",
DRIVER_SELF_SPECS, CONFIGURE_SPECS, GOMP_SELF_SPECS, GTM_SELF_SPECS
}

Referenced by main().

const char* endfile_spec = ENDFILE_SPEC
static

Referenced by do_spec_1().

struct path_prefix exec_prefixes = { 0, 0, "exec" }
static
List of prefixes to try when looking for executables.   
int execution_count
static
Number of commands executed so far.   

Referenced by execute(), and main().

struct spec_list* extra_specs = (struct spec_list *) 0
static
struct spec_list_1 extra_specs_1[] = { EXTRA_SPECS }
static
struct temp_file* failure_delete_queue
static
Queue of files to delete on failure of compilation.   

Referenced by record_temp_file().

const char* gcc_exec_prefix
static
Adjusted value of GCC_EXEC_PREFIX envvar.   
const char* gcc_input_filename
static
Process a spec string, accumulating and running commands.   
These variables describe the input file name.
   input_file_number is the index on outfiles of this file,
   so that the output file name can be stored for later use by %o.
   input_basename is the start of the part of the input file
   sans all directory names, and basename_length is the number
   of characters starting there excluding the suffix .c or whatever.   

Referenced by main().

const char* gcc_libexec_prefix
static
Adjusted value of standard_libexec_prefix.   

Referenced by process_command().

int greatest_status = 1
static
Greatest exit code of sub-processes that has been encountered up to
   now.   

Referenced by execute(), and main().

int have_c = 0
static
Were the options -c, -S or -E passed.   

Referenced by driver_handle_option(), main(), and process_command().

int have_o = 0
static
Was the option -o passed.   

Referenced by driver_handle_option(), and main().

int have_o_argbuf_index = 0
static
Position in the argbuf vector containing the name of the output file
   (the value associated with the "-o" flag).   

Referenced by store_arg().

struct path_prefix include_prefixes = { 0, 0, "include" }
static
List of prefixes to try when looking for include files.   
struct infile* infiles
static
Also a vector of input files specified.   
const char* input_basename
static

Referenced by set_input().

struct compiler* input_file_compiler
static
The compiler used to process the current input file.   
int input_file_number
static

Referenced by do_spec_1(), and end_going_arg().

size_t input_filename_length
int input_from_pipe
static
Nonzero means that the input of this command is coming from a pipe.   

Referenced by eval_spec_function().

struct stat input_stat
static

Referenced by do_spec_1().

int input_stat_set
static
const char* input_suffix
static
const char* invoke_as
static
Initial value:
"%{!fwpa:\
%{fcompare-debug=*|fdump-final-insns=*:%:compare-debug-dump-opt()}\
%{!S:-o %|.s |\n as %(asm_options) %|.s %A }\
}"
int is_cpp_driver
Flag set by cppspec.c to 1.   

Referenced by driver_handle_option().

const char* just_machine_suffix = 0
static
Suffix to attach to directories searched for commands.
   This is just `MACHINE/'.   

Referenced by for_each_path(), and main().

int last_language_n_infiles
static
const char* lib_spec = LIB_SPEC
static

Referenced by do_spec_1().

const char* libgcc_spec = LIBGCC_SPEC
static

Referenced by do_spec_1(), and init_spec().

const char* link_command_spec = LINK_COMMAND_SPEC
static
const char* link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC
static
const char* link_gomp_spec = ""
static
const char* link_libgcc_spec = LINK_LIBGCC_SPEC
static
const char* link_spec = LINK_SPEC
static

Referenced by do_spec_1(), init_spec(), and main().

const char* link_ssp_spec = LINK_SSP_SPEC
static
const char* linker_name_spec = LINKER_NAME
static

Referenced by main().

vec<char_p> linker_options
static
A vector of options to give to the linker.
   These options are accumulated by %x,
   and substituted into the linker command with %X.   
const char* linker_plugin_file_spec = ""
static

Referenced by main().

const char* lto_gcc_spec = ""
static

Referenced by main().

const char* lto_wrapper_spec = ""
static

Referenced by main().

const char* machine_suffix = 0
static
Suffix to attach to directories searched for commands.
   This looks like `MACHINE/VERSION/'.   

Referenced by for_each_path(), and main().

const char* md_exec_prefix = MD_EXEC_PREFIX
static
For native compilers, these are well-known paths containing
   components that may be provided by the system.  For cross
   compilers, these paths are not used.   

Referenced by main().

const char* md_startfile_prefix = MD_STARTFILE_PREFIX
static

Referenced by main().

const char* md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1
static

Referenced by main().

struct mdswitchstr* mdswitches
static
const char* mflib_spec = MFLIB_SPEC
static
const char* mfwrap_spec = MFWRAP_SPEC
static
const char* multiarch_dir
static
Subdirectory to use for locating libraries in multiarch conventions.  Set by
   set_multilib_dir based on the compilation options.   

Referenced by do_spec_1(), for_each_path(), main(), and set_multilib_dir().

const char* multilib_defaults
static

Referenced by main(), and set_multilib_dir().

const char* const multilib_defaults_raw[] = MULTILIB_DEFAULTS
static

Referenced by main().

const char* multilib_dir
static
Subdirectory to use for locating libraries.  Set by
   set_multilib_dir based on the compilation options.   

Referenced by do_spec_1(), for_each_path(), main(), and set_multilib_dir().

const char* multilib_exclusions
static
const char* multilib_matches
static

Referenced by main(), and used_arg().

struct obstack multilib_obstack
static
Some compilers have limits on line lengths, and the multilib_select
   and/or multilib_matches strings can be very long, so we build them at
   run time.   

Referenced by main(), and set_multilib_dir().

const char* multilib_os_dir
static
Subdirectory to use for locating libraries in OS conventions.  Set by
   set_multilib_dir based on the compilation options.   

Referenced by do_spec_1(), for_each_path(), main(), and set_multilib_dir().

const char* multilib_reuse
static

Referenced by main(), and set_multilib_dir().

const char* multilib_select
static
int n_compilers
static
Number of entries in `compilers', not counting the null terminator.   

Referenced by lookup_compiler(), main(), and read_specs().

const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1
static
Number of elements in default_compilers, not counting the terminator.   

Referenced by main().

int n_infiles_alloc
static
int n_mdswitches
static

Referenced by default_arg(), and used_arg().

int n_switches_alloc
static

Referenced by main().

int n_switches_alloc_debug_check[2]
static
int n_switches_debug_check[2]
static
struct default_spec option_default_specs[] = { OPTION_DEFAULT_SPECS }
static
const char** outfiles
And a vector of corresponding output files is made up later.   
vec<char_p> preprocessor_options
static
A vector of options to give to the preprocessor.
   These options are accumulated by -Wp,
   and substituted into the preprocessor command with %Z.   
int print_help_list
static
Definition of string containing the arguments given to configure.   
Flag saying to print the command line options understood by gcc and its
   sub-processes.   

Referenced by driver_handle_option(), execute(), main(), and process_command().

int print_subprocess_help
static
Flag indicating how to print command line options of sub-processes.   

Referenced by driver_handle_option(), main(), and process_command().

int print_version
static
Flag saying to print the version of gcc and its sub-processes.   

Referenced by driver_handle_option(), init_asm_output(), main(), parse_program_options(), process_args(), process_command(), process_options(), and toplev_main().

int processing_spec_function
static
FILE* report_times_to_file = NULL
Whether we should report subprocess execution times to a file.   

Referenced by driver_handle_option(), and execute().

enum save_temps save_temps_flag
static
size_t save_temps_length = 0
static

Referenced by do_spec_1(), and process_command().

char* save_temps_prefix = 0
static
Output file to use to get the object directory for -save-temps=obj   

Referenced by do_spec_1(), driver_handle_option(), and process_command().

const char* self_spec = ""
static
int signal_count
static
Number of commands that exited with a signal.   

Referenced by execute(), and main().

const char* spec_lang = 0
static
const char* spec_machine = DEFAULT_TARGET_MACHINE
static
The target machine.   

Referenced by driver_handle_option(), main(), and process_command().

const char* const spec_version = DEFAULT_TARGET_VERSION
static
The target version.   

Referenced by driver_handle_option(), main(), and process_command().

struct spec_list* specs = (struct spec_list *) 0
static
List of dynamically allocates specs that have been defined so far.   

Referenced by load_specs(), and set_spec().

const char* const standard_bindir_prefix = STANDARD_BINDIR_PREFIX
static

Referenced by process_command().

const char* const standard_exec_prefix = STANDARD_EXEC_PREFIX
static
These directories are locations set at configure-time based on the
   --prefix option provided to configure.  Their initializers are
   defined in Makefile.in.  These paths are not *directly* used when
   gcc_exec_prefix is set because, in that case, we know where the
   compiler has been installed, and use paths relative to that
   location instead.   

Referenced by main(), and process_command().

const char* const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX
static

Referenced by process_command().

const char* const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX
static

Referenced by main().

const char* const standard_startfile_prefix_1 = STANDARD_STARTFILE_PREFIX_1
static

Referenced by main().

const char* const standard_startfile_prefix_2 = STANDARD_STARTFILE_PREFIX_2
static

Referenced by main().

const char* startfile_prefix_spec = STARTFILE_PREFIX_SPEC
static

Referenced by main().

struct path_prefix startfile_prefixes = { 0, 0, "startfile" }
static
List of prefixes to try when looking for startup (crt0) files.   
const char* startfile_spec = STARTFILE_SPEC
static

Referenced by do_spec_1().

struct spec_function static_spec_functions[]
static
Initial value:
{
{ "getenv", getenv_spec_function },
{ "if-exists", if_exists_spec_function },
{ "if-exists-else", if_exists_else_spec_function },
{ "replace-outfile", replace_outfile_spec_function },
{ "remove-outfile", remove_outfile_spec_function },
{ "version-compare", version_compare_spec_function },
{ "include", include_spec_function },
{ "find-file", find_file_spec_function },
{ "find-plugindir", find_plugindir_spec_function },
{ "print-asm-header", print_asm_header_spec_function },
{ "compare-debug-dump-opt", compare_debug_dump_opt_spec_function },
{ "compare-debug-self-opt", compare_debug_self_opt_spec_function },
{ "compare-debug-auxbase-opt", compare_debug_auxbase_opt_spec_function },
{ "pass-through-libs", pass_through_libs_spec_func },
{ "replace-extension", replace_extension_spec_func },
#ifdef EXTRA_SPEC_FUNCTIONS
EXTRA_SPEC_FUNCTIONS
#endif
{ 0, 0 }
}
List of static spec functions.   
struct spec_list static_specs[]
static
List of statically defined specs.   
const char* suffix_subst
static
Nonnull means substitute this for any suffix when outputting a switches
   arguments.   

Referenced by eval_spec_function().

int suffixed_basename_length
static
struct switchstr* switches
static

Referenced by gen_producer_string(), and main().

struct switchstr* switches_debug_check[2]
static
const char* sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC
static

Referenced by do_spec_1(), and main().

const char* sysroot_spec = SYSROOT_SPEC
static
const char* sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC
static

Referenced by main().

const char* target_sysroot_hdrs_suffix = 0
static
Nonzero means append this string to target_system_root for headers.   

Referenced by do_spec_1(), and main().

const char* target_sysroot_suffix = 0
static
Nonzero means append this string to target_system_root.   

Referenced by add_sysrooted_prefix(), do_spec_1(), and main().

static const char * target_system_root = TARGET_SYSTEM_ROOT
static
Nonzero means place this string before uses of /, so that include
   and library files can be found in an alternate location.   

Referenced by add_sysrooted_prefix(), do_spec_1(), driver_handle_option(), main(), and process_command().

int target_system_root_changed
static
Nonzero means pass the updated target_system_root to the compiler.   

Referenced by do_spec_1(), driver_handle_option(), and process_command().

const char* temp_filename
static
Record the names of temporary files we tell compilers to write,
   and delete them at the end of the run.   
This is the common prefix we use to make temp file names.
   It is chosen once for each run of this program.
   It is substituted into a spec by %g or %j.
   Thus, all temp file names contain this prefix.
   In practice, all temp file names start with this prefix.

   This prefix comes from the envvar TMPDIR if it is defined;
   otherwise, from the P_tmpdir macro if that is defined;
   otherwise, in /usr/tmp or /tmp;
   or finally the current directory if all else fails.   

Referenced by do_spec_1(), and execute().

int temp_filename_length
static
Length of the prefix.   

Referenced by do_spec_1().

struct temp_name * temp_names
static

Referenced by do_spec_1().

int this_is_library_file
static
Nonzero means %s has been seen; the next arg to be terminated
   is the name of a library file and we should try the standard
   search dirs for it.   

Referenced by eval_spec_function().

int this_is_linker_script
static
Nonzero means %T has been seen; the next arg to be terminated
   is the name of a linker script and we should try all of the
   standard search dirs for it.  If it is found insert a --script
   command line switch and then substitute the full path in place,
   otherwise generate an error message.   

Referenced by eval_spec_function().

int this_is_output_file
static
Nonzero means %w has been seen; the next arg to be terminated
   is the output file name of this compilation.   

Referenced by eval_spec_function().

const char* const tooldir_base_prefix = TOOLDIR_BASE_PREFIX
static
A relative path to be used in finding the location of tools
   relative to the driver.   

Referenced by process_command().

const char* trad_capable_cpp = "cc1 -E %{traditional|traditional-cpp:-traditional-cpp}"
static
Standard options to cpp, cc1, and as, to reduce duplication in specs.
   There should be no need to override these in target dependent files,
   but we need to copy them to the specs file so that newer versions
   of the GCC driver can correctly drive older tool chains with the
   appropriate -B options.   
When cpplib handles traditional preprocessing, get rid of this, and
   call cc1 (or cc1obj in objc/lang-specs.h) from the main specs so
   that we default the front end language better.   
struct user_specs* user_specs_head
static
struct user_specs * user_specs_tail
static
int verbose_only_flag
static
Flag indicating whether we should ONLY print the command and
   arguments (like verbose_flag) without executing the command.
   Displayed arguments are quoted so that the generated command
   line is suitable for execution.  This is intended for use in
   shell scripts to capture the driver-generated command line.   

Referenced by driver_handle_option(), and execute().