Subject: Re: bug#75451: scratch/igc: Enable CHECK_STRUCTS

From: Pip Cet <[email-masked]>
Date: Fri, 17 Jan 2025 19:50:27 +0000

"Andrea Corallo" <[email-masked]> writes:

> Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" <[email-masked]> writes:
>
>> Gerd Möllmann <[email-masked]> writes:
>>
>>> Stefan Kangas <[email-masked]> writes:
>>>
>>>>
>>>>> (BTW, the contents of the #if might be out of date, not sure if we
>>>>> meanwhile fix/scan additional structs.)
>>>>
>>>> I've now added checks for all structs that we use in "fix_*" functions
>>>> (commit 76a0d739024).  I kept notes to make sure I didn't miss anything,
>>>> but it's not impossible that I did.  I'll double-check things later.
>>>>
>>>> I plan to do anything passed to the "finalize_*" ones next, which should
>>>> cover most of the ones we currently depend on, I think.
>>>
>>> Very nice! Thanks for taking this on!
>>
>> Thanks!
>>
>> This isn't strictly about the scratch/igc branch, but I personally think
>> struct hashes should be checked in all builds, mismatches should be
>> downgraded to #warnings, and --enable-checking=all could include
>> -Werror=cpp.  (So the warnings would still abort a build with
>> --enable-checking=all, but they'd *also* show up in regular builds.)
>>
>> Also, we should include them in the nativecomp ABI hash
>
> +1

Here's a patch series:

1. fix a minor bug in dmpstruct.awk: it would continue to write lines to
dmpstruct.tmp in some cases after generating the hash.  This was
harmless because the hash was already generated, but it broke my first
attempt's code.

2. generate a hash covering all structs.  It's not a hash-of-hashes, but
it does the same thing.

3. include it in the nativecomp ABI hash.  This will cause all .eln files to
be rebuilt when it is applied!  (Unless we win the lottery and hit a
hash collision, that is.  This is entirely possible because the
nativecomp hash is only 32 bits.)

4. always build dmpstruct.h.  This will avoid the problematic situation
in which Emacs builds on a system, we try to rebuild with
--enable-checking=all to catch the bug, and it won't build.

5. Generate an sed script to adjust all hashes.  I think Emacs
developers are adults (or very precocious children) and can be trusted
with this powerful tool.

6. Mark autogenerated files as autogenerated.  I see no reason not to do
that.

7. Adjust hashes (they changed because of (6)).

(Might break the DOS build.  I'll check.)

Pip

commit 40c07936b4ce1dbc6f05137d9d4f69e42b03b37c
Author: Pip Cet <[email-masked]>

    ; * src/dmpstruct.awk: Don't print extra lines to dmpstruct.tmp

diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
index e5e359e10b7..d95552c6105 100644
--- a/src/dmpstruct.awk
+++ b/src/dmpstruct.awk
@@ -27,7 +27,7 @@ BEGIN {
   struct_name = $2
   close (tmpfile)
 }
-/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^(  )?};$/ {
+/^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^(  )?} *(GCALIGNED_STRUCT)? *;$/ {
   print $0 > tmpfile
 }
 /^(  )?} *(GCALIGNED_STRUCT)? *;$/ {

commit 2e3ca484f870f2a09153c8cf5aec42c23da1b6a2
Author: Pip Cet <[email-masked]>

    Cover common structs in the nativecomp ABI hash (bug#75451)
    
    * src/Makefile.in (dmpstruct.h): Always generate.  Make pdumper.o and
    comp.o depend on it.
    * src/comp.c (hash_native_abi): Include overall hash in nativecomp ABI
    hash.
    * src/dmpstruct.awk: Mark autogenerated files.  Generate a hash for
    all hashed structures.

diff --git a/src/Makefile.in b/src/Makefile.in
index d987124d29d..c06449748cd 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -539,14 +539,14 @@ .PHONY:
 
 dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h $(srcdir)/itree.h \
 	$(srcdir)/intervals.h $(srcdir)/charset.h $(srcdir)/bignum.h
-ifeq ($(CHECK_STRUCTS),true)
-pdumper.o: dmpstruct.h
-endif
 dmpstruct.h: $(srcdir)/dmpstruct.awk
 dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers)
 	$(AM_V_GEN)POSIXLY_CORRECT=1 $(AWK) -f $(srcdir)/dmpstruct.awk \
 		$(dmpstruct_headers) > $@
 
+pdumper.o: dmpstruct.h
+comp.o: dmpstruct.h
+
 AUTO_DEPEND = @AUTO_DEPEND@
 DEPDIR = deps
 ifeq ($(AUTO_DEPEND),yes)
diff --git a/src/comp.c b/src/comp.c
index 2603a2f4334..12743af8e01 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -40,6 +40,7 @@
 #include "md5.h"
 #include "sysstdio.h"
 #include "zlib.h"
+#include "dmpstruct.h"

 /********************************/
@@ -796,11 +797,14 @@ hash_native_abi (void)
 
   Vcomp_abi_hash =
     comp_hash_string (
-      concat3 (build_string (ABI_VERSION),
-	       concat3 (Vemacs_version, Vsystem_configuration,
-			Vsystem_configuration_options),
-	       Fmapconcat (intern_c_string ("comp--subr-signature"),
-			   Vcomp_subr_list, build_string (""))));
+      CALLN (Fconcat,
+	     build_string (ABI_VERSION),
+	     Vemacs_version,
+	     Vsystem_configuration,
+	     Vsystem_configuration_options,
+	     build_string (HASH_DMPSTRUCT),
+	     Fmapconcat (intern_c_string ("comp--subr-signature"),
+			 Vcomp_subr_list, build_string (""))));
 
   Lisp_Object version = Vemacs_version;
 
diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
index d95552c6105..f00d7fd0136 100644
--- a/src/dmpstruct.awk
+++ b/src/dmpstruct.awk
@@ -21,6 +21,8 @@ BEGIN {
   print "#define EMACS_DMPSTRUCT_H"
   struct_name = ""
   tmpfile = "dmpstruct.tmp"
+  tmpfile_all = "dmpstruct-all.tmp"
+  print "/* AUTOGENERATED. DO NOT EDIT.  This file is used for generating the HASH_DMPSTRUCT hash. */" > tmpfile_all
 }
 # Match a type followed by optional syntactic whitespace
 /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ {
@@ -28,7 +30,9 @@ BEGIN {
   close (tmpfile)
 }
 /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/, /^(  )?} *(GCALIGNED_STRUCT)? *;$/ {
-  print $0 > tmpfile
+  print "/* AUTOGENERATED. DO NOT EDIT.  This file is used for generating a dmpstruct hash. */" > tmpfile
+  print $0 >> tmpfile
+  print $0 >> tmpfile_all
 }
 /^(  )?} *(GCALIGNED_STRUCT)? *;$/ {
   if (struct_name != "") {
@@ -41,5 +45,11 @@ BEGIN {
   }
 }
 END {
+  fflush (tmpfile_all)
+  cmd = "../lib-src/make-fingerprint -r " tmpfile_all
+  cmd | getline hash
+  close (cmd)
+  printf "#define HASH_%s_%.12s\n", "dmpstruct", hash
+  printf "#define HASH_DMPSTRUCT \"%.12s\"\n", hash
   print "#endif /* EMACS_DMPSTRUCT_H */"
 }

commit 29ce0f65c0cb9781d173c2ad5229626ffa55cc3a
Author: Pip Cet <[email-masked]>

    Generate an SED script to adjust dmpstruct values (bug#75451)
    
    * configure.ac: Adjust config.h comment.
    * src/dmpstruct.awk: Create SED file.
    * src/Makefile.in (fix-hashes): New target.

diff --git a/configure.ac b/configure.ac
index 936afc0e7df..5ed9ae7a7fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -755,9 +755,9 @@ AC_DEFUN
     AC_DEFINE([CHECK_STRUCTS], [1],
       [Define this to check whether someone updated the portable dumper
        code after changing the layout of a structure that it uses.
-       If you change one of these structures, check that the pdumper.c
-       code is still valid, and update the pertinent hash in pdumper.c
-       by manually copying the hash from the newly-generated dmpstruct.h.])
+       If you change one of these structures, check that the relevant
+       code is still valid, and update the pertinent hash by running
+       sed -f src/dmpstruct.sed.tmp on the right file.])
   fi
   AC_SUBST([CHECK_STRUCTS])
   if test x$ac_gc_check_stringbytes != x ; then
