[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp b818a49 2/2: Fix loading of libgccjit.dll while dump
From: |
Andrea Corallo |
Subject: |
feature/native-comp b818a49 2/2: Fix loading of libgccjit.dll while dumping in Windows. |
Date: |
Sun, 31 May 2020 04:53:53 -0400 (EDT) |
branch: feature/native-comp
commit b818a49f667a77b7627c678fb4a2ca014f43695e
Author: Nicolás Bértolo <nicolasbertolo@gmail.com>
Commit: Andrea Corallo <akrl@sdf.org>
Fix loading of libgccjit.dll while dumping in Windows.
loadup.el calls `native-comp-available-p', that calls
load_gccjit_if_necessary() in Windows. That function tries to load
libgccjit using the mappings defined in `dynamic-library-alist'. That
mapping is filled by term/w32-win.el, but that file may be loaded too
late.
* src/emacs.c (syms_of_emacs): Add libgccjit to the
`dynamic-library-alist' used when starting to dump so
`native-comp-available-p' always works in Windows.
---
src/emacs.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/emacs.c b/src/emacs.c
index cd4f7a0..8ecf9b4 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -3052,7 +3052,18 @@ because they do not depend on external libraries and are
always available.
Also note that this is not a generic facility for accessing external
libraries; only those already known by Emacs will be loaded. */);
+#ifdef WINDOWSNT
+ /* We may need to load libgccjit when dumping before term/w32-win.el
+ defines `dynamic-library-alist`. This will fail if that variable
+ is empty, so add libgccjit.dll to it. */
+ if (will_dump_p ())
+ Vdynamic_library_alist = list1 (list2 (Qgccjit,
+ build_string ("libgccjit.dll")));
+ else
+ Vdynamic_library_alist = Qnil;
+#else
Vdynamic_library_alist = Qnil;
+#endif
Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt);
#ifdef WINDOWSNT