aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2019-08-06 23:56:12 +0200
committerAndrea Corallo2020-01-01 11:33:57 +0100
commitb3dc6e8f06892869e0dcf39fd226b63752ce6cf9 (patch)
tree766c41651cb7ea3bd9fd8e788e0dd8c97085d511 /src/comp.c
parentf46bfdf3234548f664824b7c96838d3f918950d7 (diff)
downloademacs-b3dc6e8f06892869e0dcf39fd226b63752ce6cf9.tar.gz
emacs-b3dc6e8f06892869e0dcf39fd226b63752ce6cf9.zip
fix gcc interruption
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/comp.c b/src/comp.c
index 16089beee1e..54078e89bfc 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
22 22
23#include <stdlib.h> 23#include <stdlib.h>
24#include <stdio.h> 24#include <stdio.h>
25#include <signal.h>
25#include <libgccjit.h> 26#include <libgccjit.h>
26 27
27#include "lisp.h" 28#include "lisp.h"
@@ -2280,9 +2281,14 @@ DEFUN ("comp-compile-and-load-ctxt", Fcomp_compile_and_load_ctxt,
2280 gcc_jit_context_set_int_option (comp.ctxt, 2281 gcc_jit_context_set_int_option (comp.ctxt,
2281 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, 2282 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
2282 comp_speed); 2283 comp_speed);
2283 /* Gcc doesn't like being interrupted. */ 2284 /* Gcc doesn't like being interrupted at all. */
2284 sigset_t oldset; 2285 sigset_t oldset;
2285 block_atimers (&oldset); 2286 sigset_t blocked;
2287 sigemptyset (&blocked);
2288 sigaddset (&blocked, SIGALRM);
2289 sigaddset (&blocked, SIGINT);
2290 sigaddset (&blocked, SIGIO);
2291 pthread_sigmask (SIG_BLOCK, &blocked, &oldset);
2286 2292
2287 if (COMP_DEBUG) 2293 if (COMP_DEBUG)
2288 gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1); 2294 gcc_jit_context_dump_to_file (comp.ctxt, "gcc-ctxt-dump.c", 1);