aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2022-01-27 18:18:13 +0100
committerAndrea Corallo2022-01-27 23:02:31 +0100
commit536a57b72ce11b1bb8d1b34b339424fea6ccbcce (patch)
treeb9b191c900d95f0cf6f51c1415a5a82325539dd1 /src/comp.c
parentce220524fcfcd0b51cb13cd2c15470f1b6ea0baf (diff)
downloademacs-536a57b72ce11b1bb8d1b34b339424fea6ccbcce.tar.gz
emacs-536a57b72ce11b1bb8d1b34b339424fea6ccbcce.zip
Fix potential native compiler circular dependencies during load
* lisp/startup.el (startup--require-comp-safetly): New function. (startup--honor-delayed-native-compilations): Make use of `startup--require-comp-safetly'. * src/comp.c (CALL0I): New define. (maybe_defer_native_compilation): Make use of `startup--require-comp-safetly'.
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/comp.c b/src/comp.c
index d755df802f7..66288988fd8 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -480,6 +480,10 @@ load_gccjit_if_necessary (bool mandatory)
480#define THIRD(x) \ 480#define THIRD(x) \
481 XCAR (XCDR (XCDR (x))) 481 XCAR (XCDR (XCDR (x)))
482 482
483/* Like call0 but stringify and intern. */
484#define CALL0I(fun) \
485 CALLN (Ffuncall, intern_c_string (STR (fun)))
486
483/* Like call1 but stringify and intern. */ 487/* Like call1 but stringify and intern. */
484#define CALL1I(fun, arg) \ 488#define CALL1I(fun, arg) \
485 CALLN (Ffuncall, intern_c_string (STR (fun)), arg) 489 CALLN (Ffuncall, intern_c_string (STR (fun)), arg)
@@ -5128,7 +5132,7 @@ maybe_defer_native_compilation (Lisp_Object function_name,
5128 if (comp__loadable) 5132 if (comp__loadable)
5129 { 5133 {
5130 /* Startup is done, comp is usable. */ 5134 /* Startup is done, comp is usable. */
5131 Frequire (Qcomp, Qnil, Qnil); 5135 CALL0I(startup--require-comp-safetly);
5132 Fputhash (function_name, definition, Vcomp_deferred_pending_h); 5136 Fputhash (function_name, definition, Vcomp_deferred_pending_h);
5133 CALLN (Ffuncall, intern_c_string ("native--compile-async"), 5137 CALLN (Ffuncall, intern_c_string ("native--compile-async"),
5134 src, Qnil, Qlate); 5138 src, Qnil, Qlate);