From d3faa4b6d102b09a5ea17bbf81590f215b42fbc4 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Fri, 26 Sep 2014 13:43:34 +0000 Subject: [PATCH] Fix -freport-bug patch. gcc/ * gcc.c (try_generate_repro): Remove argument "prog". Change all users. (run_attempt): Handle errors of "pex_run" invocation. Fixes bootstrap failure/compiler warnings: [...] ../../master/gcc/gcc.c: In function 'attempt_status run_attempt(const char**, const char*, const char*, int, int)': ../../master/gcc/gcc.c:6319:15: error: variable 'errmsg' set but not used [-Werror=unused-but-set-variable] const char *errmsg; ^ ../../master/gcc/gcc.c: At global scope: ../../master/gcc/gcc.c:6412:33: error: unused parameter 'prog' [-Werror=unused-parameter] try_generate_repro (const char *prog, const char **argv) ^ cc1plus: all warnings being treated as errors Makefile:1040: recipe for target 'gcc.o' failed make[3]: *** [gcc.o] Error 1 make[3]: Leaving directory '/media/erich/home/thomas/tmp/gcc/hurd/master.build/gcc' Makefile:4285: recipe for target 'all-stage2-gcc' failed make[2]: *** [all-stage2-gcc] Error 2 make[2]: Leaving directory '/media/erich/home/thomas/tmp/gcc/hurd/master.build' Makefile:21561: recipe for target 'stage2-bubble' failed make[1]: *** [stage2-bubble] Error 2 make[1]: Leaving directory '/media/erich/home/thomas/tmp/gcc/hurd/master.build' Makefile:892: recipe for target 'all' failed make: *** [all] Error 2 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215644 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/gcc.c | 16 +++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b0039237492..623fb7d6ae3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-09-26 Thomas Schwinge + + * gcc.c (try_generate_repro): Remove argument "prog". Change all + users. + (run_attempt): Handle errors of "pex_run" invocation. + 2014-09-26 Christophe Lyon * config/aarch64/aarch64-linux.h (ASAN_CC1_SPEC): Define. diff --git a/gcc/gcc.c b/gcc/gcc.c index e32ff47685e..47c4e283bcd 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -253,7 +253,7 @@ static void init_gcc_specs (struct obstack *, const char *, const char *, static const char *convert_filename (const char *, int, int); #endif -static void try_generate_repro (const char *prog, const char **argv); +static void try_generate_repro (const char **argv); 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 **); @@ -2918,7 +2918,7 @@ execute (void) && i == 0 && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR)) && ! strncmp (p + 1, "cc1", 3)) - try_generate_repro (commands[0].prog, commands[0].argv); + try_generate_repro (commands[0].argv); if (WEXITSTATUS (status) > greatest_status) greatest_status = WEXITSTATUS (status); ret_code = -1; @@ -6332,6 +6332,16 @@ run_attempt (const char **new_argv, const char *out_temp, errmsg = pex_run (pex, pex_flags, new_argv[0], CONST_CAST2 (char *const *, const char **, &new_argv[1]), out_temp, err_temp, &err); + if (errmsg != NULL) + { + if (err == 0) + fatal_error (errmsg); + else + { + errno = err; + pfatal_with_name (errmsg); + } + } if (!pex_get_status (pex, 1, &exit_status)) goto out; @@ -6409,7 +6419,7 @@ append_text (char *file, const char *str) and preprocessed source code. */ static void -try_generate_repro (const char *prog, const char **argv) +try_generate_repro (const char **argv) { int i, nargs, out_arg = -1, quiet = 0, attempt; const char **new_argv; -- 2.11.4.GIT