diff --git a/src/Makefile.in b/src/Makefile.in
index c06449748cd..0402f96c42f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1027,3 +1027,6 @@ $(bootstrap_pdmp):
 check-syntax:
 	$(AM_V_CC)$(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) ${CHK_SOURCES} || true
 .PHONY: check-syntax
+
+fix-hashes: dmpstruct.h
+	sed -f dmpstruct.sed.tmp -i pdumper.c
diff --git a/src/dmpstruct.awk b/src/dmpstruct.awk
index f00d7fd0136..00de127611f 100644
--- a/src/dmpstruct.awk
+++ b/src/dmpstruct.awk
@@ -22,7 +22,9 @@ BEGIN {
   struct_name = ""
   tmpfile = "dmpstruct.tmp"
   tmpfile_all = "dmpstruct-all.tmp"
+  sedfile = "dmpstruct.sed.tmp"
   print "/* AUTOGENERATED. DO NOT EDIT.  This file is used for generating the HASH_DMPSTRUCT hash. */" > tmpfile_all
+  print "# AUTOGENERATED. DO NOT EDIT.  This file is used for adjusting hashes." > sedfile
 }
 # Match a type followed by optional syntactic whitespace
 /^(enum|struct|union) [a-zA-Z0-9_]+([\t ]|\/\*.*\*\/)*$/ {
@@ -41,6 +43,7 @@ BEGIN {
     cmd | getline hash
     close (cmd)
     printf "#define HASH_%s_%.10s\n", struct_name, hash
+    printf "s/HASH_%s_[0-9A-Fa-f]*/HASH_%s_%.10s/g\n", struct_name, struct_name, hash >> sedfile
     struct_name = ""
   }
 }

commit 1c5505558d49962a95202a777c53cc6f2a9a75f4 (HEAD -> bug75451)
Author: Pip Cet <[email-masked]>

    Adjust changed dmpstruct hashes (bug#75451)

diff --git a/src/pdumper.c b/src/pdumper.c
index 97d3d1412b7..a4765dfd38e 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2000,7 +2000,7 @@ dump_pseudovector_lisp_fields (struct dump_context *ctx,
 static dump_off
 dump_cons (struct dump_context *ctx, const struct Lisp_Cons *cons)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Cons_00EEE63F67)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Cons_EF7EE95CF6)
 # error "Lisp_Cons changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct Lisp_Cons out;
