diff options
author | Andrew Pinski <apinski@marvell.com> | 2021-08-30 22:43:16 +0000 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2021-08-31 06:28:27 +0000 |
commit | 2dc6782a06eeffd9dc6b84fe93b8fcd2ce4960c7 (patch) | |
tree | 0eefa07639eef1dfde32f69b24d7c9c07d4ce857 /gcc/lto-wrapper.c | |
parent | e4d86078881bb7bb57bc6e68c22211707d2b3dc7 (diff) | |
download | gcc-2dc6782a06eeffd9dc6b84fe93b8fcd2ce4960c7.zip gcc-2dc6782a06eeffd9dc6b84fe93b8fcd2ce4960c7.tar.gz gcc-2dc6782a06eeffd9dc6b84fe93b8fcd2ce4960c7.tar.bz2 |
Fix PR driver/79181 (and others), not deleting some /tmp/cc* files for LTO.
So the main issue here is that some signals are not setup unlike collect2.
So this merges the setting up of the signal handlers to one function in
collect-utils and has collect2 and lto-wrapper call that function.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
gcc/ChangeLog:
PR driver/79181
* collect-utils.c (setup_signals): New declaration.
* collect-utils.h (setup_signals): New function.
* collect2.c (handler): Delete.
(main): Instead of manually setting up the signals,
just call setup_signals.
* lto-wrapper.c (main): Likewise.
Diffstat (limited to 'gcc/lto-wrapper.c')
-rw-r--r-- | gcc/lto-wrapper.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c index aae48af..903c258 100644 --- a/gcc/lto-wrapper.c +++ b/gcc/lto-wrapper.c @@ -2125,23 +2125,7 @@ main (int argc, char *argv[]) if (atexit (lto_wrapper_cleanup) != 0) fatal_error (input_location, "%<atexit%> failed"); - if (signal (SIGINT, SIG_IGN) != SIG_IGN) - signal (SIGINT, fatal_signal); -#ifdef SIGHUP - if (signal (SIGHUP, SIG_IGN) != SIG_IGN) - signal (SIGHUP, fatal_signal); -#endif - if (signal (SIGTERM, SIG_IGN) != SIG_IGN) - signal (SIGTERM, fatal_signal); -#ifdef SIGPIPE - if (signal (SIGPIPE, SIG_IGN) != SIG_IGN) - signal (SIGPIPE, fatal_signal); -#endif -#ifdef SIGCHLD - /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will - receive the signal. A different setting is inheritable */ - signal (SIGCHLD, SIG_DFL); -#endif + setup_signals (); /* We may be called with all the arguments stored in some file and passed with @file. Expand them into argv before processing. */ |