#include "config.h"#include "system.h"#include "coretypes.h"#include "multilib.h"#include "tm.h"#include <signal.h>#include "xregex.h"#include "obstack.h"#include "intl.h"#include "prefix.h"#include "gcc.h"#include "flags.h"#include "opts.h"#include "configargs.h"#include "specs.h"

Go to the source code of this file.
Data Types | |
| type | default_spec |
| type | user_specs |
| type | compiler |
| type | option_map |
| type | prefix_list |
| type | path_prefix |
| type | spec_list |
| type | temp_name |
| type | temp_file |
| type | add_to_obstack_info |
| type | file_at_path_info |
| type | switchstr |
| type | infile |
| type | spec_path_info |
| type | mdswitchstr |
Defines | |
| #define | HOST_EXECUTABLE_SUFFIX "" |
| #define | TARGET_OBJECT_SUFFIX ".o" |
| #define | LIBRARY_PATH_ENV "LIBRARY_PATH" |
| #define | kill(p, s) raise(s) |
| #define | MIN_FATAL_STATUS 1 |
| #define | ASM_SPEC "" |
| #define | ASM_FINAL_SPEC "" |
| #define | CPP_SPEC "" |
| #define | CC1_SPEC "" |
| #define | CC1PLUS_SPEC "" |
| #define | LINK_SPEC "" |
| #define | LIB_SPEC "%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}" |
| #define | MFWRAP_SPEC " %{static: %{fmudflap|fmudflapth: \ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\ --wrap=mmap --wrap=munmap --wrap=alloca\} %{fmudflapth: --wrap=pthread_create\}} %{fmudflap|fmudflapth: --wrap=main}" |
| #define | MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}" |
| #define | LIBGCC_SPEC "-lgcc" |
| #define | STARTFILE_SPEC "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}" |
| #define | SWITCHES_NEED_SPACES "" |
| #define | ENDFILE_SPEC "" |
| #define | LINKER_NAME "collect2" |
| #define | ASM_DEBUG_SPEC "" |
| #define | LINK_GCC_C_SEQUENCE_SPEC "%G %L %G" |
| #define | LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}" |
| #define | LINK_PIE_SPEC "%{pie:} " |
| #define | LINK_COMMAND_SPEC "\%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" |
| #define | LINK_LIBGCC_SPEC "%D" |
| #define | STARTFILE_PREFIX_SPEC "" |
| #define | SYSROOT_SPEC "--sysroot=%R" |
| #define | SYSROOT_SUFFIX_SPEC "" |
| #define | SYSROOT_HEADERS_SUFFIX_SPEC "" |
| #define | MULTILIB_DEFAULTS { "" } |
| #define | DRIVER_SELF_SPECS "" |
| #define | GOMP_SELF_SPECS "%{fopenmp: -pthread}" |
| #define | OPTION_DEFAULT_SPECS { "", "" } |
| #define | SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR) |
| #define | WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR) |
| #define | STANDARD_STARTFILE_PREFIX_1 "/lib/" |
| #define | STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" |
| #define | MD_EXEC_PREFIX "" |
| #define | MD_STARTFILE_PREFIX "" |
| #define | MD_STARTFILE_PREFIX_1 "" |
| #define | INIT_STATIC_SPEC(NAME, PTR) { NAME, NULL, PTR, (struct spec_list *) 0, sizeof (NAME) - 1, 0 } |
| #define | DELETE_IF_ORDINARY(NAME, ST, VERBOSE_FLAG) |
| #define | SWITCH_OK 0 |
| #define | SWITCH_FALSE -1 |
| #define | SWITCH_IGNORE -2 |
| #define | SWITCH_LIVE 1 |
| #define | SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0) |
| #define | SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0) |
Enumerations | |
| enum | path_prefix_priority { PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST, PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST, PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST, PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST } |
Functions/Subroutines | |
| static void | init_spec (void) |
| static void | store_arg (const char *, int, int) |
| static char * | load_specs (const char *) |
| static void | read_specs (const char *, int) |
| static void | set_spec (const char *, const char *) |
| static struct compiler * | lookup_compiler (const char *, size_t, const char *) |
| static char * | build_search_list (const struct path_prefix *, const char *, bool, bool) |
| 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 void | translate_options (int *, const char *const **) |
| 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_function * | lookup_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 *) |
| static void | validate_all_switches (void) |
| static void | validate_switches_from_spec (const char *) |
| 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 | fatal_ice (const char *,...) |
| static void | alloc_args (void) |
| static void | clear_args (void) |
| void | record_temp_file (const char *filename, int always_delete, int fail_delete) |
| 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 (char *path, void *data) |
| static void * | file_at_path (char *path, void *data) |
| static int | execute (void) |
| static void | display_help (void) |
| static void | add_preprocessor_option (const char *option, int len) |
| static void | add_assembler_option (const char *option, int len) |
| static void | add_linker_option (const char *option, int len) |
| static void | process_command (int argc, const char **argv) |
| int | do_spec (const char *spec) |
| static void * | spec_path (char *path, void *data) |
| void | set_input (const char *filename) |
| static void | fatal_error (int signum) |
| int | main (int, char **) |
| int | main (int argc, char **argv) |
| void | pfatal_with_name (const char *name) |
| void | fancy_abort (const char *file, int line, const char *func) |
| void | fatal (const char *cmsgid,...) |
| void | error (const char *gmsgid,...) |
| static void | notice (const char *cmsgid,...) |
| static const char * | if_exists_spec_function (int argc, const char **argv) |
| static const char * | if_exists_else_spec_function (int argc, const char **argv) |
| static const char * | replace_outfile_spec_function (int argc, const char **argv) |
| static int | compare_version_strings (const char *v1, const char *v2) |
| static const char * | version_compare_spec_function (int argc, const char **argv) |
| static const char * | include_spec_function (int argc, const char **argv) |
Variables | |
| static const char | dir_separator_str [] = { DIR_SEPARATOR, 0 } |
| int | is_cpp_driver |
| static int | pass_exit_codes |
| static int | print_search_dirs |
| static const char * | print_file_name = NULL |
| static const char * | print_prog_name = NULL |
| static int | print_multi_directory |
| static int | print_multi_os_directory |
| static int | print_multi_lib |
| static int | print_help_list |
| static int | verbose_flag |
| static int | verbose_only_flag |
| static int | target_help_flag |
| static int | report_times |
| static const char * | target_system_root = 0 |
| static int | target_system_root_changed |
| static const char * | target_sysroot_suffix = 0 |
| static const char * | target_sysroot_hdrs_suffix = 0 |
| static int | save_temps_flag |
| static int | combine_flag = 0 |
| static int | use_pipes |
| 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 = "0" |
| static int | error_count = 0 |
| static int | greatest_status = 1 |
| static struct obstack | obstack |
| static struct obstack | collect_obstack |
| 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 |
| static const char * | invoke_as |
| 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 *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_specs * | user_specs_head |
| static struct user_specs * | user_specs_tail |
| static struct compiler * | compilers |
| static int | n_compilers |
| static struct compiler | default_compilers [] |
| static const int | n_default_compilers = ARRAY_SIZE (default_compilers) - 1 |
| static int | n_linker_options |
| static char ** | linker_options |
| static int | n_assembler_options |
| static char ** | assembler_options |
| static int | n_preprocessor_options |
| static char ** | preprocessor_options |
| static struct option_map | option_map [] |
| 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_exec_prefix_1 = "/usr/libexec/gcc/" |
| static const char *const | standard_exec_prefix_2 = "/usr/lib/gcc/" |
| 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 = STANDARD_STARTFILE_PREFIX |
| 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 * | tooldir_prefix |
| static const char *const | standard_bindir_prefix = STANDARD_BINDIR_PREFIX |
| static const char * | standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX |
| static const char * | multilib_dir |
| static const char * | multilib_os_dir |
| static struct spec_list | static_specs [] |
| static struct spec_list * | specs = (struct spec_list *) 0 |
| static struct spec_function | static_spec_functions [] |
| static int | processing_spec_function |
| static const char ** | argbuf |
| static int | argbuf_length |
| static int | argbuf_index |
| static int | have_o_argbuf_index = 0 |
| static int | have_c = 0 |
| static int | have_o = 0 |
| static struct temp_name * | temp_names |
| static int | execution_count |
| static int | signal_count |
| static const char * | programname |
| static const char * | temp_filename |
| static int | temp_filename_length |
| static struct temp_file * | always_delete_queue |
| static struct temp_file * | failure_delete_queue |
| static struct switchstr * | switches |
| static int | n_switches |
| static struct infile * | infiles |
| int | n_infiles |
| static bool | combine_inputs |
| static int | added_libraries |
| const char ** | outfiles |
| static const char * | 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 compiler * | input_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 | input_from_pipe |
| static const char * | suffix_subst |
| static struct mdswitchstr * | mdswitches |
| static int | n_mdswitches |
| #define ASM_DEBUG_SPEC "" |
| #define ASM_FINAL_SPEC "" |
| #define ASM_SPEC "" |
| #define CC1_SPEC "" |
| #define CC1PLUS_SPEC "" |
| #define CPP_SPEC "" |
| #define DELETE_IF_ORDINARY | ( | NAME, | |||
| ST, | |||||
| VERBOSE_FLAG | ) |
| #define ENDFILE_SPEC "" |
| #define LIBGCC_SPEC "-lgcc" |
| #define LINK_COMMAND_SPEC "\%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" |
| #define LINK_LIBGCC_SPEC "%D" |
| #define LINK_PIE_SPEC "%{pie:} " |
| #define LINK_SPEC "" |
| #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}" |
Referenced by fatal_ice().
| #define LINKER_NAME "collect2" |
| #define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}" |
| #define MFWRAP_SPEC " %{static: %{fmudflap|fmudflapth: \ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\ --wrap=mmap --wrap=munmap --wrap=alloca\} %{fmudflapth: --wrap=pthread_create\}} %{fmudflap|fmudflapth: --wrap=main}" |
| #define STARTFILE_PREFIX_SPEC "" |
| #define STARTFILE_SPEC "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}" |
| #define SWITCHES_NEED_SPACES "" |
| #define SYSROOT_HEADERS_SUFFIX_SPEC "" |
| #define SYSROOT_SPEC "--sysroot=%R" |
Referenced by fatal_ice().
| #define SYSROOT_SUFFIX_SPEC "" |
| #define WORD_SWITCH_TAKES_ARG | ( | STR | ) | DEFAULT_WORD_SWITCH_TAKES_ARG (STR) |
| enum path_prefix_priority |
| static int access_check | ( | const char * | name, | |
| int | mode | |||
| ) | [static] |
| static void add_assembler_option | ( | const char * | option, | |
| int | len | |||
| ) | [static] |
| static void add_linker_option | ( | const char * | option, | |
| int | len | |||
| ) | [static] |
| static void add_prefix | ( | struct path_prefix * | pprefix, | |
| const char * | prefix, | |||
| const char * | component, | |||
| int | priority, | |||
| int | require_machine_suffix, | |||
| int | os_multilib | |||
| ) | [static] |
Definition at line 2729 of file gcc.c.
References len, path_prefix::max_len, prefix_list::next, NULL, prefix_list::os_multilib, pl, path_prefix::plist, prefix_list::prefix, prev, prefix_list::priority, prefix_list::require_machine_suffix, strlen(), update_path(), and XNEW.
| static void add_preprocessor_option | ( | const char * | option, | |
| int | len | |||
| ) | [static] |
| 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] |
Definition at line 2761 of file gcc.c.
References add_prefix(), concat(), fatal(), IS_ABSOLUTE_PATH, NULL, target_sysroot_suffix, and target_system_root.
Definition at line 2556 of file gcc.c.
References add_to_obstack_info::check_dir, add_to_obstack_info::first_time, info, is_directory(), NULL, add_to_obstack_info::ob, obstack_1grow, obstack_grow, PATH_SEPARATOR, and strlen().
Referenced by build_search_list().
| static char * build_search_list | ( | const struct path_prefix * | paths, | |
| const char * | prefix, | |||
| bool | check_dir, | |||
| bool | do_multi | |||
| ) | [static] |
Definition at line 2581 of file gcc.c.
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, obstack_1grow, obstack_grow, strlen(), and XOBFINISH.
| static int check_live_switch | ( | int | switchnum, | |
| int | prefix_length | |||
| ) | [static] |
Definition at line 5869 of file gcc.c.
References i, switchstr::live_cond, switchstr::part1, strcmp(), strncmp(), SWITCH_FALSE, SWITCH_LIVE, and switchstr::validated.
| static int compare_version_strings | ( | const char * | v1, | |
| const char * | v2 | |||
| ) | [static] |
Definition at line 7749 of file gcc.c.
References abort, fatal(), NULL, r, REG_EXTENDED, REG_NOMATCH, REG_NOSUB, regcomp, regexec, and strverscmp().
Referenced by version_compare_spec_function().
| static int default_arg | ( | const char * | p, | |
| int | len | |||
| ) | [static] |
Definition at line 2373 of file gcc.c.
References delete_if_ordinary(), temp_file::name, and temp_file::next.
| static void delete_if_ordinary | ( | const char * | name | ) | [static] |
Definition at line 2342 of file gcc.c.
References c, DELETE_IF_ORDINARY, EOF, fflush(), getchar(), i, printf(), and verbose_flag.
Definition at line 2361 of file gcc.c.
References delete_if_ordinary(), temp_file::name, and temp_file::next.
| static void do_option_spec | ( | const char * | name, | |
| const char * | spec | |||
| ) | [static] |
| static void do_self_spec | ( | const char * | spec | ) | [static] |
Definition at line 4507 of file gcc.c.
References switchstr::args, do_spec_1(), do_spec_2(), fatal(), first, i, switchstr::live_cond, NULL, switchstr::ordering, switchstr::part1, SWITCH_OK, switchstr::validated, and xrealloc().
| int do_spec | ( | const char * | spec | ) |
Definition at line 4399 of file gcc.c.
References do_spec_2(), execute(), set_collect_gcc_options(), and strcmp().
| static int do_spec_1 | ( | const char * | spec, | |
| int | inswitch, | |||
| const char * | soft_matched_part | |||
| ) | [static] |
Definition at line 4604 of file gcc.c.
References access, add_linker_option(), alloca, spec_path_info::append, spec_path_info::append_len, buf, c, clear_args(), infile::compiled, compiler::cpp_spec, create_temp_file(), do_spec_1(), error(), execute(), fatal(), temp_name::filename, temp_name::filename_length, find_file(), for_each_path(), free(), handle_braces(), handle_spec_function(), HOST_BIT_BUCKET, i, input_stat, ISALNUM, lang_specific_extra_outfiles, infile::language, len, temp_name::length, switchstr::live_cond, lrealpath(), make_temp_file(), max, spec_list::name, spec_list::name_len, temp_name::next, spec_list::next, notice(), NULL, obstack_1grow, obstack_grow, spec_path_info::omit_relative, spec_path_info::option, p, p1, spec_list::ptr_spec, q, record_temp_file(), S_ISDIR, save_string(), save_temps_flag, spec_path_info::separate_options, set_collect_gcc_options(), sl, spec_path(), stat::st_dev, stat::st_ino, stat::st_mode, stat, store_arg(), strcmp(), strcpy, strlen(), strncmp(), strncpy(), temp_name::suffix, SWITCH_IGNORE, TARGET_OBJECT_SUFFIX, target_sysroot_hdrs_suffix, target_sysroot_suffix, target_system_root, target_system_root_changed, temp_names, temp_name::unique, use_pipes, switchstr::validated, W_OK, x, xmalloc(), XNEWVEC, XOBFINISH, and is::y.
| static int do_spec_2 | ( | const char * | spec | ) | [static] |
Definition at line 4422 of file gcc.c.
References clear_args(), do_spec_1(), find_file(), NULL, obstack_1grow, result, store_arg(), and XOBFINISH.
| void error | ( | const char * | gmsgid, | |
| ... | ||||
| ) |
| static const char * eval_spec_function | ( | const char * | func, | |
| const char * | args | |||
| ) | [static] |
Definition at line 5421 of file gcc.c.
References alloc_args(), do_spec_2(), fatal(), free(), spec_function::func, lookup_spec_function(), and NULL.
| static int execute | ( | void | ) | [static] |
Definition at line 2791 of file gcc.c.
References _, alloca, bug_report_url, commands, double, err, errno, fatal(), fatal_ice(), fflush(), find_a_file(), fprintf(), fputc(), free(), gcc_assert, getchar(), greatest_status, i, MIN_FATAL_STATUS, notice(), NULL, p, pex, pex_free(), pex_get_status(), pex_get_times(), pex_init(), PEX_LAST, PEX_RECORD_TIMES, pex_run(), PEX_SEARCH, PEX_USE_PIPES, pfatal_with_name(), print_help_list, pt, report_times, SIGPIPE, strcmp(), strsignal(), pex_time::system_microseconds, pex_time::system_seconds, times, pex_time::user_microseconds, pex_time::user_seconds, verbose_flag, verbose_only_flag, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG, and X_OK.
| void fancy_abort | ( | const char * | file, | |
| int | line, | |||
| const char * | func | |||
| ) |
| void fatal | ( | const char * | cmsgid, | |
| ... | ||||
| ) |
Definition at line 6878 of file gcc.c.
References _, delete_temp_files(), exit(), fprintf(), va_end, va_start, and vfprintf().
| static void fatal_error | ( | int | signum | ) | [static] |
Definition at line 6080 of file gcc.c.
References delete_failure_queue(), delete_temp_files(), getpid, kill, and signal().
| void fatal_ice | ( | const char * | cmsgid, | |
| ... | ||||
| ) | [static] |
Definition at line 342 of file gcc.c.
References LINK_LIBGCC_SPEC, LINK_SSP_SPEC, STARTFILE_PREFIX_SPEC, SYSROOT_HEADERS_SUFFIX_SPEC, SYSROOT_SPEC, and SYSROOT_SUFFIX_SPEC.
Referenced by execute(), and fancy_abort().
Definition at line 2640 of file gcc.c.
References access_check(), info, len, memcpy, file_at_path_info::mode, file_at_path_info::name, file_at_path_info::name_len, NULL, strlen(), file_at_path_info::suffix, and file_at_path_info::suffix_len.
Referenced by find_a_file().
| static char * find_a_file | ( | const struct path_prefix * | pprefix, | |
| const char * | name, | |||
| int | mode, | |||
| bool | do_multi | |||
| ) | [static] |
Definition at line 2670 of file gcc.c.
References access, DEFAULT_LINKER, file_at_path(), for_each_path(), HOST_EXECUTABLE_SUFFIX, IS_ABSOLUTE_PATH, file_at_path_info::mode, file_at_path_info::name, file_at_path_info::name_len, NULL, strcmp(), strlen(), file_at_path_info::suffix, file_at_path_info::suffix_len, X_OK, and xstrdup().
| static const char * find_file | ( | const char * | name | ) | [static] |
| 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] |
Definition at line 2401 of file gcc.c.
References callback(), concat(), dir_separator_str, free(), len, path_prefix::max_len, memcpy, prefix_list::next, NULL, prefix_list::os_multilib, path, pl, path_prefix::plist, prefix_list::prefix, prefix_list::require_machine_suffix, ret, strcmp(), strlen(), and XNEWVEC.
Referenced by build_search_list(), do_spec_1(), and find_a_file().
| static void give_switch | ( | int | switchnum, | |
| int | omit_first_word | |||
| ) | [static] |
Definition at line 5943 of file gcc.c.
References args, do_spec_1(), dot, IS_DIR_SEPARATOR, length, NULL, p, strlen(), SWITCH_IGNORE, and switchstr::validated.
| static const char * handle_braces | ( | const char * | p | ) | [static] |
Definition at line 5630 of file gcc.c.
References fatal(), input_suffix_matches(), invalid(), ISIDNUM, mark_matching_switches(), NULL, process_brace_body(), process_marked_switches(), SKIP_WHITE, and switch_matches().
| static const char * handle_spec_function | ( | const char * | p | ) | [static] |
Definition at line 5493 of file gcc.c.
References args, count, do_spec_1(), eval_spec_function(), fatal(), free(), func, ISALNUM, NULL, and save_string().
| static const char* if_exists_else_spec_function | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
| static const char* if_exists_spec_function | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
| static const char* include_spec_function | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
Definition at line 7868 of file gcc.c.
References abort, FALSE, find_a_file(), NULL, R_OK, and read_specs().
Definition at line 1663 of file gcc.c.
References ARRAY_SIZE, ASM_DEBUG_SPEC, i, LINK_EH_SPEC, spec_list::name, spec_list::name_len, next, spec_list::next, notice(), obstack_1grow, obstack_grow, obstack_grow0, p, spec_list::ptr, spec_list::ptr_spec, sl, strlen(), strncmp(), tf, verbose_flag, xcalloc(), and XOBFINISH.
| static bool input_suffix_matches | ( | const char * | atom, | |
| const char * | end_atom | |||
| ) | [inline, static] |
| static int is_directory | ( | const char * | path1, | |
| bool | linker | |||
| ) | [static] |
Definition at line 6003 of file gcc.c.
References alloca, DIR_SEPARATOR, IS_DIR_SEPARATOR, memcpy, path, S_ISDIR, stat::st_mode, strlen(), and strncmp().
| static char * load_specs | ( | const char * | filename | ) | [static] |
Definition at line 1960 of file gcc.c.
References c, close, free(), notice(), O_RDONLY, open, pfatal_with_name(), read, skip, stat::st_size, verbose_flag, and XNEWVEC.
| static struct compiler * lookup_compiler | ( | const char * | name, | |
| size_t | length, | |||
| const char * | language | |||
| ) | [static, read] |
Definition at line 6763 of file gcc.c.
References error(), lookup_compiler(), NULL, compiler::spec, strcasecmp(), strcmp(), strlen(), strpbrk(), and compiler::suffix.
| static struct spec_function * lookup_spec_function | ( | const char * | name | ) | [static, read] |
| int main | ( | int argc | , | |
| char ** | argv | |||
| ) |
Definition at line 6093 of file gcc.c.
References _, access, add_prefix(), add_sysrooted_prefix(), alloc_args(), alloca, ARRAY_SIZE, bug_report_url, build_search_list(), clear_failure_queue(), collect_obstack, compiler::combinable, combine_flag, infile::compiled, compiler_version, concat(), configuration_arguments, cross_compile, delete_failure_queue(), delete_temp_files(), dir_separator_str, display_help(), do_option_spec(), do_self_spec(), do_spec(), do_spec_1(), do_spec_2(), error(), error_count, expandargv(), FALSE, fatal(), fatal_error(), filename, user_specs::filename, find_a_file(), find_file(), GCC_DRIVER_HOST_INITIALIZATION, gcc_init_libintl, greatest_status, i, infile::incompiler, INIT_ENVIRONMENT, init_spec(), IS_ABSOLUTE_PATH, IS_DIR_SEPARATOR, lang_specific_extra_outfiles, lang_specific_pre_link(), LIBRARY_PATH_ENV, lookup_compiler(), memcpy, multilib_exclusions_raw, multilib_matches_raw, multilib_obstack, multilib_raw, n, infile::name, compiler::needs_preprocessing, user_specs::next, notice(), NULL, obstack_1grow, obstack_grow, obstack_grow0, obstack_init, p, pass_exit_codes, PREFIX_PRIORITY_LAST, infile::preprocessed, print_file_name, print_help_list, print_multi_directory, print_multi_lib, print_multi_os_directory, print_multilib_info(), print_prog_name, print_search_dirs, printf(), process_command(), prune_options(), putenv, putenv_from_prefixes(), q, R_OK, read_specs(), s, save_temps_flag, set_input(), set_multilib_dir(), set_spec(), signal(), SIGPIPE, compiler::spec, spec_machine, spec_version, standard_startfile_prefix_1, standard_startfile_prefix_2, strcat(), strcmp(), strcpy, strlen(), strncmp(), target_help_flag, target_sysroot_hdrs_suffix, target_sysroot_suffix, target_system_root, thread_model, THREAD_MODEL_SPEC, tmp, TRUE, unlock_std_streams(), validate_all_switches(), verbose_flag, version_string, X_OK, XCNEWVEC, xmalloc(), xmalloc_set_program_name(), XOBFINISH, and xstrdup().
| static void mark_matching_switches | ( | const char * | atom, | |
| const char * | end_atom, | |||
| int | starred | |||
| ) | [inline, static] |
Definition at line 5597 of file gcc.c.
References check_live_switch(), i, len, switchstr::ordering, and strncmp().
| static void notice | ( | const char * | cmsgid, | |
| ... | ||||
| ) | [static] |
| static void perror_with_name | ( | const char * | name | ) | [static] |
| void pfatal_with_name | ( | const char * | name | ) |
Definition at line 6839 of file gcc.c.
References delete_temp_files(), exit(), and perror_with_name().
| static const char * process_brace_body | ( | const char * | p, | |
| const char * | atom, | |||
| const char * | end_atom, | |||
| int | starred, | |||
| int | matched | |||
| ) | [static] |
Definition at line 5785 of file gcc.c.
References check_live_switch(), do_spec_1(), fatal(), give_switch(), i, invalid(), NULL, save_string(), and strncmp().
| static void process_command | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
Definition at line 3280 of file gcc.c.
References _, access, access_check(), ADD, add_assembler_option(), add_linker_option(), add_prefix(), add_preprocessor_option(), alloca, switchstr::args, ARRAY_SIZE, c, combine_flag, compiler_version, concat(), concat_length(), convert_filename, cross_compile, DELETE, DIR_SEPARATOR, dir_separator_str, errno, error(), error_count, execvp(), exit(), F_OK, fatal(), user_specs::filename, fputs(), free(), GET_ENVIRONMENT, i, init_spec(), IS_ABSOLUTE_PATH, is_cpp_driver, IS_DIR_SEPARATOR, is_directory(), ISDIGIT, lang_specific_driver(), infile::language, len, LIBRARY_PATH_ENV, switchstr::live_cond, make_relative_prefix(), memcpy, spec_list::name, infile::name, user_specs::next, spec_list::next, NULL, opt, switchstr::ordering, p, switchstr::part1, pass_exit_codes, PATH_SEPARATOR, perror_with_name(), PREFIX_PRIORITY_B_OPT, PREFIX_PRIORITY_LAST, prev, print_file_name, print_help_list, print_multi_directory, print_multi_lib, print_multi_os_directory, print_prog_name, print_search_dirs, printf(), progname, spec_list::ptr_spec, putenv, q, r, report_times, save_string(), save_temps_flag, set_std_prefix(), skip, sl, spec_machine, spec_version, str, strcat(), strchr, strcmp(), strcpy, strlen(), strncmp(), strncpy(), SWITCH_OK, SWITCH_TAKES_ARG, target_help_flag, target_system_root, target_system_root_changed, tmp, translate_options(), use_pipes, switchstr::validated, verbose_flag, verbose_only_flag, version_string, WORD_SWITCH_TAKES_ARG, xmalloc(), xmemdup(), XNEW, XNEWVEC, xstrdup(), and xstrerror().
Definition at line 5613 of file gcc.c.
References give_switch(), i, ordering, and switchstr::ordering.
| static void putenv_from_prefixes | ( | const struct path_prefix * | paths, | |
| const char * | env_var, | |||
| bool | do_multi | |||
| ) | [static] |
| static void read_specs | ( | const char * | filename, | |
| int | main_p | |||
| ) | [static] |
Definition at line 2024 of file gcc.c.
References spec_list::alloc_p, FALSE, fatal(), find_a_file(), free(), in, ISALPHA, ISSPACE, load_specs(), memset, spec_list::name, spec_list::name_len, spec_list::next, notice(), out, p, p1, p2, p3, spec_list::ptr_spec, R_OK, read_specs(), save_string(), set_spec(), skip_whitespace(), sl, compiler::spec, strcmp(), strncmp(), compiler::suffix, verbose_flag, and xrealloc().
| void record_temp_file | ( | const char * | filename, | |
| int | always_delete, | |||
| int | fail_delete | |||
| ) |
Definition at line 2293 of file gcc.c.
References temp_file::name, temp_file::next, strcmp(), xmalloc(), XNEW, and xstrdup().
| static const char* replace_outfile_spec_function | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
| static char * save_string | ( | const char * | s, | |
| int | len | |||
| ) | [static] |
Definition at line 4292 of file gcc.c.
References args, collect_obstack, FALSE, first_time, i, obstack_grow, p, switchstr::part1, putenv, q, strchr, strlen(), SWITCH_IGNORE, TRUE, and XOBFINISH.
| void set_input | ( | const char * | filename | ) |
Definition at line 7197 of file gcc.c.
References default_arg(), end, fatal(), first, free(), i, mdswitchstr::len, memcpy, multilib_obstack, NULL, obstack_1grow, obstack_grow, ok(), p, q, start, mdswitchstr::str, strchr, strcmp(), strncpy(), used_arg(), XNEWVEC, and XOBFINISH.
| static void set_spec | ( | const char * | name, | |
| const char * | spec | |||
| ) | [static] |
Definition at line 1811 of file gcc.c.
References spec_list::alloc_p, ARRAY_SIZE, concat(), free(), i, ISSPACE, spec_list::name, spec_list::name_len, next, spec_list::next, notice(), NULL, spec_list::ptr, spec_list::ptr_spec, sl, strcmp(), strlen(), verbose_flag, XNEW, and xstrdup().
Definition at line 4551 of file gcc.c.
References spec_path_info::append, spec_path_info::append_len, do_spec_1(), info, IS_ABSOLUTE_PATH, IS_DIR_SEPARATOR, is_directory(), len, memcpy, NULL, spec_path_info::omit_relative, spec_path_info::option, save, spec_path_info::separate_options, and strlen().
Referenced by do_spec_1().
| static void store_arg | ( | const char * | arg, | |
| int | delete_always, | |||
| int | delete_failure | |||
| ) | [static] |
| static bool switch_matches | ( | const char * | atom, | |
| const char * | end_atom, | |||
| int | starred | |||
| ) | [inline, static] |
| static void translate_options | ( | int * | argcp, | |
| const char *const ** | argvp | |||
| ) | [static] |
Definition at line 1176 of file gcc.c.
References option_map::arg_info, ARRAY_SIZE, c, concat(), option_map::equivalent, error(), i, NULL, p, replacements, sp, spaces(), strchr, strcmp(), strlen(), strncmp(), SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG, xmalloc(), xrealloc(), and xstrdup().
| static int used_arg | ( | const char * | p, | |
| int | len | |||
| ) | [static] |
Definition at line 7035 of file gcc.c.
References alloca, fatal(), i, mdswitchstr::len, multilib_options, NULL, q, r, replace, mdswitchstr::str, str, strchr, strlen(), strncmp(), SWITCH_IGNORE, used_arg(), and XNEWVEC.
Definition at line 6933 of file gcc.c.
References comp, spec_list::next, spec_list::ptr_spec, compiler::spec, and validate_switches_from_spec().
| static const char * validate_switches | ( | const char * | start | ) | [static] |
Definition at line 6952 of file gcc.c.
References i, ISIDNUM, len, p, SKIP_WHITE, strncmp(), validate_switches(), and switchstr::validated.
| static void validate_switches_from_spec | ( | const char * | spec | ) | [inline, static] |
| static const char* version_compare_spec_function | ( | int | argc, | |
| const char ** | argv | |||
| ) | [static] |
Definition at line 7798 of file gcc.c.
References abort, check_live_switch(), compare_version_strings(), fatal(), i, NULL, switchstr::part1, result, strlen(), and strncmp().
int added_libraries [static] |
struct temp_file* always_delete_queue [static] |
int argbuf_index [static] |
int argbuf_length [static] |
const char* asm_options [static] |
char** assembler_options [static] |
int basename_length [static] |
const char* cc1_options [static] |
Initial value:
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\ %{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} %{--help:--help}\ %{--target-help:--target-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}"
struct obstack collect_obstack [static] |
int combine_flag = 0 [static] |
bool combine_inputs [static] |
const char* compiler_version [static] |
const char* cpp_debug_options = "%{d*}" [static] |
const char* cpp_options [static] |
const char* cpp_unique_options [static] |
Initial value:
"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\ %{!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:%{MD|MMD:%{o*:-MQ %*}}}}}\ %{remap} %{g3:-dD} %{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*}}"
const char* cross_compile = "0" [static] |
struct compiler default_compilers[] [static] |
int delete_this_arg [static] |
const char dir_separator_str[] = { DIR_SEPARATOR, 0 } [static] |
const char* const driver_self_specs[] [static] |
int error_count = 0 [static] |
struct path_prefix exec_prefixes = { 0, 0, "exec" } [static] |
int execution_count [static] |
struct temp_file* failure_delete_queue [static] |
const char* gcc_exec_prefix [static] |
const char* gcc_libexec_prefix [static] |
int greatest_status = 1 [static] |
int have_c = 0 [static] |
int have_o = 0 [static] |
int have_o_argbuf_index = 0 [static] |
struct path_prefix include_prefixes = { 0, 0, "include" } [static] |
const char* input_basename [static] |
struct compiler* input_file_compiler [static] |
int input_file_number [static] |
const char* input_filename [static] |
int input_from_pipe [static] |
struct stat input_stat [static] |
int input_stat_set [static] |
const char* input_suffix [static] |
const char* invoke_as [static] |
| int is_cpp_driver |
const char* just_machine_suffix = 0 [static] |
char** linker_options [static] |
const char* machine_suffix = 0 [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] |
struct mdswitchstr* mdswitches [static] |
const char* multilib_defaults [static] |
const char* const multilib_defaults_raw[] = MULTILIB_DEFAULTS [static] |
const char* multilib_dir [static] |
const char* multilib_exclusions [static] |
const char* multilib_matches [static] |
struct obstack multilib_obstack [static] |
const char* multilib_os_dir [static] |
const char* multilib_select [static] |
int n_assembler_options [static] |
int n_compilers [static] |
const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1 [static] |
int n_linker_options [static] |
int n_mdswitches [static] |
int n_preprocessor_options [static] |
int n_switches [static] |
struct default_spec option_default_specs[] = { OPTION_DEFAULT_SPECS } [static] |
struct option_map option_map[] [static] |
int pass_exit_codes [static] |
char** preprocessor_options [static] |
const char* print_file_name = NULL [static] |
int print_help_list [static] |
int print_multi_directory [static] |
int print_multi_os_directory [static] |
const char* print_prog_name = NULL [static] |
int print_search_dirs [static] |
int processing_spec_function [static] |
const char* programname [static] |
int report_times [static] |
int save_temps_flag [static] |
int signal_count [static] |
const char* spec_machine = DEFAULT_TARGET_MACHINE [static] |
const char* const spec_version = DEFAULT_TARGET_VERSION [static] |
const char* const standard_bindir_prefix = STANDARD_BINDIR_PREFIX [static] |
const char* const standard_exec_prefix = STANDARD_EXEC_PREFIX [static] |
const char* const standard_exec_prefix_1 = "/usr/libexec/gcc/" [static] |
const char* const standard_exec_prefix_2 = "/usr/lib/gcc/" [static] |
const char* standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX [static] |
const char* const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX [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] |
struct path_prefix startfile_prefixes = { 0, 0, "startfile" } [static] |
struct spec_function static_spec_functions[] [static] |
Initial value:
{
{ "if-exists", if_exists_spec_function },
{ "if-exists-else", if_exists_else_spec_function },
{ "replace-outfile", replace_outfile_spec_function },
{ "version-compare", version_compare_spec_function },
{ "include", include_spec_function },
{ 0, 0 }
}
struct spec_list static_specs[] [static] |
const char* suffix_subst [static] |
int suffixed_basename_length [static] |
int target_help_flag [static] |
const char* target_sysroot_hdrs_suffix = 0 [static] |
const char* target_sysroot_suffix = 0 [static] |
const char* target_system_root = 0 [static] |
int target_system_root_changed [static] |
const char* temp_filename [static] |
int temp_filename_length [static] |
struct temp_name * temp_names [static] |
int this_is_library_file [static] |
int this_is_output_file [static] |
const char* const tooldir_base_prefix = TOOLDIR_BASE_PREFIX [static] |
const char* tooldir_prefix [static] |
struct user_specs* user_specs_head [static] |
struct user_specs * user_specs_tail [static] |
int verbose_flag [static] |
int verbose_only_flag [static] |
1.5.6