From 385d9e69740e4f6293fe4c7b4206e3a4aca6ca21 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 6 Jun 2020 13:00:45 +0100 Subject: [PATCH] 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 026f3b6d98f..192c7ba773a 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 ffe59fbb306..92ac96a8faa 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 -- 2.39.5