@@ -2015,7 +2015,7 @@ dump_interval_tree (struct dump_context *ctx,
                     INTERVAL tree,
                     dump_off parent_offset)
 {
-#if CHECK_STRUCTS && !defined (HASH_interval_1B38941C37)
+#if CHECK_STRUCTS && !defined (HASH_interval_858621D7FE)
 # error "interval changed. See CHECK_STRUCTS comment in config.h."
 #endif
   /* TODO: output tree breadth-first?  */
@@ -2059,7 +2059,7 @@ dump_interval_tree (struct dump_context *ctx,
 static dump_off
 dump_string (struct dump_context *ctx, const struct Lisp_String *string)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_String_03B2DF1C8E)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_String_C136309593)
 # error "Lisp_String changed. See CHECK_STRUCTS comment in config.h."
 #endif
   /* If we have text properties, write them _after_ the string so that
@@ -2105,7 +2105,7 @@ dump_string (struct dump_context *ctx, const struct Lisp_String *string)
 static dump_off
 dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Marker_642DBAF866)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Marker_AC394EFE74)
 # error "Lisp_Marker changed. See CHECK_STRUCTS comment in config.h."
 #endif
 
@@ -2128,7 +2128,7 @@ dump_marker (struct dump_context *ctx, const struct Lisp_Marker *marker)
 static dump_off
 dump_interval_node (struct dump_context *ctx, struct itree_node *node)
 {
-#if CHECK_STRUCTS && !defined (HASH_itree_node_03626AFCA9)
+#if CHECK_STRUCTS && !defined (HASH_itree_node_4EBE12CCEE)
 # error "itree_node changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct itree_node out;
@@ -2170,7 +2170,7 @@ dump_interval_node (struct dump_context *ctx, struct itree_node *node)
 static dump_off
 dump_overlay (struct dump_context *ctx, const struct Lisp_Overlay *overlay)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Overlay_5F9D7E02FC)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Overlay_55E80432A2)
 # error "Lisp_Overlay changed. See CHECK_STRUCTS comment in config.h."
 #endif
   START_DUMP_PVEC (ctx, &overlay->header, struct Lisp_Overlay, out);
@@ -2202,7 +2202,7 @@ dump_field_finalizer_ref (struct dump_context *ctx,
 dump_finalizer (struct dump_context *ctx,
                 const struct Lisp_Finalizer *finalizer)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Finalizer_D58E647CB8)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Finalizer_F93576AA23)
 # error "Lisp_Finalizer changed. See CHECK_STRUCTS comment in config.h."
 #endif
   START_DUMP_PVEC (ctx, &finalizer->header, struct Lisp_Finalizer, out);
@@ -2239,7 +2239,7 @@ dump_treesit_compiled_query (struct dump_context *ctx,
 static dump_off
 dump_bignum (struct dump_context *ctx, Lisp_Object object)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Bignum_661945DE2B)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Bignum_E044A28F86)
 # error "Lisp_Bignum changed. See CHECK_STRUCTS comment in config.h."
 #endif
   const struct Lisp_Bignum *bignum = XBIGNUM (object);
@@ -2277,7 +2277,7 @@ dump_bignum (struct dump_context *ctx, Lisp_Object  static dump_off
 dump_float (struct dump_context *ctx, const struct Lisp_Float *lfloat)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Float_7E7D284C02)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Float_E025D05C8C)
 # error "Lisp_Float changed. See CHECK_STRUCTS comment in config.h."
 #endif
   eassert (ctx->header.cold_start);
@@ -2290,7 +2290,7 @@ dump_float (struct dump_context *ctx, const struct Lisp_Float *lfloat)
 static dump_off
 dump_fwd_int (struct dump_context *ctx, const struct Lisp_Intfwd *intfwd)
 {
-#if CHECK_STRUCTS && !defined HASH_Lisp_Intfwd_4D887A7387
+#if CHECK_STRUCTS && !defined HASH_Lisp_Intfwd_6E2E07BDCC
 # error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h."
 #endif
   dump_emacs_reloc_immediate_intmax_t (ctx, intfwd->intvar, *intfwd->intvar);
@@ -2304,7 +2304,7 @@ dump_fwd_int (struct dump_context *ctx, const struct Lisp_Intfwd *intfwd)
 static dump_off
 dump_fwd_bool (struct dump_context *ctx, const struct Lisp_Boolfwd *boolfwd)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Boolfwd_0EA1C7ADCC)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Boolfwd_4BDBCBC7D2)
 # error "Lisp_Boolfwd changed. See CHECK_STRUCTS comment in config.h."
 #endif
   dump_emacs_reloc_immediate_bool (ctx, boolfwd->boolvar, *boolfwd->boolvar);
@@ -2318,7 +2318,7 @@ dump_fwd_bool (struct dump_context *ctx, const struct Lisp_Boolfwd *boolfwd)
 static dump_off
 dump_fwd_obj (struct dump_context *ctx, const struct Lisp_Objfwd *objfwd)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Objfwd_45D3E513DC)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Objfwd_33156D0D7A)
 # error "Lisp_Objfwd changed. See CHECK_STRUCTS comment in config.h."
 #endif
   if (NILP (Fgethash (dump_off_to_lisp (emacs_offset (objfwd->objvar)),
@@ -2336,7 +2336,7 @@ dump_fwd_obj (struct dump_context *ctx, const struct Lisp_Objfwd *objfwd)
 dump_fwd_buffer_obj (struct dump_context *ctx,
                      const struct Lisp_Buffer_Objfwd *buffer_objfwd)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Buffer_Objfwd_611EBD13FF)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Buffer_Objfwd_AF869E0C7C)
 # error "Lisp_Buffer_Objfwd changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct Lisp_Buffer_Objfwd out;
@@ -2352,7 +2352,7 @@ dump_fwd_buffer_obj (struct dump_context *ctx,
 dump_fwd_kboard_obj (struct dump_context *ctx,
                      const struct Lisp_Kboard_Objfwd *kboard_objfwd)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Kboard_Objfwd_CAA7E71069)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Kboard_Objfwd_49A54EE796)
 # error "Lisp_Intfwd changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct Lisp_Kboard_Objfwd out;
@@ -2365,7 +2365,7 @@ dump_fwd_kboard_obj (struct dump_context *ctx,
 static dump_off
 dump_fwd (struct dump_context *ctx, lispfwd fwd)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Fwd_Type_9CBA6EE55E)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Fwd_Type_010C8CEF02)
 # error "Lisp_Fwd_Type changed. See CHECK_STRUCTS comment in config.h."
 #endif
   void const *p = fwd.fwdptr;
@@ -2399,7 +2399,7 @@ dump_fwd (struct dump_context *ctx, lispfwd fwd)
 dump_blv (struct dump_context *ctx,
           const struct Lisp_Buffer_Local_Value *blv)
 {
-#if CHECK_STRUCTS && !defined HASH_Lisp_Buffer_Local_Value_3C363FAC3C
+#if CHECK_STRUCTS && !defined HASH_Lisp_Buffer_Local_Value_BC9625B82F
 # error "Lisp_Buffer_Local_Value changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct Lisp_Buffer_Local_Value out;
@@ -2465,10 +2465,10 @@ dump_symbol (struct dump_context *ctx,
              Lisp_Object object,
              dump_off offset)
 {
-#if CHECK_STRUCTS && !defined HASH_Lisp_Symbol_61B174C9F4
+#if CHECK_STRUCTS && !defined HASH_Lisp_Symbol_A10971AE16
 # error "Lisp_Symbol changed. See CHECK_STRUCTS comment in config.h."
 #endif
-#if CHECK_STRUCTS && !defined (HASH_symbol_redirect_EA72E4BFF5)
+#if CHECK_STRUCTS && !defined (HASH_symbol_redirect_F62BD8F1FE)
 # error "symbol_redirect changed. See CHECK_STRUCTS comment in config.h."
 #endif
 
@@ -2562,7 +2562,7 @@ dump_symbol (struct dump_context *ctx,
 dump_vectorlike_generic (struct dump_context *ctx,
 			 const union vectorlike_header *header)
 {
-#if CHECK_STRUCTS && !defined (HASH_vectorlike_header_785E52047B)
+#if CHECK_STRUCTS && !defined (HASH_vectorlike_header_331153C5E8)
 # error "vectorlike_header changed. See CHECK_STRUCTS comment in config.h."
 #endif
   const struct Lisp_Vector *v = (const struct Lisp_Vector *) header;
@@ -2734,7 +2734,7 @@ dump_hash_table_contents (struct dump_context *ctx, struct Lisp_Hash_Table *h)
 static dump_off
 dump_hash_table (struct dump_context *ctx, Lisp_Object object)
 {
-#if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_0360833954
+#if CHECK_STRUCTS && !defined HASH_Lisp_Hash_Table_E855664723
 # error "Lisp_Hash_Table changed. See CHECK_STRUCTS comment in config.h."
 #endif
   const struct Lisp_Hash_Table *hash_in = XHASH_TABLE (object);
@@ -2789,7 +2789,7 @@ dump_obarray_buckets (struct dump_context *ctx, const struct Lisp_Obarray *o)
 static dump_off
 dump_obarray (struct dump_context *ctx, Lisp_Object object)
 {
-#if CHECK_STRUCTS && !defined HASH_Lisp_Obarray_D2757E61AD
+#if CHECK_STRUCTS && !defined HASH_Lisp_Obarray_552E55F2A1
 # error "Lisp_Obarray changed. See CHECK_STRUCTS comment in config.h."
 #endif
   const struct Lisp_Obarray *in_oa = XOBARRAY (object);
@@ -2811,7 +2811,7 @@ dump_obarray (struct dump_context *ctx, Lisp_Object object)
 static dump_off
 dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
 {
-#if CHECK_STRUCTS && !defined HASH_buffer_B02F648B82
+#if CHECK_STRUCTS && !defined HASH_buffer_2562CF7465
 # error "buffer changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct buffer munged_buffer = *in_buffer;
@@ -2949,7 +2949,7 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer)
 static dump_off
 dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Vector_3091289B35)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Vector_FBEF167750)
 # error "Lisp_Vector changed. See CHECK_STRUCTS comment in config.h."
 #endif
   /* No relocation needed, so we don't need dump_object_start.  */
