aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-03-07 21:56:06 +0100
committerAndrea Corallo2021-03-07 22:20:07 +0100
commit15aa239ba058ef02544e5dfaf066bd985d9b2f4f (patch)
tree53f68291316e50124bbdf6760f071ac28efecb6d /src
parent9809f7ed2c639bd51abd4a28bd5d1a37f0d46a3d (diff)
downloademacs-15aa239ba058ef02544e5dfaf066bd985d9b2f4f.tar.gz
emacs-15aa239ba058ef02544e5dfaf066bd985d9b2f4f.zip
* Handle `comp-native-driver-options' both as file-local both as global
* src/comp.c (add_driver_options): Throw an error if `comp-native-driver-options' is set globally but 'gcc_jit_context_add_driver_option' is not available, ignore for the file-local case.
Diffstat (limited to 'src')
-rw-r--r--src/comp.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/comp.c b/src/comp.c
index b68adf31d68..e6f672de254 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -4334,9 +4334,9 @@ DEFUN ("comp-native-driver-options-effective-p",
4334static void 4334static void
4335add_driver_options (void) 4335add_driver_options (void)
4336{ 4336{
4337 Lisp_Object options = comp.driver_options; 4337 Lisp_Object options = Fsymbol_value (Qcomp_native_driver_options);
4338 4338
4339#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \ 4339#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
4340 || defined (WINDOWSNT) 4340 || defined (WINDOWSNT)
4341 load_gccjit_if_necessary (true); 4341 load_gccjit_if_necessary (true);
4342 if (!NILP (Fcomp_native_driver_options_effective_p ())) 4342 if (!NILP (Fcomp_native_driver_options_effective_p ()))
@@ -4347,7 +4347,6 @@ add_driver_options (void)
4347 ENCODE_FILE or 4347 ENCODE_FILE or
4348 ENCODE_SYSTEM. */ 4348 ENCODE_SYSTEM. */
4349 SSDATA (XCAR (options))); 4349 SSDATA (XCAR (options)));
4350 return;
4351#endif 4350#endif
4352 if (CONSP (options)) 4351 if (CONSP (options))
4353 xsignal1 (Qnative_compiler_error, 4352 xsignal1 (Qnative_compiler_error,
@@ -4355,6 +4354,20 @@ add_driver_options (void)
4355 " via `comp-native-driver-options' is" 4354 " via `comp-native-driver-options' is"
4356 " only available on libgccjit version 9" 4355 " only available on libgccjit version 9"
4357 " and above.")); 4356 " and above."));
4357
4358 /* Captured `comp-native-driver-options' because file-local. */
4359#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
4360 || defined (WINDOWSNT)
4361 options = comp.driver_options;
4362 if (!NILP (Fcomp_native_driver_options_effective_p ()))
4363 FOR_EACH_TAIL (options)
4364 gcc_jit_context_add_driver_option (comp.ctxt,
4365 /* FIXME: Need to encode
4366 this, but how? either
4367 ENCODE_FILE or
4368 ENCODE_SYSTEM. */
4369 SSDATA (XCAR (options)));
4370#endif
4358} 4371}
4359 4372
4360DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, 4373DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,