+2015-01-23 David Malcolm <dmalcolm@redhat.com>
+
+ PR jit/64721
+ * main.c (main): Construct toplev instances with init_signals=true.
+ * toplev.c (general_init): Add param "init_signals", and use it to
+ conditionalize the calls to signal and host_hooks.extra_signals.
+ (toplev::toplev): Add param "init_signals".
+ (toplev::main): When invoking general_init, pass m_init_signals
+ to control whether signal-handlers are installed.
+ * toplev.h (toplev::toplev): Add param "init_signals".
+ (toplev::m_init_signals): New field.
+
2015-01-23 David Malcolm <dmalcolm@redhat.com>
PR jit/64722
#include <new>
-static void general_init (const char *);
+static void general_init (const char *, bool);
static void do_compile ();
static void process_options (void);
static void backend_init (void);
options are parsed. Signal handlers, internationalization etc.
ARGV0 is main's argv[0]. */
static void
-general_init (const char *argv0)
+general_init (const char *argv0, bool init_signals)
{
const char *p;
global_dc->option_state = &global_options;
global_dc->option_name = option_name;
- /* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
+ if (init_signals)
+ {
+ /* Trap fatal signals, e.g. SIGSEGV, and convert them to ICE messages. */
#ifdef SIGSEGV
- signal (SIGSEGV, crash_signal);
+ signal (SIGSEGV, crash_signal);
#endif
#ifdef SIGILL
- signal (SIGILL, crash_signal);
+ signal (SIGILL, crash_signal);
#endif
#ifdef SIGBUS
- signal (SIGBUS, crash_signal);
+ signal (SIGBUS, crash_signal);
#endif
#ifdef SIGABRT
- signal (SIGABRT, crash_signal);
+ signal (SIGABRT, crash_signal);
#endif
#if defined SIGIOT && (!defined SIGABRT || SIGABRT != SIGIOT)
- signal (SIGIOT, crash_signal);
+ signal (SIGIOT, crash_signal);
#endif
#ifdef SIGFPE
- signal (SIGFPE, crash_signal);
+ signal (SIGFPE, crash_signal);
#endif
- /* Other host-specific signal setup. */
- (*host_hooks.extra_signals)();
+ /* Other host-specific signal setup. */
+ (*host_hooks.extra_signals)();
+ }
/* Initialize the garbage-collector, string pools and tree type hash
table. */
}
}
-toplev::toplev (bool use_TV_TOTAL)
- : m_use_TV_TOTAL (use_TV_TOTAL)
+toplev::toplev (bool use_TV_TOTAL, bool init_signals)
+ : m_use_TV_TOTAL (use_TV_TOTAL),
+ m_init_signals (init_signals)
{
if (!m_use_TV_TOTAL)
start_timevars ();
expandargv (&argc, &argv);
/* Initialization of GCC's environment, and diagnostics. */
- general_init (argv[0]);
+ general_init (argv[0], m_init_signals);
/* One-off initialization of options that does not need to be
repeated when options are added for particular functions. */