@@ -2966,7 +2966,7 @@ dump_bool_vector (struct dump_context *ctx, const struct Lisp_Vector *v)
 static dump_off
 dump_subr (struct dump_context *ctx, const struct Lisp_Subr *subr)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_EE5F7351CC)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Subr_1B888CFDDA)
 # error "Lisp_Subr changed. See CHECK_STRUCTS comment in config.h."
 #endif
   struct Lisp_Subr out;
@@ -3065,7 +3065,7 @@ dump_vectorlike (struct dump_context *ctx,
                  Lisp_Object lv,
                  dump_off offset)
 {
-#if CHECK_STRUCTS && !defined HASH_pvec_type_99104541E2
+#if CHECK_STRUCTS && !defined HASH_pvec_type_933496B918
 # error "pvec_type changed. See CHECK_STRUCTS comment in config.h."
 #endif
   const struct Lisp_Vector *v = XVECTOR (lv);
@@ -3172,7 +3172,7 @@ dump_vectorlike (struct dump_context *ctx,
 static dump_off
 dump_object (struct dump_context *ctx, Lisp_Object object)
 {
-#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_45F0582FD7)
+#if CHECK_STRUCTS && !defined (HASH_Lisp_Type_2A0F47A74F)
 # error "Lisp_Type changed. See CHECK_STRUCTS comment in config.h."
 #endif
   eassert (!EQ (object, dead_object ()));
@@ -3275,7 +3275,7 @@ dump_object_for_offset (struct dump_context *ctx, Lisp_Object object)
 static dump_off
 dump_charset (struct dump_context *ctx, int cs_i)
 {
-#if CHECK_STRUCTS && !defined (HASH_charset_E31F4B5D96)
+#if CHECK_STRUCTS && !defined (HASH_charset_DDAF793226)
 # error "charset changed. See CHECK_STRUCTS comment in config.h."
 #endif
   /* We can't change the alignment here, because ctx->offset is what