Paul Eggert [Thu, 16 Dec 2021 20:40:14 +0000 (12:40 -0800)]
stdint: omit duplicate gl_CONFIGURE_HEADER calls
* modules/stdint (configure.ac): Omit
‘gl_CONDITIONAL_HEADER([limits.h])’, since stdint depends on
limits-h and doing gl_CONDITIONAL_HEADER twice can result in
‘configure’ failing with “*** GL_GENERATE_LIMITS_H is not set
correctly”.
Bruno Haible [Wed, 15 Dec 2021 18:18:31 +0000 (19:18 +0100)]
Accommodate non-recursive Automake in a less hacky way.
* gnulib-tool: New option --automake-subdir.
(automake_subdir): New variable.
(func_emit_initmacro_end): Add a second argument. Use it to prefix each
object file name in *_LIBOBJS and *_LTLIBOBJS.
(func_emit_shellvars_init): New function.
(func_import): Add support for --automake-subdir. Invoke
prefix-gnulib-mk. Update calls to func_emit_initmacro_end. Call
func_emit_shellvars_init.
(func_create_testdir): Update calls to func_emit_initmacro_end. Call
func_emit_shellvars_init.
* m4/gnulib-tool.m4 (gl_AUTOMAKE_SUBDIR): New macro.
* m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): Use the value of the
gl_source_base_prefix variable.
* build-aux/prefix-gnulib-mk: New options --from-gnulib-tool, --prefix.
(contents_of_file): Renamed from contents.
(contents_of_stdin): New function.
(process): Inline and remove function.
* doc/gnulib-tool.texi (Non-recursive make): New section.
Bruno Haible [Wed, 15 Dec 2021 18:18:25 +0000 (19:18 +0100)]
Move .h file names out of the *.m4 files.
This is useful because Autoconf macros defined in *.m4 files can be
AC_REQUIREd. In the configure file, they are then expanded before
gl_INIT, i.e. at a place where it is not known whether they are required
for the lib/ or for the tests/ directory (or both).
* m4/gnulib-common.m4 (gl_CONDITIONAL_HEADER): New macro.
* m4/alloca.m4 (gl_FUNC_ALLOCA): Set GL_GENERATE_ALLOCA_H instead of
ALLOCA_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/alloca-opt (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/argz.m4 (gl_FUNC_ARGZ): Set GL_GENERATE_ARGZ_H instead of ARGZ_H.
Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/argz (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/assert_h.m4 (gl_ASSERT_H): Set GL_GENERATE_ASSERT_H instead of
ASSERT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/assert-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/byteswap.m4 (gl_BYTESWAP): Set GL_GENERATE_BYTESWAP_H instead of
BYTESWAP_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/byteswap (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H): Set GL_GENERATE_ERRNO_H instead of
ERRNO_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
(gl_REPLACE_ERRNO_VALUE): Update.
* m4/perror.m4 (gl_FUNC_PERROR): Update.
* m4/strerror.m4 (gl_FUNC_STRERROR): Update.
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R, gl_FUNC_STRERROR_R_WORKS):
Update.
* modules/errno (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/execinfo.m4 (gl_EXECINFO_H): Set GL_GENERATE_EXECINFO_H instead of
EXECINFO_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Drop AC_LIBOBJ
invocation.
* modules/execinfo (configure.ac): Invoke gl_CONDITIONAL_HEADER and
AC_LIBOBJ.
* m4/float_h.m4 (gl_FLOAT_H): Set GL_GENERATE_FLOAT_H instead of
FLOAT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/float (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/fnmatch_h.m4 (gl_FNMATCH_H, gl_REPLACE_FNMATCH_H): Set
GL_GENERATE_FNMATCH_H instead of FNMATCH_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/fnmatch-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/fnmatch (configure.ac): Likewise.
* m4/getopt.m4 (gl_FUNC_GETOPT_POSIX, gl_GETOPT_SUBSTITUTE_HEADER): Set
GL_GENERATE_GETOPT_H instead of GETOPT_H. Set GL_GENERATE_GETOPT_CDEFS_H
instead of GETOPT_CDEFS_H. Drop AC_SUBST invocations.
* modules/getopt-posix (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/glob_h.m4 (gl_GLOB_H, gl_REPLACE_GLOB_H): Set GL_GENERATE_GLOB_H
instead of GLOB_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/glob-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/glob (configure.ac): Likewise.
* m4/iconv_h.m4 (gl_ICONV_H_DEFAULTS, gl_REPLACE_ICONV_H): Set
GL_GENERATE_ICONV_H instead of ICONV_H. Drop AC_SUBST and AM_CONDITIONAL
invocations.
(gl_ICONV_H): Update.
* modules/iconv-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/iconv_open (configure.ac): Likewise.
* m4/ieee754-h.m4 (gl_IEEE754_H): Set GL_GENERATE_IEEE754_H instead of
IEEE754_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/ieee754-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/libgmp.m4 (gl_LIBGMP): Set GL_GENERATE_GMP_H instead of GMP_H. Drop
AC_SUBST invocation.
* modules/libgmp (configure.ac): Invoke gl_CONDITIONAL_HEADER.
(Makefile.am): Use GL_GENERATE_GMP_H.
* m4/libtextstyle-optional.m4 (gl_LIBTEXTSTYLE_OPTIONAL): Set
GL_GENERATE_TEXTSTYLE_H instead of TEXTSTYLE_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/libtextstyle-optional (configure.ac): Invoke
gl_CONDITIONAL_HEADER.
* m4/limits-h.m4 (gl_LIMITS_H, gl_REPLACE_LIMITS_H): Set
GL_GENERATE_LIMITS_H instead of LIMITS_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/limits-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/monetary_h.m4 (gl_MONETARY_H): Set GL_GENERATE_MONETARY_H instead
of MONETARY_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/monetary (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/net_if_h.m4 (gl_HEADER_NET_IF): Set GL_GENERATE_NET_IF_H instead of
NET_IF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/net_if (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/netinet_in_h.m4 (gl_HEADER_NETINET_IN): Set
GL_GENERATE_NETINET_IN_H instead of NETINET_IN_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* modules/netinet_in (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/selinux-context-h.m4 (gl_HEADERS_SELINUX_CONTEXT_H): Set
GL_GENERATE_SELINUX_CONTEXT_H instead of SELINUX_CONTEXT_H. Drop
AC_SUBST and AM_CONDITIONAL invocations.
* m4/selinux-label-h.m4 (gl_HEADERS_SELINUX_LABEL_H): Set
GL_GENERATE_SELINUX_LABEL_H instead of SELINUX_LABEL_H. Drop AC_SUBST
and AM_CONDITIONAL invocations.
* modules/selinux-h (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdalign.m4 (gl_STDALIGN_H): Set GL_GENERATE_STDALIGN_H instead of
STDALIGN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdalign (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdarg.m4 (gl_STDARG_H): Set GL_GENERATE_STDARG_H instead of
STDARG_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdarg (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdbool.m4 (gl_STDBOOL_H): Renamed from AM_STDBOOL_H. Set
GL_GENERATE_STDBOOL_H instead of STDBOOL_H. Drop AC_SUBST and
AM_CONDITIONAL invocations.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Don't require AM_STDBOOL_H.
* modules/stdbool (configure.ac): Invoke gl_STDBOOL_H instead of
AM_STDBOOL_H. Invoke gl_CONDITIONAL_HEADER.
* m4/stddef_h.m4 (gl_STDDEF_H): Set GL_GENERATE_STDDEF_H instead of
STDDEF_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stddef (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdint.m4 (gl_STDINT_H): Set GL_GENERATE_STDINT_H instead of
STDINT_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Update.
* modules/stdint (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/stdnoreturn.m4 (gl_STDNORETURN_H): Set GL_GENERATE_STDNORETURN_H
instead of STDNORETURN_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/stdnoreturn (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* m4/sys_socket_h.m4 (gl_SYS_SOCKET_H): Set GL_GENERATE_SYS_SOCKET_H
instead of SYS_SOCKET_H.
* m4/sysexits.m4 (gl_SYSEXITS): Set GL_GENERATE_SYSEXITS_H instead of
SYSEXITS_H. Drop AC_SUBST and AM_CONDITIONAL invocations.
* modules/sysexits (configure.ac): Invoke gl_CONDITIONAL_HEADER.
* modules/sigsegv (configure.ac): Set GL_GENERATE_SIGSEGV_H instead of
SIGSEGV_H. Drop AC_SUBST and AM_CONDITIONAL invocations. Invoke
gl_CONDITIONAL_HEADER.
Paul Eggert [Tue, 14 Dec 2021 20:32:30 +0000 (12:32 -0800)]
renameatu: port to macOS tmpfs
Problem reported by Sudhip Nashi (Bug#52193).
* lib/renameatu.c (renameat2ish) [HAVE_RENAMEAT]: New function.
(renameatu): Use the new function, to avoid a bug when
renameatx_np fails with errno == ENOTSUP. Don’t try to support
RENAME_EXCHANGE; the old code didn’t work and nobody using using
RENAME_EXCHANGE anyway.
Paul Eggert [Mon, 13 Dec 2021 01:17:47 +0000 (17:17 -0800)]
bootstrap: refactor for GNU tar
* build-aux/bootstrap (gitignore_entries, insert_if_absent)
(insert_vc_ignore, symlink_to_dir): Define these shell functions
before including bootstrap.conf. This is for GNU tar, whose
bootstrap.conf uses symlink_to_dir.
Bruno Haible [Sun, 12 Dec 2021 20:13:54 +0000 (21:13 +0100)]
gnulib-tool: Support different basenames for the lib/,tests/ Makefiles.
* gnulib-tool: New option --tests-makefile-name.
(tests_makefile_name): New variable.
(func_import): Add support for --tests-makefile-name. Replace local
variable makefile_am with two local variables source_makefile_am,
tests_makefile_am.
Bruno Haible [Sat, 11 Dec 2021 16:43:48 +0000 (17:43 +0100)]
get_ppid_of, get_progname_of: Fix compilation error on Mac OS X < 10.5.
Reported by Ryan Schmidt <gnulib@ryandesign.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-12/msg00011.html>.
* lib/get_ppid_of.c: Include AvailabilityMacros.h
(get_ppid_of): Use MAC_OS_X_VERSION_MAX_ALLOWED and
MAC_OS_X_VERSION_MIN_REQUIRED.
* lib/get_progname_of: Include AvailabilityMacros.h
(get_progname_of): Use MAC_OS_X_VERSION_MAX_ALLOWED and
MAC_OS_X_VERSION_MIN_REQUIRED.
Paul Eggert [Fri, 10 Dec 2021 21:43:10 +0000 (13:43 -0800)]
backupfile: prefer signed integers
* lib/backupfile.c: Include ialloc.h instead of idx.h.
Prefer idx_t to size_t where either will do.
Use imalloc and irealloc instead of malloc and realloc.
* modules/backupfile, modules/backup-rename (Depends-on):
Depend on ialloc not idx.
Paul Eggert [Fri, 10 Dec 2021 21:31:02 +0000 (13:31 -0800)]
backupfile: fix numbered backups for XXX/
This fixes Bug#52410 reported by Vincent Vermilya.
* lib/backupfile.c (check_extension): Return a bool indicating
whether the original extension was OK. Caller changed.
(numbered_backup): Require that FILELEN does not count
trailing slashes after a non-slash, and don’t require
that *BUF be null-terminated. Caller changed.
This fixes a bug where the numbered backup file name for X/ was
incorrectly computed because the trailing slash messed up the code
looking for X.~1~, X.~2~, etc., and this caused numbered_backup
to loop forever. Also, check that check_extension doesn’t
truncate a file name leading to a different infloop.
Paul Eggert [Tue, 7 Dec 2021 22:34:21 +0000 (14:34 -0800)]
regex: pacify Coverity clean_state_log_if_needed
Problem reported by Robbie Harwood in:
https://lists.gnu.org/r/bug-gnulib/2021-12/msg00005.html
* lib/regexec.c (clean_state_log_if_needed):
Add a DEBUG_ASSERT; this both pacifies Coverity and
will help to debug in case some other change mistakenly
causes the assertion to become false.
Paul Eggert [Mon, 6 Dec 2021 18:29:54 +0000 (10:29 -0800)]
intprops: streamline and get ready for Clang 14
* lib/intprops.h (_GL_HAS_BUILTIN_ADD_OVERFLOW):
Rely on __has_builtin first, since GCC didn’t introduce it until
GCC 9 so we don’t need to special-case GCC first.
(_GL_HAS_BUILTIN_ADD_OVERFLOW, _GL_HAS_BUILTIN_OVERFLOW_P):
Look at __EDG__ rather than __ICC, since icc defines __EDG__ too.
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Define to 1 in Clang 14 and later,
as a bug fix is scheduled for Clang 14.
(_GL_HAS_BUILTIN_OVERFLOW_P): Do not bother to special-case
__clang__, since __has_builtin should do the right thing anyway.
Paul Eggert [Wed, 1 Dec 2021 01:50:01 +0000 (17:50 -0800)]
sys_random: port better to uClibc < 1.0.35
Problem reported by Fabrice Fontaine in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00043.html
* lib/sys_random.in.h [HAVE_SYS_RANDOM_H && !__GLIBC__ && __UCLIBC__]:
Include <stddef.h>, in case this file is included before
__UCLIBC__ is defined.
Paul Eggert [Sat, 27 Nov 2021 08:33:24 +0000 (00:33 -0800)]
gettext-h: use VLA test similar to regex
* lib/gettext.h (_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS): Assuming
GNULIB_NO_VLA, define if (defined __STDC_VERSION__ && 199901L <=
__STDC_VERSION__ \ + && !defined __STDC_NO_VLA___), not if
((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__).
This is more consistent with what the regex module does.
* modules/gettext-h (Depends-on): Depend on vararrays, since
lib/gettext.h uses __STDC_NO_VLA__.
Paul Eggert [Sat, 27 Nov 2021 08:00:46 +0000 (00:00 -0800)]
regex: port to tcc
Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00038.html
* modules/regex (Depends-on): Depend on vararrays, since
lib/regex.h uses __STDC_NO_VLA__.
* modules/vararrays: Change license from LGPL to LGPLv2+.
Bernhard Voelker [Wed, 24 Nov 2021 22:59:00 +0000 (23:59 +0100)]
test-framework-sh: remove unsafe entries from PATH
Running tests with '.' in the PATH may yield unspecified results,
and is deemed unsafe per se. This includes empty entries as well
which are treated like a '.' entry as per POSIX.
* tests/init.sh (setup_): Add snippet to remove relative and non-
accessible entries from the PATH environment variable.
Paul Eggert [Wed, 24 Nov 2021 17:33:46 +0000 (09:33 -0800)]
regex: merge from glibc
The main change here, imported from Glibc, is for the regex
code to stop using nested functions when _LIBC is defined.
The intent is for the result to be copied back to Glibc
so that the two implementations can resync.
* lib/regcomp.c (re_set_fastmap, seek_collating_symbol_entry)
(lookup_collation_sequence_value, build_range_exp)
(build_collating_symbol):
* lib/regexec.c (acquire_init_state_context):
Declare with __always_inline instead of with
‘inline __attribute__ ((always_inline))’.
* lib/regexec.c (init_word_char):
Move uint64_t comment to regex_internal.h.
(parse_byte): Change multibyte-detecting arg from re_charset_t *
to re_dfa_t const *. All callers changed.
(build_range_exp, build_collating_symbol) [!_LIBC]:
Change signature to match _LIBC well enough so that the caller can
be simplified to assume _LIBC.
(parse_bracket_exp): Pull its nested functions
seek_collating_symbol_entry, lookup_collation_sequence_value,
build_range_exp, build_collating_symbol out to the top level,
adding args to pass the information instead of having them access
nonlocal vars. Use types in local vars that do not assume glibc.
* lib/regex_internal.h: Explain uint64_t etc. here.
Paul Eggert [Wed, 24 Nov 2021 01:34:45 +0000 (17:34 -0800)]
regex: assume RE_ENABLE_I18N
These days there is no longer any need to port to platforms
lacking iswctype etc., since Gnulib now has substitutes.
* config/srclist.txt: Comment out regex_internal.c and
regex_internal.h for now, since they no longer match glibc.
The intent is to merge them again soon.
* lib/regex_internal.h (RE_ENABLE_I18N): Remove.
All uses changed to assume that RE_ENABLE_I18N is 1.
* modules/regex (Depends-on): Add iswctype.
Paul Eggert [Tue, 16 Nov 2021 06:17:44 +0000 (22:17 -0800)]
lseek: port around macOS SEEK_HOLE glitch
Problem reported by Sudhip Nashi (Bug#51857#47).
* lib/lseek.c (rpl_lseek): Work around macOS lseek+SEEK_HOLE
returning -1 with ENXIO if there are no holes before EOF,
contrary to the macOS documentation.
Paul Eggert [Mon, 15 Nov 2021 23:08:25 +0000 (15:08 -0800)]
lseek: port around macOS SEEK_DATA glitch
Problem reported by Sudhip Nashi (Bug#51857).
* doc/posix-functions/lseek.texi (lseek): Mention macOS SEEK_DATA
issue.
* lib/lseek.c (rpl_lseek): Work around macOS portability glitch.
* m4/lseek.m4 (gl_FUNC_LSEEK): Replace lseek on Darwin.
* modules/lseek (Depends-on): Depend on msvc-nothrow
and fstat only if needed.
Fabrice Fontaine [Thu, 11 Nov 2021 08:57:23 +0000 (09:57 +0100)]
sigsegv: fix build on microblazeel
Fix the following build failure on microblazeel with diffutils 3.8:
sigsegv.c:979:28: error: 'struct vma_struct' has no member named 'is_near_this'
http://autobuild.buildroot.org/results/5ecd55b7c72f9630a7acc72341ccb60e94ddb574
Paul Eggert [Mon, 8 Nov 2021 07:31:08 +0000 (23:31 -0800)]
regex: break regcomp.c link with glibc
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2021-11/msg00005.html
* config/srclist.txt: Comment out regcomp.c for now.
* lib/regcomp.c: Revert previous change.
Bruno Haible [Sun, 24 Oct 2021 22:34:24 +0000 (00:34 +0200)]
string: Avoid syntax error re strdup in string.in.h (regr. 2021-09-07).
Reported by Jan Engelhardt <jengelh@inai.de>
and by Arash Esbati <arash@gnu.org> via Andy Moreton in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00058.html>.
* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Add fallback declarations, like in
lib/stdlib.in.h.
* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC, _GL_ATTRIBUTE_DEALLOC_FREE,
_GL_ATTRIBUTE_MALLOC): Likewise.
Paul Eggert [Sat, 16 Oct 2021 02:33:46 +0000 (19:33 -0700)]
nproc: port better to macOS 10.14
* lib/nproc.c (num_processors_ignoring_omp)
[HAVE_SYSCTL && !defined __GLIBC__ && defined HW_NCPU]:
Do not use a const mib, as macOS 10.14 rejects this.
Paul Eggert [Sun, 10 Oct 2021 17:43:47 +0000 (10:43 -0700)]
nproc: port better to OpenBSD
Problem reported by Omar Polo in:
https://lists.gnu.org/r/emacs-devel/2021-10/msg00692.html
* lib/nproc.c (num_processors_ignoring_omp): Prefer HW_NCPUONLINE
to HW_NCPU, for OpenBSD. Also, make mib const.
Paul Eggert [Sat, 2 Oct 2021 21:11:55 +0000 (14:11 -0700)]
sys_select: port better to OpenBSD 6.9
OpenBSD 6.9’s <sys/time.h> includes <sys/select.h> which then
includes <signal.h>, which caused coreutils/lib/nproc.c compiles
to fail with "/usr/include/signal.h:57: warning: 'struct
sigaction' declared inside parameter list". Fix this.
* lib/sys_select.in.h [__OpenBSD__]: Simply delegate to the system
header if being included from <sys/time.h>.
Paul Eggert [Tue, 21 Sep 2021 15:14:05 +0000 (08:14 -0700)]
regex: sync with glibc
* config/srclist.txt: Uncomment-out posix/regex.c and related
files, as the Gnulib versions have now been copied to glibc.
* lib/intprops.h: Remove authorship comment, as per glibc guidelines.
Bruno Haible [Sun, 19 Sep 2021 13:14:24 +0000 (15:14 +0200)]
Improve 'configure --help' output for crypto modules.
* m4/af_alg.m4 (gl_AF_ALG): List the hash functions for which we use the
Linux crypto. Also mention that we use it on files only.
* m4/gl-openssl.m4 (gl_CRYPTO_CHECK): Use manual line breaking, not the
line-filling style of AS_HELP_STRING. Show that --with-openssl takes an
optional argument. List the hash functions for which we use the OpenSSL
library. Don't mention --with-linux-crypto if the af_alg module is not
in use. Mention that --with-linux-crypto applies only to the Linux
kernel. Mention that it gets used only when available. Mention that it
takes precedence only for files. In the error or warning, mention the
pre-built package name that people can install.
Bruno Haible [Sat, 18 Sep 2021 23:43:02 +0000 (01:43 +0200)]
sm3-buffer tests: New module.
* tests/test-sm3-buffer.c: Renamed from tests/test-sm3.c.
* modules/crypto/sm3-buffer-tests: Renamed from
modules/crypto/sm3-tests. Test tests/test-sm3-buffer.c instead of
tests/test-sm3.c.
Bruno Haible [Sat, 18 Sep 2021 23:42:57 +0000 (01:42 +0200)]
sm3-buffer: New module.
* lib/sm3-stream.c: New file, extracted from lib/sm3.c.
* lib/sm3.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, sm3_stream): Moved to sm3-stream.c.
* lib/sm3.h: Tweak.
* modules/crypto/sm3-buffer: New file, based on modules/crypto/sm3.
* modules/crypto/sm3: Rewritten.
Bruno Haible [Sat, 18 Sep 2021 23:42:20 +0000 (01:42 +0200)]
sha512-buffer tests: New module.
* tests/test-sha512-stream.c: Renamed from tests/test-sha512.c.
* modules/crypto/sha512-buffer-tests: New file, based on
modules/crypto/sha512-tests.
* modules/crypto/sha512-tests: Remove tests that are now in
modules/crypto/sha512-buffer-tests. Test tests/test-sha512-stream.c
instead of tests/test-sha512.c.
Bruno Haible [Sat, 18 Sep 2021 23:39:47 +0000 (01:39 +0200)]
sha256-buffer tests: New module.
* tests/test-sha256-stream.c: Renamed from tests/test-sha256.c.
* modules/crypto/sha256-buffer-tests: New file, based on
modules/crypto/sha256-tests.
* modules/crypto/sha256-tests: Remove tests that are now in
modules/crypto/sha256-buffer-tests. Test tests/test-sha256-stream.c
instead of tests/test-sha256.c.
Bruno Haible [Sat, 18 Sep 2021 23:37:51 +0000 (01:37 +0200)]
sha1-buffer tests: New module.
* tests/test-sha1-buffer.c: New file, based on tests/test-sha1.c.
* tests/test-sha1-stream.c: Renamed from tests/test-sha1.c.
(main): Remove sha1-buffer tests.
* modules/crypto/sha1-buffer-tests: New file, based on
modules/crypto/sha1-tests.
* modules/crypto/sha1-tests: Remove tests that are now in
modules/crypto/sha1-buffer-tests. Test tests/test-sha1-stream.c instead
of tests/test-sha1.c.
Bruno Haible [Sat, 18 Sep 2021 23:35:24 +0000 (01:35 +0200)]
md5-buffer tests: New module.
* tests/test-md5-buffer.c: New file, based on tests/test-md5.c.
* tests/test-md5-stream.c: Renamed from tests/test-md5.c.
(main): Remove md5-buffer tests.
* modules/crypto/md5-buffer-tests: New file, based on
modules/crypto/md5-tests.
* modules/crypto/md5-tests: Remove tests that are now in
modules/crypto/md5-buffer-tests. Test tests/test-md5-stream.c instead
of tests/test-md5.c.
Bruno Haible [Sat, 18 Sep 2021 23:33:31 +0000 (01:33 +0200)]
md4-buffer tests: New module.
* tests/test-md4-buffer.c: Renamed from tests/test-md4.c.
* modules/crypto/md4-buffer-tests: Renamed from
modules/crypto/md4-tests. Test tests/test-md4-buffer.c instead of
tests/test-md4.c.
Bruno Haible [Sat, 18 Sep 2021 23:32:01 +0000 (01:32 +0200)]
md4-buffer: New module.
* lib/md4-stream.c: New file, extracted from lib/md4.c.
* lib/md4.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, md4_stream): Moved to md4-stream.c.
* lib/md4.h: Reorder declarations.
* modules/crypto/md4-buffer: New file, based on modules/crypto/md4.
* modules/crypto/md4: Rewritten.
Bruno Haible [Sat, 18 Sep 2021 23:30:12 +0000 (01:30 +0200)]
md2-buffer tests: New module.
* tests/test-md2-buffer.c: Renamed from tests/test-md2.c.
* modules/crypto/md2-buffer-tests: Renamed from
modules/crypto/md2-tests. Test tests/test-md2-buffer.c instead of
tests/test-md2.c.
Bruno Haible [Sat, 18 Sep 2021 23:29:33 +0000 (01:29 +0200)]
md2-buffer: New module.
* lib/md2-stream.c: New file, extracted from lib/md2.c.
* lib/md2.c: Don't include stdlib.h, unlocked-io.h.
(BLOCKSIZE, md2_stream): Moved to md2-stream.c.
* lib/md2.h: Reorder declarations.
* modules/crypto/md2-buffer: New file, based on modules/crypto/md2.
* modules/crypto/md2: Rewritten.
Paul Eggert [Mon, 13 Sep 2021 18:12:54 +0000 (11:12 -0700)]
asyncsafe-spin: port to Oracle Studio 12.6 sparc
Problem reported by Dennis Clarke via Eric Blake in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00056.html
* lib/asyncsafe-spin.c (asm) [0x590 <= __SUNPRO_C && __STDC__]:
#define to __asm.
* lib/sigsegv.c (SIGSEGV_FAULT_STACKPOINTER):
Special case for __OpenBSD__ && __powerpc64__, needed due to:
https://github.com/openbsd/src/commit/5e649a8714ba05cf482011b7b7d1e5437b7c17db
which is part of the oldest currently-supported OpenBSD (6.8),
so we needn’t worry about older versions.
Paul Eggert [Thu, 9 Sep 2021 02:18:37 +0000 (19:18 -0700)]
strerror_r-posix: port even better to Android
* lib/strerror_r.c: Use STRERROR_R_CHAR_P to decide whether the
system strerror_r returns char *, and HAVE_DECL_STRERROR_R to
decide whether it either does that or returns an integer. In the
former case, use the system strerror_r even on platforms like
Android API level 23 that don’t have __xpg_strerror_r; also
check for strerror_r failure just in case.
* m4/error.m4 (gl_PREREQ_ERROR):
* m4/strerror_r.m4 (gl_PREREQ_STRERROR_R):
Use system extensions on Android, to avoid mishandling strerror_r
on API level 23 and later.
* modules/error, modules/strerror_r-posix (configure.ac):
Surround gl_PREREQ_ERROR with AS_IF instead of plain if, so that
AC_REQUIREs are propagated out.
Paul Eggert [Wed, 8 Sep 2021 16:45:46 +0000 (09:45 -0700)]
strerror_r-posix: port better to Android
* m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Move requirement of
gl_USE_SYSTEM_EXTENSIONS from here ...
(gl_FUNC_STRERROR_R_WORKS): ... to here, which is the macro that
actually needs it. This avoids a bug where 'configure' tests
whether strerror_r has the POSIX API before enabling GNU
extensions. On Android, enabling GNU extensions switches from the
POSIX to the GNU API. Problem reported by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html
Paul Eggert [Wed, 8 Sep 2021 16:42:41 +0000 (09:42 -0700)]
string, wchar: port rpl_free decl to Android
* lib/string.in.h, lib/wchar.in.h:
(free): When replacing it, declare the unreplaced version too.
Problem reported by Lucy Phipps in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00026.html