gcc12/gcc-add-defaultsspec.diff
OBS User rguenther bb2df50317 - Bump to 3c4a54adb2164315d18fd8980c0fc37eb3d22252.
- Rebase patches after .cc renaming.

Rev devel:gcc/7 Md5 84ac538e563a2bb1a5669fec2c7064b5 2022-01-19 07:52:04 rguenther 947294
2022-01-19 07:52:04 +00:00

52 lines
2.0 KiB
Diff

Index: gcc/gcc.cc
===================================================================
--- gcc/gcc.cc.orig 2013-11-26 15:41:59.000000000 +0100
+++ gcc/gcc.cc 2013-11-26 16:40:35.780548125 +0100
@@ -258,6 +258,7 @@ static const char *replace_outfile_spec_
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 *include_noerr_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 **);
@@ -1357,6 +1358,7 @@ static const struct spec_function static
{ "remove-outfile", remove_outfile_spec_function },
{ "version-compare", version_compare_spec_function },
{ "include", include_spec_function },
+ { "include_noerr", include_noerr_spec_function },
{ "find-file", find_file_spec_function },
{ "find-plugindir", find_plugindir_spec_function },
{ "print-asm-header", print_asm_header_spec_function },
@@ -6480,6 +6482,8 @@ main (int argc, char **argv)
if (access (specs_file, R_OK) == 0)
read_specs (specs_file, true, false);
+ do_self_spec ("%:include_noerr(defaults.spec)%(default_spec)");
+
/* Process any configure-time defaults specified for the command line
options, via OPTION_DEFAULT_SPECS. */
for (i = 0; i < ARRAY_SIZE (option_default_specs); i++)
@@ -8401,6 +8405,21 @@ get_random_number (void)
return ret ^ getpid ();
}
+static const char *
+include_noerr_spec_function (int argc, const char **argv)
+{
+ char *file;
+
+ if (argc != 1)
+ abort ();
+
+ file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
+ if (file)
+ read_specs (file, FALSE, TRUE);
+
+ return NULL;
+}
+
/* %:compare-debug-dump-opt spec function. Save the last argument,
expected to be the last -fdump-final-insns option, or generate a
temporary. */