]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow for `comp-native-driver-options' to work as a file-local variable.
authorAndrea Corallo <akrl@sdf.org>
Sun, 7 Mar 2021 19:19:20 +0000 (20:19 +0100)
committerAndrea Corallo <akrl@sdf.org>
Sun, 7 Mar 2021 19:19:20 +0000 (20:19 +0100)
lisp/emacs-lisp/bytecomp.el
lisp/emacs-lisp/comp.el
src/comp.c

index 4169b0756df4590c16a02d0a112466053963a504..3ee8113c4f4e437850cdf023524cd66c475e99e7 100644 (file)
@@ -2272,7 +2272,10 @@ With argument ARG, insert value in current buffer after the form."
           (defvar comp-speed)
           (push `(comp-speed . ,comp-speed) byte-native-qualities)
           (defvar comp-debug)
-          (push `(comp-debug . ,comp-debug) byte-native-qualities))
+          (push `(comp-debug . ,comp-debug) byte-native-qualities)
+          (defvar comp-native-driver-options)
+          (push `(comp-native-driver-options . ,comp-native-driver-options)
+                byte-native-qualities))
 
        ;; Compile the forms from the input buffer.
        (while (progn
index 70e10644ca8734bcea843be7ba9a3bcac49ccab8..cedbb786237bd5b28d5ab2ace1cebb5ac30edea9 100644 (file)
@@ -712,6 +712,8 @@ Returns ELT."
          :documentation "Default speed for this compilation unit.")
   (debug comp-debug :type number
          :documentation "Default debug level for this compilation unit.")
+  (driver-options comp-native-driver-options :type list
+         :documentation "Options for the GCC driver.")
   (top-level-forms () :type list
                    :documentation "List of spilled top level forms.")
   (funcs-h (make-hash-table :test #'equal) :type hash-table
@@ -1298,6 +1300,8 @@ clashes."
                                                byte-native-qualities)
         (comp-ctxt-debug comp-ctxt) (alist-get 'comp-debug
                                                byte-native-qualities)
+        (comp-ctxt-driver-options comp-ctxt) (alist-get 'comp-native-driver-options
+                                                        byte-native-qualities)
         (comp-ctxt-top-level-forms comp-ctxt)
         (cl-loop
          for form in (reverse byte-to-native-top-level-forms)
index bea9945bbfef88dc41a0cc470311e36944d716ae..b2d8b8ec987c804fd00903ffaffc9e8b8dbe9246 100644 (file)
@@ -516,6 +516,7 @@ typedef struct {
 typedef struct {
   EMACS_INT speed;
   EMACS_INT debug;
+  Lisp_Object driver_options;
   gcc_jit_context *ctxt;
   gcc_jit_type *void_type;
   gcc_jit_type *bool_type;
@@ -4333,7 +4334,7 @@ DEFUN ("comp-native-driver-options-effective-p",
 static void
 add_driver_options (void)
 {
-  Lisp_Object options = Fsymbol_value (Qcomp_native_driver_options);
+  Lisp_Object options = comp.driver_options;
 
 #if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
   || defined (WINDOWSNT)
@@ -4400,6 +4401,7 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
   eassert (comp.speed < INT_MAX);
   comp.debug = XFIXNUM (CALL1I (comp-ctxt-debug, Vcomp_ctxt));
   eassert (comp.debug < INT_MAX);
+  comp.driver_options = CALL1I (comp-ctxt-driver-options, Vcomp_ctxt);
 
   if (comp.debug)
       gcc_jit_context_set_bool_option (comp.ctxt,