]> git.eshelyaron.com Git - emacs.git/commitdiff
Set a unique ID for eln files on macOS (bug#45934)
authorAndrea Corallo <akrl@sdf.org>
Sun, 22 Aug 2021 21:08:37 +0000 (22:08 +0100)
committerAlan Third <alan@idiocy.org>
Sun, 22 Aug 2021 21:15:29 +0000 (22:15 +0100)
* src/comp.c (Fcomp__compile_ctxt_to_file): Set gcc's -install_name
parameter to the real filename.

src/comp.c

index c380346482721ceb539828f4762391a308987447..74a5337f8d7aad5672f1873926ff0080650619a3 100644 (file)
@@ -4490,6 +4490,15 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
                                  GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
                                  comp.speed < 0 ? 0
                                  : (comp.speed > 3 ? 3 : comp.speed));
+
+  /* On MacOS set a unique dylib ID.  */
+#if defined (LIBGCCJIT_HAVE_gcc_jit_context_add_driver_option) \
+  && defined (DARWIN_OS)
+  gcc_jit_context_add_driver_option (comp.ctxt, "-install_name");
+  gcc_jit_context_add_driver_option (
+         comp.ctxt, SSDATA (Ffile_name_nondirectory (filename)));
+#endif
+
   comp.d_default_idx =
     CALL1I (comp-data-container-idx, CALL1I (comp-ctxt-d-default, Vcomp_ctxt));
   comp.d_impure_idx =