aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2022-10-02 20:31:12 +0000
committerAlan Mackenzie2022-10-02 20:31:12 +0000
commit3cc1706c63fde2e5a6313537817db2d32e829b6a (patch)
tree84a7cfc3a702bfc9a6dff026ed5c5a88e6856b41
parentffce59b3ade02c696f06f73f81e2df2e5f72ae07 (diff)
downloademacs-3cc1706c63fde2e5a6313537817db2d32e829b6a.tar.gz
emacs-3cc1706c63fde2e5a6313537817db2d32e829b6a.zip
Suppress irritating/misleading message in make bootstrap about old .elc files
These are the "compile-first" .elc files, artificially given an old timestamp to cause them later to be native compiled. This fixes bug #58224. * lisp/Makefile.in (compile-first .el.elc): Give these .elc's the UTC epoch. Amend the comment. * src/lread.c (Fload): New variable, epoch_timestamp, initialized to binary zero. Compare with this the timestamp of .elc's being loaded, and if they match, don't output the message about the source file being newer than the file being loaded.
-rw-r--r--lisp/Makefile.in16
-rw-r--r--src/lread.c8
2 files changed, 16 insertions, 8 deletions
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index bcf4a3146d4..e66d80f8144 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -304,16 +304,18 @@ endif
304ifeq ($(HAVE_NATIVE_COMP),yes) 304ifeq ($(HAVE_NATIVE_COMP),yes)
305ifeq ($(ANCIENT),yes) 305ifeq ($(ANCIENT),yes)
306# The first compilation of compile-first, using an interpreted compiler: 306# The first compilation of compile-first, using an interpreted compiler:
307# The resulting .elc files get given a date of 1971-01-01 so that their 307# The resulting .elc files get given a timestamp of the Unix epoch,
308# date stamp is earlier than the source files, causing these to be compiled 308# 1970-01-01, so that their timestamps are earlier than the source files,
309# into native code at the second recursive invocation of this $(MAKE), 309# causing these to be compiled into native code at the second recursive
310# using these .elc's. This is faster than just compiling the native code 310# invocation of this $(MAKE), using these .elc's. This is faster than just
311# directly using the interpreted compile-first files. (Note: 1970-01-01 311# compiling the native code directly using the interpreted compile-first
312# fails on some systems.) 312# files. Note that the epoch date is hard-coded into Fload in src/lread.c
313# which uses it to avoid displaying certain messages which might be
314# irritating/misleading during a bootstrap.
313.el.elc: 315.el.elc:
314 $(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \ 316 $(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
315 -l comp -f batch-byte-compile $< 317 -l comp -f batch-byte-compile $<
316 touch -t 197101010000 $@ 318 TZ=UTC touch -t 197001010000 $@
317else 319else
318.el.elc: 320.el.elc:
319 $(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \ 321 $(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
diff --git a/src/lread.c b/src/lread.c
index 51cbf811bab..dfa4d9afb51 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1423,6 +1423,7 @@ Return t if the file exists and loads successfully. */)
1423 struct stat s1, s2; 1423 struct stat s1, s2;
1424 int result; 1424 int result;
1425 1425
1426 struct timespec epoch_timespec = {(time_t)0, 0}; /* 1970-01-01T00:00 UTC */
1426 if (version < 0 && !(version = safe_to_load_version (file, fd))) 1427 if (version < 0 && !(version = safe_to_load_version (file, fd)))
1427 error ("File `%s' was not compiled in Emacs", SDATA (found)); 1428 error ("File `%s' was not compiled in Emacs", SDATA (found));
1428 1429
@@ -1451,7 +1452,12 @@ Return t if the file exists and loads successfully. */)
1451 newer = 1; 1452 newer = 1;
1452 1453
1453 /* If we won't print another message, mention this anyway. */ 1454 /* If we won't print another message, mention this anyway. */
1454 if (!NILP (nomessage) && !force_load_messages) 1455 if (!NILP (nomessage) && !force_load_messages
1456 /* We don't want this message during
1457 bootstrapping for the "compile-first" .elc
1458 files, which have had their timestamps set to
1459 the epoch. See bug #58224. */
1460 && timespec_cmp (get_stat_mtime (&s1), epoch_timespec))
1455 { 1461 {
1456 Lisp_Object msg_file; 1462 Lisp_Object msg_file;
1457 msg_file = Fsubstring (found, make_fixnum (0), make_fixnum (-1)); 1463 msg_file = Fsubstring (found, make_fixnum (0), make_fixnum (-1));