1 2021-05-28 Eric Blake <eblake@redhat.com>
4 * NEWS: Record release date.
6 2021-05-28 Eric Blake <eblake@redhat.com>
8 tests: Skip signal detection on Haiku
9 On Haiku, using 'kill -9' fromm /bin/shactually causes a process to
10 die with the non-standard SIGKILLTHR 15, which causes 198.sysval to
11 fail from the unexpected value.
13 * doc/m4.texi (Sysval): Skip test on Haiku.
14 Reported by Bruno Haible,
15 https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00004.html
17 2021-05-26 Bruno Haible <bruno@clisp.org>
19 Enable more single-thread optimizations in gnulib code
20 On many systems (esp. BSD ones), building a recent m4 snapshot produces these
23 --------------------------------------------------------------------------------
25 In file included from ../../lib/regex_internal.h:57:0,
26 from ../../lib/regex.c:70:
27 ../../lib/regcomp.c: In function 'rpl_regfree':
28 ../../lib/glthread/lock.h:640:38: warning: statement with no effect [-Wunused-value]
29 # define glthread_lock_destroy(NAME) 0
31 ../../lib/regex_internal.h:60:26: note: in expansion of macro 'glthread_lock_destroy'
32 # define lock_fini(lock) glthread_lock_destroy (&(lock))
35 --------------------------------------------------------------------------------
36 According to the Gnulib documentation section "Optimizations of multithreaded
37 code" several more optimizations can be enabled. This patch
38 - enables these single-threading optimizations,
39 - by doing so, gets rid of the warnings in regex.c,
40 - causes no test failures.
42 * configure.ac (GNULIB_REGEX_SINGLE_THREAD, GNULIB_MBRTOWC_SINGLE_THREAD,
43 GNULIB_WCHAR_SINGLE_LOCALE): Define as C macros.
44 Message-Id: <3311608.oHEOCP8NKg@omega>
46 2021-05-26 Eric Blake <eblake@redhat.com>
48 maint: Update to newer gnulib
49 Gnulib has improved stack overflow detection (the c-stack module now
50 uses gnulib's stripped-down libsigsegv on more platforms, without
51 having to install GNU libsigsegv); with this update, GNU Linux systems
52 get stack overflow protection without an external library dependency.
53 * gnulib: Update to latest.
54 * NEWS: Mention the impact.
56 2021-05-12 Eric Blake <eblake@redhat.com>
58 maint: translation string tweak
59 * src/m4.c (usage): Tweak translation of a newline.
60 Reported by Benno Schulenberg,
61 https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00011.html
63 2021-05-11 Eric Blake <eblake@redhat.com>
65 maint: post-release administrivia
66 * NEWS: Add header line for next release.
67 * .prev-version: Record previous version.
68 * cfg.mk (old_NEWS_hash): Auto-update.
71 * NEWS: Recored release date.
73 2021-05-10 Eric Blake <eblake@redhat.com>
76 * po/POTFILES.in: Update list to match previous patch.
78 m4: translate more strings
79 * src/m4.c (usage): Split large paragraphs, and mark for translation.
80 (main): Translate more strings.
81 * src/builtin.c: Likewise.
82 * src/eval.c (evaluate): Likewise.
83 * src/format.c (expand_format): Likewise.
84 * src/freeze.c: Likewise.
85 * src/input.c: Likewise.
86 * src/macro.c: Likewise.
87 * src/output.c: Likewise.
88 Reported by Benno Schulenberg:
89 https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00005.html
91 2021-05-10 Eric Blake <eblake@redhat.com>
94 Fix several issues reported by Bruno Haible while testing 1.4.18b:
95 https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00002.html
96 https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00003.html
98 * gnulib: Bump to latest, for various fixes.
101 2021-05-10 Eric Blake <eblake@redhat.com>
103 maint: update m4-latest* symlinks during upload
104 Avoid the situation we had for several years where m4-latest.tar.xz
105 pointed to m4-1.4.17.tar.xz in spite of m4-1.4.18.tar.xz existing.
106 https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00003.html
108 * cfg.mk (GNUPLOADFLAGS): Update *-latest symlinks during gnupload.
110 2021-05-10 Eric Blake <eblake@redhat.com>
112 maint: mention ci project
113 Bruno Haible has added a continuous integration environment:
114 https://lists.gnu.org/archive/html/bug-m4/2020-03/msg00000.html
116 * HACKING (Continuous Integration): New section.
118 2021-05-10 Bruno Haible <bruno@clisp.org>
120 eval: avoid undefined behaviour when parsing -2147483648
121 * src/eval.c (eval_lex): Use an unsigned variable for accumulating the
123 https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00001.html
125 2021-05-07 Eric Blake <eblake@redhat.com>
127 maint: post-release administrivia
128 * NEWS: Add header line for next release.
129 * .prev-version: Record previous version.
130 * cfg.mk (old_NEWS_hash): Auto-update.
133 * NEWS: Record release date.
135 maint: prepare for beta release
136 * all: Prefer https over http in URLs.
137 * doc/m4.texi (History): Update URLs to follow redirects.
138 * NEWS: Prepare for release.
139 * cfg.mk (old_NEWS_hash): Regenerate via 'make update-NEWS-hash'
140 * HACKING: Update URL to gnulib, drop reference to CVS.
142 maint: update gnulib to latest
143 * gnulib: Pick up latest in preparation for release.
145 2021-05-07 Eric Blake <eblake@redhat.com>
147 maint: update bootstrap, (re-)enable po file generation
148 In commit 4694c4e67, I disabled bootstrap pulling in po files, because
149 I got an error while attempting to get them, and remembered that while
150 the experimental 2.0 has a .pot file, branch-1.4 (and the 1.4.18
151 release) historically did not. Basically, since the translation
152 project does not have any m4.pot corresponding to a released m4 that
153 needs it, they deleted tp/latest/m4, and with nothing to pull from,
154 rsync fails. I did not, however, realize that commit 610290de had
155 intentionally added translation support, such that m4 1.4.19 WILL have
156 translations; so until I get that directory reinstated by releasing
157 1.4.18b, I'll just use './bootstrap --skip-po'.
159 Meanwhile, Gary's upstream bootstrap has had some commits
160 (https://github.com/gnulib-modules/bootstrap.git)
162 for f in gl/build-aux/*; do cp ~/bootstrap/build-aux/$(basename $f) $f; done
163 gl/build-aux/inline-source gl/build-aux/bootstrap.in > bootstrap
165 * gl/build-aux/*: Sync from upstream.
166 * bootstrap: Regenerate.
167 * bootstrap.conf (m4_bootstrap_options_prep): Re-enable po.
168 * NEWS: Document this as intentional.
171 2021-05-07 Eric Blake <eblake@redhat.com>
173 maint: fix syntax-check issues
174 * src/Makefile.am (m4_LDADD): Rename...
175 (LDADD): ...to this, and use spelling that satisfies syntax-check.
176 * po/POTFILES.in: Update to satisfy syntax-check.
177 * cfg.mk (old_NEWS_hash): Update with 'make update-NEWS-hash'.
179 maint: bump copyright year
180 * all: Use 'make update-copyright' to add 2021.
182 README: add GNU Project notice
183 * README: Add section to attract more people towards the GNU project.
184 Inspired by a suggestion from Jose E. Marchesi <jemarch@gnu.org> on
185 the gnu-prog-discuss mailing list.
187 2021-04-22 Eric Blake <eblake@redhat.com>
189 m4: change command-line -H default
190 * src/m4.h (HASHMAX): Bump to ~64k.
191 * doc/m4.texi (Limits control): Document it.
194 maint: another gnulib update
195 * gnulib: Update to latest, to fix build on rawhide.
197 2021-04-21 Eric Blake <eblake@redhat.com>
199 symtab: use less memory in pushdef stacks
200 No need to xstrdup identical names when we can share the same name
201 across the pushdef stack.
203 * src/symtab.c (free_symbol): Don't free shared name.
204 (lookup_symbol): Share name across pushdef stack.
206 2021-04-21 Eric Blake <eblake@redhat.com>
208 symtab: make symtab private
209 No need for a leaky abstraction of freezing to have to duplicate how
210 our symbol hash table is organized; use the public function
211 hack_all_symbols instead. This will make it easier to refactor the
212 symbol table (such as automatic resizing, or switching to a trie).
214 * src/m4.h (symtab, SYMBOL_NEXT): Make private.
215 * src/freeze.c (produce_frozen_state): Split out...
216 (freeze_symbol): ...new helper, for use by hack_all_symbols.
217 * src/symtab.c (lookup_symbol, symtab_print_list): Update to treat
218 next as internal-only code.
220 2021-04-21 Eric Blake <eblake@redhat.com>
222 symtab: sort by hash before name
223 It is faster to do an integer compare than a string compare when
224 managing hash table collisions (reserving a string compare for ties).
225 Testing with CFLAGS=-DDEBUG_SYM=1 and 'time M4=src/m4 autoconf -f',
226 the results are noticeable; on my machine, execution speeds up from
227 2.3s to 2.2s, and the debug trace that used to report:
229 m4: lookup mode 0 called 1243301 times, 7859589 compares, 6734330 misses, 23941043 bytes
233 m4: lookup mode 0 called 1243301 times, 1125259 compares, 0 misses, 12433237 bytes
235 * src/m4.h (struct symbol): Add hash member.
236 * src/symtab.c (lookup_symbol): Sort by hash first, then name.
237 (symtab_print_list): Add hash debug.
239 2021-04-21 Eric Blake <eblake@redhat.com>
241 maint: switch from git:// to https:// for gnulib submodule
242 https:// is nicer than git:// for a transport for avoiding
243 man-in-the-middle attacks, provided that the server is using a
244 new-enough version of git to make https:// efficient (which
246 * .gitmodules: Prefer better URL.
248 2021-04-21 Paul Eggert <eggert@cs.ucla.edu>
250 maint: port to Solaris 10
251 Add libraries needed by current Gnulib.
252 * src/Makefile.am (m4_LDADD): Add LIB_CLOCK_GETTIME,
253 LIB_GETRANDOM, LIB_HARD_LOCALE, LIB_POSIX_SPAWN,
254 LIB_SETLOCALE_NULL, LIBUNISTRING, INTL_MACOSX_LIBS.
255 These are all needed by current Gnulib, according to gnulib-tool.
256 LIB_CLOCK_GETTIME is certainly needed for Solaris 10; otherwise
257 the m4 link fails with clock_gettime not found.
259 maint: port to macOS 11.2.3 (arm64)
260 * m4/gnulib-cache.m4: Add fopen-gnu, replacing cloexec and fopen.
261 Avoid getopt-posix-tests, since they are not needed for m4
262 and currently fail on macOS 11.2.3 (arm64).
263 * src/builtin.c (m4_incr, m4_decr): Avoid undefined behavior
264 on integer overflow that causes tests to fail on macOS.
265 * src/debug.c (debug_set_output):
266 * src/output.c (m4_tmpfile, m4_tmpopen):
267 * src/path.c (m4_fopen):
268 Use GNU fopen with "e" rather than set_cloexec_flag. This is
269 simpler, and works around a Gnulib bug on macOS with fopen
270 being replaced by rpl_fopen sometimes but not other times.
271 * src/freeze.c (produce_frozen_state): Use GNU fopen with "e";
272 no need to expose the fd to subprocesses.
274 build: update gnulib submodule to latest
276 2021-04-17 Eric Blake <eblake@redhat.com>
278 symtab: drop redundant symbol flag
279 In writing the previous patch, I noticed that the shadow flag is only
280 ever set when a pushdef stack is present, which makes it redundant now
281 that the pushdef stack is separate from the hash collision stack.
283 * src/m4.h (SYMBOL_SHADOWED): Delete.
284 * src/builtin.c (dump_symbol): Simplify, now that hack_all_symbols
285 no longer visits shadowed macros.
286 * src/symtab.c (lookup_symbol, symtab_print_list): Simplify.
288 2021-04-17 Eric Blake <eblake@redhat.com>
290 symtab: better handling of macro stacks
291 I ran into a scenario where running a program took 22s with the
292 default -H509, but less than a second with -H517 [1]. The culprit? A
293 collision between 'stack' and 'substr' in the default hash table size
294 caused lookups for substr to get progressively slower as pushdef stack
295 got deeper. This is easy enough to fix, and may also make it easier
296 to dynamically grow the hashtable.
298 [1] https://lists.gnu.org/archive/html/bug-m4/2021-04/msg00000.html
300 * src/m4.h (struct symbol): Add stack member.
301 * src/symtab.c (lookup_symbol): Separate stack from bucket list.
302 (symtab_print_list): Update traversal to match.
303 * src/freeze.c (produce_frozen_state): Likewise.
304 (reverse_symbol_list): Reverse stack, not bucket.
306 2021-04-17 Eric Blake <eblake@redhat.com>
308 input: optimize macro tail-call memory usage
309 I encountered an m4 program that performed over 20 million iterations
310 of a tail-call recursion paradigm. Without this patch, memory usage
311 grew to over 6 gigabytes, pausing the program for several seconds when
312 the recursion finally ended just to reclaim the memory. But with the
313 patch, m4 never needed more than 3 megabytes of resident memory.
315 * src/input.c (push_string_init): Prune empty string blocks before
316 starting another one.
318 2021-04-17 Eric Blake <eblake@redhat.com>
320 maint: update gnulib and fix build failures
321 I got failures when trying to bootstrap:
323 bootstrap: getting translations into po/.reference for m4...
324 receiving incremental file list
325 rsync: change_dir "/latest/m4" (in tp) failed: No such file or directory (2)
327 since m4-1.4 has no translation files, and the translation project
328 dropped the stale .po files for the unreleased 1.9 development branch.
330 Once that was fixed, I also got compilation failures, from an
331 incomplete update to the gnulib execute module:
333 builtin.c: In function 'm4_syscmd':
334 builtin.c:968:44: error: passing argument 3 of 'execute' from incompatible pointer type [-Werror=incompatible-pointer-types]
335 968 | status = execute (ARG (0), SYSCMD_SHELL, prog_args, NULL, false,
342 * gnulib: Update to latest.
343 * bootstrap.conf (copyright_holder): Silence bootstrap warning.
344 (m4_bootstrap_options_prep): Turn off po update.
346 2020-12-12 Bruno Haible <bruno@clisp.org>
348 Update after gnulib changed.
349 * src/builtin.c (m4_syscmd): Update 'execute' invocation.
350 (m4_esyscmd): Update 'create_pipe_in' invocation.
351 * po/POTFILES.in: Remove lib/w32spawn.h. Add lib/openat-die.c, lib/os2-spawn.c.
353 2020-08-23 Paul Eggert <eggert@cs.ucla.edu>
355 * HACKING: Autoconf 2.64 required now.
357 2020-08-23 Bruno Haible <bruno@clisp.org>
359 build: Fix bootstrap failure with the newest gnulib.
360 * configure.ac: Require Autoconf 2.64 at least.
362 2020-07-17 Paul Eggert <eggert@cs.ucla.edu>
364 Port recent changes to AIX 7.1
365 * src/Makefile.am (m4_LDADD): Add LIB_MBRTOWC, LIB_SETLOCALE.
366 AIX 7.1 needs these to get the pthread support linked in.
368 2020-07-13 Paul Eggert <eggert@cs.ucla.edu>
370 Support gettext and proper names
371 This way, ‘m4 --version’ outputs “Written by René Seindal”
372 instead of “Written by Rene' Seindal” when in a UTF-8 locale.
373 As the Translation project adds translations, NLS should
375 * .gitignore: Add translation-related file names.
376 * AUTHORS, ChangeLog-2014, NEWS, README, acinclude.m4, c-boxes.el:
377 Spell “François” and “René” without ASCIIfying.
378 * HACKING: Add Gettext as a prereq.
379 * Makefile.am (SUBDIRS): Add po.
380 * configure.ac: Do not use -Wvla. Add AM_GNU_GETTEXT
381 and AM_GNU_GETTEXT_VERSION calls.
382 * lib/Makefile.am (MAINTAINERCLEANFILES): Define to empty.
383 * m4/gnulib-cache.m4: Add configmake, gettext-h, propername,
384 and setlocale modules.
385 * po/POTFILES.in: New file.
386 * src/Makefile.am (m4_LDADD): Add $(LIBICONV), $(LIBINTL).
387 * src/m4.c: Include configmake.h, propername.h.
388 (main): Set the locale.
389 * src/m4.h: Include locale.h, gettext.h.
390 (textdomain, bindtextdomain) [!ENABLE_NLS]: Provide defaults.
391 (_): Now an alias for gettext, instead of a no-op.
393 Use c-ctype.h instead of ctype.h
394 This simplifies the code a bit, and prepares for setlocale.
395 * m4/gnulib-cache.m4: Add c-ctype module.
396 * src/builtin.c (numeric_arg, m4_undivert, expand_user_macro):
397 * src/eval.c (eval_lex):
398 * src/format.c (arg_int, arg_long, arg_double, expand_format):
399 * src/freeze.c (GET_NUMBER): m
400 * src/input.c (next_token, peek_token):
401 * src/macro.c (expand_argument):
402 Prefer c-ctype macros to ctype macros.
403 Omit now-unnecessary calls to to_uchar.
404 * src/m4.h: Include c-ctype.h instead of ctype.h.
406 2020-07-11 Paul Eggert <eggert@cs.ucla.edu>
410 Convert m4.texi from Latin-1 to UTF-8
411 * HACKING: Texinfo 4.11 and Autoconf 2.63 are now prereqs.
412 * doc/m4.texi: Convert to UTF-8.
414 2020-07-05 Paul Eggert <eggert@cs.ucla.edu>
416 Port to recent GCC with --enable-gcc-warnings
417 * m4/gnulib-cache.m4: Add attribute, verify.
418 * src/m4.c (m4_failure, m4_failure_at_line): New functions.
419 These replace all uses of M4ERROR ((EXIT_FAILURE, ...)) and
420 M4ERROR_WITH_LINE ((EXIT_FAILURE, ...), so that the compiler can
421 deduce they do not return.
422 * src/m4.h: Include attribute.h, verify.h.
423 (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED, M4_GNUC_PRINTF)
424 (M4_GNUC_NORETURN, M4_GNUC_PURE): Remove.
425 All uses replaced by corresponding attributes from attribute.h.
426 Also, use attribute.h’s FALLTHROUGH macro as needed in all files.
427 * src/macro.c (expand_macro): Cast to uintptr_t instead of to char *
428 to pacify GCC alignment warning.
430 maint: update copyright date
432 make update-copyright
433 gl/build-aux/inline-source gl/build-aux/bootstrap.in > bootstrap
435 build: adjust to gnulib changes
436 * configure.ac: Require Autoconf 2.63; needed by Gnulib.
437 * m4/gnulib-cache.m4: Regenerate.
439 2020-07-05 Bruno Haible <bruno@clisp.org>
441 Update after gnulib changed
442 * src/output.c (m4_tmpfile, m4_tmpopen): Update fopen_temp invocations.
443 * gl/lib/clean-temp.c.diff: Remove file, no longer needed.
445 2020-07-05 Paul Eggert <eggert@cs.ucla.edu>
447 build: update gnulib submodule to latest
449 2017-01-02 Eric Blake <eblake@redhat.com>
451 maint: bump copyright year
452 Needed to keep 'make syntax-check' passing.
454 * gnulib: Update to latest.
455 * bootstrap: Regenerate.
456 * all files: Use 'make update-copyright' to bump year.
458 2016-12-31 Eric Blake <eblake@redhat.com>
460 maint: post-release administrivia
461 * NEWS: Add header line for next release.
462 * .prev-version: Record previous version.
463 * cfg.mk (old_NEWS_hash): Auto-update.
466 * NEWS: Record release date.
468 doc: abbreviate and update release history
469 * doc/m4.texi (History): Shorten, and call out today's release.
471 2016-12-31 Eric Blake <eblake@redhat.com>
473 maint: automate creation of release tag
474 The gnulib makefile was already set up to automate things with
475 'make release ...', but we were still doing things by hand, and
476 thereby risking missing some steps.
478 * m4/gnulib-cache.m4 (gl_MODULES): Import do-release-commit-and-tag.
479 * gnulib: Update, for latest version of the script.
480 * HACKING: Mention its use.
482 2016-12-31 Eric Blake <eblake@redhat.com>
484 maint: generate ChangeLog from git commits
485 Follow the practice set in numerous other GNU projects, where
486 the ChangeLog (since 2015) is generated from git commit messages.
487 This avoids duplication or subtle differences between the two,
488 as well as making it easier to merge patches across branches
489 (as good as Bruno Haible's 'git-merge-changelog' helper program
490 is, it still doesn't handle cross-branch cherry-picks very well).
493 * ChangeLog-2014: ...to this.
494 * Makefile.am (EXTRA_DIST): Ship renamed file.
495 (gen-ChangeLog): New rule, copied mostly from coreutils.
496 (dist-hook): Generate the ChangeLog.
497 * m4/gnulib-cache.m4 (gl_MODULES): Import gitlog-to-changelog.
498 * .gitignore: Ignore ChangeLog.
499 * .gitattributes: Likewise.
500 * HACKING: Reword to match new procedure, and simplify by
501 referring to an external description of ChangeLog style.
503 2016-12-31 Eric Blake <eblake@redhat.com>
505 maint: summarize highlights of pending release
506 * NEWS: Add some blurbs.
508 2016-12-31 Eric Blake <eblake@redhat.com>
510 maint: make silent builds the default
511 The user still has full control over verbosity levels, both setting
512 their per-project defaults at configure time (or even in a config.site
513 file), as well as a per-run override. But these days, most projects
514 are defaulting to silent rules without user intervention.
516 * configure.ac (AM_SILENT_RULES): Add, to match what most projects
517 are doing these days.
519 2016-12-31 Eric Blake <eblake@redhat.com>
521 maint: release no longer creates a diff file
522 Ever since commit f1cf390 (1.4.14 release), we no longer create
523 diff files as part of the release process. These days, it is
524 assumed that it is easier to download a fresh tarball rather
525 than to try and use a diff file to patch an older tarball.
527 2016-12-30 Eric Blake <eblake@redhat.com>
529 doc: drop obsolete @setcontentsaftertitlepage
530 texinfo 6.1 complains (during 'make dvi'):
532 /home/eblake/m4-1.4/doc/./m4.texi:9: @setcontentsaftertitlepage has been remove
533 d as a Texinfo command; move your @contents command if you want the contents af
536 It turns out that eliminating the command has no effect - modern
537 tools correctly emit the contents in-place, right after the title
538 page, so it was leftover cruft from an older time.
540 * doc/m4.texi: Satisfy newer texinfo.
542 2016-12-29 Eric Blake <eblake@redhat.com>
544 build: update to latest gnulib
545 I hit a weird failure during 'make check', and traced it to a recent
546 gnulib regression in parallel test safety. Pick up the gnulib fix.
548 * gnulib: Update to latest, to fix failure in getopt tests.
550 2016-12-29 Eric Blake <eblake@redhat.com>
552 maint: regenerate bootstrap
553 Missed during the copyright update.
555 * bootstrap: Regenerate.
557 2016-12-29 Eric Blake <eblake@redhat.com>
559 maint: bump copyright year
560 Sadly, there's no commit in 2015, which means we don't get to benefit
561 from using a copyright range.
563 Done with 'make update-copyright'.
565 * all files: Version control now has a commit in 2016.
567 2016-12-29 Eric Blake <eblake@redhat.com>
569 gnulib: Update to latest
570 * gnulib: Update to latest.
571 * m4/gnulib-cache.m4: Regenerate.
572 * src/macro.c (expand_macro): Deal with obstack API change.
573 * src/builtin.c (mkstemp_helper): Likewise.