From: Ilya Tocar Date: Wed, 19 Nov 2014 11:48:48 +0000 (+0000) Subject: collect2.c (main): Don't call fatal_error before diagnostic_initialize. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=877088b7659964d58bf9474519d8b637623e75a0;p=gcc.git collect2.c (main): Don't call fatal_error before diagnostic_initialize. gcc/ 2014-11-19 Ilya Tocar * collect2.c (main): Don't call fatal_error before diagnostic_initialize. * lto-wrapper.c (main): Likewise. From-SVN: r217765 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9169e354e8e..a4953e9b63b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-19 Ilya Tocar + + * collect2.c (main): Don't call fatal_error before + diagnostic_initialize. + * lto-wrapper.c (main): Likewise. + 2014-11-19 Tom de Vries PR tree-optimization/62167 diff --git a/gcc/collect2.c b/gcc/collect2.c index 7c067ffcafb..9c3a1c55727 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -955,9 +955,6 @@ main (int argc, char **argv) signal (SIGCHLD, SIG_DFL); #endif - if (atexit (collect_atexit) != 0) - fatal_error ("atexit failed"); - /* Unlock the stdio streams. */ unlock_std_streams (); @@ -965,6 +962,9 @@ main (int argc, char **argv) diagnostic_initialize (global_dc, 0); + if (atexit (collect_atexit) != 0) + fatal_error ("atexit failed"); + /* Do not invoke xcalloc before this point, since locale needs to be set first, in case a diagnostic is issued. */ diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index 951a2ddc787..6b417821295 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -1314,13 +1314,13 @@ main (int argc, char *argv[]) xmalloc_set_program_name (progname); - if (atexit (lto_wrapper_cleanup) != 0) - fatal_error ("atexit failed"); - gcc_init_libintl (); diagnostic_initialize (global_dc, 0); + if (atexit (lto_wrapper_cleanup) != 0) + fatal_error ("atexit failed"); + if (signal (SIGINT, SIG_IGN) != SIG_IGN) signal (SIGINT, fatal_signal); #ifdef SIGHUP