emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 385d9e6: Some fixes for --without-nativecomp config


From: Andrea Corallo
Subject: feature/native-comp 385d9e6: Some fixes for --without-nativecomp config
Date: Sat, 6 Jun 2020 08:23:27 -0400 (EDT)

branch: feature/native-comp
commit 385d9e69740e4f6293fe4c7b4206e3a4aca6ca21
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Some fixes for --without-nativecomp config
    
        * src/pdumper.c (dump_subr): Do not add RELOC_NATIVE_SUBR for
        VERY_LATE_RELOCS in --without-nativecomp.
        (dump_do_dump_relocation): Add a sanity check that no
        RELOC_NATIVE_SUBR exists in --without-nativecomp.
    
        * src/lread.c (Fload): As Fnative_elisp_load is not defined
        in --without-nativecomp so ifdef this block.
---
 src/lread.c   | 6 ++++++
 src/pdumper.c | 8 +++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/lread.c b/src/lread.c
index 026f3b6..192c7ba 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1507,6 +1507,7 @@ Return t if the file exists and loads successfully.  */)
     }
   else if (is_native_elisp)
     {
+#ifdef HAVE_NATIVE_COMP
       specbind (Qcurrent_load_list, Qnil);
       if (!NILP (Vpurify_flag))
        {
@@ -1517,6 +1518,11 @@ Return t if the file exists and loads successfully.  */)
       LOADHIST_ATTACH (hist_file_name);
       Fnative_elisp_load (found, Qnil);
       build_load_history (hist_file_name, true);
+#else
+      /* This cannot happen.  */
+      emacs_abort ();
+#endif
+
     }
   else
     {
diff --git a/src/pdumper.c b/src/pdumper.c
index ffe59fb..92ac96a 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2967,7 +2967,9 @@ dump_subr (struct dump_context *ctx, const struct 
Lisp_Subr *subr)
     dump_field_lv (ctx, &out, subr, &subr->native_comp_u[0], WEIGHT_NORMAL);
 
   dump_off subr_off = dump_object_finish (ctx, &out, sizeof (out));
-  if (ctx->flags.dump_object_contents && !NILP (subr->native_comp_u[0]))
+  if (NATIVE_COMP_FLAG
+      && ctx->flags.dump_object_contents
+      && !NILP (subr->native_comp_u[0]))
     /* We'll do the final addr relocation during VERY_LATE_RELOCS time
        after the compilation units has been loaded. */
     dump_push (&ctx->dump_relocs[VERY_LATE_RELOCS],
@@ -5331,6 +5333,10 @@ dump_do_dump_relocation (const uintptr_t dump_base,
       }
     case RELOC_NATIVE_SUBR:
       {
+       if (!NATIVE_COMP_FLAG)
+         /* This cannot happen.  */
+         emacs_abort ();
+
        /* When resurrecting from a dump given non all the original
           native compiled subrs may be still around we can't rely on
           a 'top_level_run' mechanism, we revive them one-by-one



reply via email to

[Prev in Thread] Current Thread [Next in Thread]