]> Savannah Git Hosting - gnulib.git/log
gnulib.git
4 years agologl: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:15:38 +0000 (13:15 +0100)]
logl: Document musl libc bug.

* doc/posix-functions/logl.texi: Document musl libc bug.
* m4/logl.m4 (gl_FUNC_LOGL_WORKS): Update comment and cross
compilation guess.

4 years agoexpm1l: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:14:29 +0000 (13:14 +0100)]
expm1l: Document musl libc bug.

* doc/posix-functions/expm1l.texi: Document musl libc bug.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Update comment and cross
compilation guess.

4 years agoexpl: Document musl libc bug.
Bruno Haible [Sun, 31 Jan 2021 12:10:58 +0000 (13:10 +0100)]
expl: Document musl libc bug.

* doc/posix-functions/expl.texi: Document musl libc bug.
* m4/expl.m4 (gl_FUNC_EXPL): Update comment and cross
compilation guess.

4 years agorelocatable-prog-wrapper: Update after recent changes.
Bruno Haible [Sun, 31 Jan 2021 11:42:47 +0000 (12:42 +0100)]
relocatable-prog-wrapper: Update after recent changes.

* lib/relocwrapper.c: Update comments.
* modules/relocatable-prog-wrapper (Files): Add lib/scratch_buffer.h,
lib/malloc/scratch_buffer*, lib/malloc.c, lib/realloc.c, lib/free.c,
lib/mempcpy.c, lib/rawmemchr.c, m4/lstat.m4. Remove lib/lstat.c.
(Depends-on): Add c99, eloop-threshold, fcntl-h, idx, intprops,
libc-config, stddef, sys_stat. Remove alloca-opt.
(configure.ac): Invoke gl_FUNC_MALLOC_POSIX, gl_FUNC_REALLOC_POSIX,
gl_FUNC_FREE, gl_FUNC_MEMPCPY, gl_FUNC_RAWMEMCHR.
* lib/canonicalize-lgpl.c (memmove): Undefine in the relocwrapper.
* build-aux/install-reloc (func_create_wrapper): Compile also
malloc/scratch_buffer_*.c, malloc.c, realloc.c, free.c, mempcpy.c,
rawmemchr.c. Don't compile lstat.c.

4 years agoMake it possible to compile rawmemchr.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:42:33 +0000 (12:42 +0100)]
Make it possible to compile rawmemchr.c separately, unconditionally.

* lib/rawmemchr.c: Don't define rawmemchr if not needed.

4 years agoMake it possible to compile mempcpy.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:42:21 +0000 (12:42 +0100)]
Make it possible to compile mempcpy.c separately, unconditionally.

* lib/mempcpy.c: Don't define mempcpy if not needed.

4 years agoMake it possible to compile free.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:41:33 +0000 (12:41 +0100)]
Make it possible to compile free.c separately, unconditionally.

* m4/free.m4 (gl_FUNC_FREE): Define HAVE_FREE_POSIX.
* lib/free.c: Don't define rpl_free if not needed.

4 years agoMake it possible to compile realloc.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:39:31 +0000 (12:39 +0100)]
Make it possible to compile realloc.c separately, unconditionally.

* modules/realloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/realloc.c: Don't define rpl_realloc if not needed.

4 years agoMake it possible to compile malloc.c separately, unconditionally.
Bruno Haible [Sun, 31 Jan 2021 11:30:18 +0000 (12:30 +0100)]
Make it possible to compile malloc.c separately, unconditionally.

* modules/malloc-posix (configure.ac): Invoke gl_MODULE_INDICATOR.
* lib/malloc.c: Don't define rpl_malloc if not needed.

4 years agocanonicalize-lgpl: Simplify.
Bruno Haible [Sun, 31 Jan 2021 11:35:45 +0000 (12:35 +0100)]
canonicalize-lgpl: Simplify.

* lib/canonicalize-lgpl.c (_GL_USE_STDLIB_ALLOC): Remove macro.

4 years agocanonicalize, canonicalize-lgpl: Straighten dependencies.
Bruno Haible [Sun, 31 Jan 2021 11:29:47 +0000 (12:29 +0100)]
canonicalize, canonicalize-lgpl: Straighten dependencies.

* modules/canonicalize-lgpl (Depends-on): Remove free-posix,
malloc-posix. Add unistd.
* modules/canonicalize (Depends-on): Remove free-posix, xalloc.
Add unistd.

4 years agoscratch_buffer: Fix dependencies.
Bruno Haible [Sat, 30 Jan 2021 15:16:04 +0000 (16:16 +0100)]
scratch_buffer: Fix dependencies.

* modules/scratch_buffer (Depends-on): Add malloc-posix, realloc-posix,
free-posix.

4 years agoautoupdate
Karl Berry [Fri, 29 Jan 2021 16:25:17 +0000 (08:25 -0800)]
autoupdate

4 years agodoc: More precise wording.
Bruno Haible [Tue, 26 Jan 2021 16:36:05 +0000 (17:36 +0100)]
doc: More precise wording.

Reported by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00300.html>.

* doc/relocatable.texi (Enabling Relocatability): Talk about package
management systems in general.

4 years agodoc: Remove obsolete text.
Bruno Haible [Tue, 26 Jan 2021 16:24:09 +0000 (17:24 +0100)]
doc: Remove obsolete text.

Suggested by Reuben Thomas <rrt@sc3d.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00299.html>.

* doc/relocatable.texi (Enabling Relocatability): Stop mentioning an
issue of libtool 1.5.x.

4 years agoautoupdate
Karl Berry [Tue, 26 Jan 2021 15:50:36 +0000 (07:50 -0800)]
autoupdate

4 years agomaintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.
Simon Josefsson [Tue, 26 Jan 2021 15:24:54 +0000 (16:24 +0100)]
maintainer-makefile: Mimic bootstrap's gnulib-srcdir guessing.

* top/maint.mk (gnulib_dir): If $(srcdir)/gnulib doesn't exist,
fall back to $GNULIB_SRCDIR.

4 years agoposix_spawn_file_actions_* tests: Fix module dependencies.
Bruno Haible [Mon, 25 Jan 2021 09:12:51 +0000 (10:12 +0100)]
posix_spawn_file_actions_* tests: Fix module dependencies.

* modules/posix_spawn_file_actions_addclose-tests (Depends-on): Add
posix_spawn_file_actions_destroy.
* modules/posix_spawn_file_actions_addopen-tests (Depends-on): Likewise.
* modules/posix_spawn_file_actions_adddup2-tests (Depends-on): Likewise.
* modules/posix_spawn_file_actions_addchdir-tests (Depends-on):
Likewise.
* modules/posix_spawn_file_actions_addfchdir-tests (Depends-on):
Likewise.

4 years agoposix_spawn_file_actions_addclose: Relax configure test.
Bruno Haible [Mon, 25 Jan 2021 08:59:20 +0000 (09:59 +0100)]
posix_spawn_file_actions_addclose: Relax configure test.

* m4/posix_spawn.m4 (gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE): Test a
negative file descriptor, not an out-of-range file descriptor.
* tests/test-posix_spawn_file_actions_addclose.c (main): Add comment.
* doc/posix-functions/posix_spawn_file_actions_addclose.texi: Update.

4 years agogetaddrinfo: Doc fix.
Simon Josefsson [Mon, 25 Jan 2021 07:51:29 +0000 (08:51 +0100)]
getaddrinfo: Doc fix.

* doc/posix-functions/getaddrinfo.texi (getaddrinfo): Gnulib does
not support IDN.

4 years agogetcwd: Fix cross-compilation guess for musl libc.
Bruno Haible [Sun, 24 Jan 2021 09:12:00 +0000 (10:12 +0100)]
getcwd: Fix cross-compilation guess for musl libc.

* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Guess no also on
musl libc.
* doc/posix-functions/getcwd.texi: Update platform info.

4 years agoexpm1l: Fix configure test result with GCC 10 on powerpc64le.
Bruno Haible [Sun, 24 Jan 2021 08:03:05 +0000 (09:03 +0100)]
expm1l: Fix configure test result with GCC 10 on powerpc64le.

* m4/expm1l.m4 (gl_FUNC_EXPM1L): Change test to avoid GCC optimization.

4 years agoutime: Fix configure test (regression 2020-12-04).
Bruno Haible [Sat, 23 Jan 2021 21:10:25 +0000 (22:10 +0100)]
utime: Fix configure test (regression 2020-12-04).

Reported by Ryan Schmidt <wget@ryandesign.com> via Tim Rühsen in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00282.html>.

* m4/utime.m4 (gl_FUNC_UTIME): In the test program, include <utime.h>,
not <time.h>.

4 years agolibc-config: port to Xcode 7
Paul Eggert [Sat, 23 Jan 2021 18:19:24 +0000 (10:19 -0800)]
libc-config: port to Xcode 7

Problem reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2021-01/msg01089.html
* lib/cdefs.h (__nonnull): If already defined but glibc is not in
use, override the definition with Gnulib’s _GL_ATTRIBUTE_NONNULL.
This is needed for Xcode 7, which has a ‘#define __nonnull
_Nonnull’ builtin for backwards-compatibility with an older Xcode
syntax that GNUish code never uses.

4 years agoexplicit_bzero: Add fallback for other compilers.
Bastien Roucariès [Sat, 23 Jan 2021 13:31:44 +0000 (14:31 +0100)]
explicit_bzero: Add fallback for other compilers.

* lib/explicit_bzero.c (explicit_bzero): For other compilers, invoke
memset through a volatile function pointer.

4 years agoexplicit_bzero: Add support for clang.
Bastien Roucariès [Sat, 23 Jan 2021 11:22:10 +0000 (11:22 +0000)]
explicit_bzero: Add support for clang.

* lib/explicit_bzero.c (explicit_bzero): Add a compiler barrier for
clang.

4 years agoPort FALLTHROUGH to clang 3.4 and earlier
Paul Eggert [Thu, 21 Jan 2021 21:40:16 +0000 (13:40 -0800)]
Port FALLTHROUGH to clang 3.4 and earlier

Problem reported by Akim Demaille in:
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00241.html
* lib/cdefs.h (__glibc_has_attribute):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Do not trust __has_attribute in clang 3.4 and earlier, as
<https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html>
says that __has_attribute is unreliable in these old versions.

4 years agogc-random: Fix link error in tests.
Bruno Haible [Wed, 20 Jan 2021 20:44:36 +0000 (21:44 +0100)]
gc-random: Fix link error in tests.

* modules/crypto/gc-random (Link): New section.
* modules/crypto/gc-tests (Makefile.am): Link test-gc with
$(LIB_GETRANDOM).

4 years agogc-random: Replace implementation with call to getrandom.
Simon Josefsson [Wed, 20 Jan 2021 10:50:21 +0000 (11:50 +0100)]
gc-random: Replace implementation with call to getrandom.

* lib/gc-gnulib.c [GNULIB_GC_RANDOM]: Replace #include's with
those needed for getrandom.
(gc_init): Remove old randomness code.
(gc_done): Likewise.
(randomize): Rewrite using getrandom, inspired by getentropy.
* m4/gc-random.m4: Remove file.
* modules/crypto/gc-random: Drop gc-random.m4, gl_GC_RANDOM, and
LIB_GC_RANDOM.  Add conditional dependency on getrandom.
* modules/crypto/gc-tests (test_gc_LDADD): Drop LIB_GC_RANDOM.

4 years agoexec*e tests: Avoid test failures on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 08:39:55 +0000 (09:39 +0100)]
exec*e tests: Avoid test failures on Cygwin.

* tests/test-execle-main.c (main): On Cygwin, add /bin to the new PATH.
* tests/test-execve-main.c (main): Likewise.
* tests/test-execvpe-main.c (main): Likewise.

4 years agocanonicalize-lgpl: Work around a Cygwin bug.
Bruno Haible [Wed, 20 Jan 2021 08:14:18 +0000 (09:14 +0100)]
canonicalize-lgpl: Work around a Cygwin bug.

* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Test for lstat. Add a
test case that involves a symbolic link to an existing file.
* doc/posix-functions/realpath.texi: Mention the Cygwin bug.

4 years agodoc: Document ptsname_r bug on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 08:08:50 +0000 (09:08 +0100)]
doc: Document ptsname_r bug on Cygwin.

* doc/glibc-functions/ptsname_r.texi: Mention Cygwin bug.

4 years agosethostname tests: Avoid test failure on Cygwin.
Bruno Haible [Wed, 20 Jan 2021 06:40:56 +0000 (07:40 +0100)]
sethostname tests: Avoid test failure on Cygwin.

* tests/test-sethostname2.c (main): Treat errno EACCESS like EPERM.

4 years agofnmatch, regex, fts: FALLTHROUGH consistency
Paul Eggert [Wed, 20 Jan 2021 02:35:30 +0000 (18:35 -0800)]
fnmatch, regex, fts: FALLTHROUGH consistency

Be more consistent about how FALLTHROUGH is defined.
For Gnulib, use attribute.h.  For glibc, use __GNUC__ >= 7.
Problem for glibc reported by Vaseeharan Vinayagamoorthy in:
https://sourceware.org/pipermail/libc-alpha/2021-January/121778.html
* lib/fnmatch.c (FALLTHROUGH) [_LIBC]:
* lib/regex_internal.h (FALLTHROUGH) [_LIBC]:
Don’t worry about Clang, as it’s not needed and provokes GCC.
* lib/fts.c (FALLTHROUGH) [!_LIBC]:
* lib/regex_internal.h (FALLTHROUGH) [!_LIBC]:
Rely on attribute.h for FALLTHROUGH
* modules/regex: Depend on attribute module.

4 years agospawn-pipe: Fix SIGSEGV on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:13 +0000 (01:40 +0900)]
spawn-pipe: Fix SIGSEGV on OS/2 kLIBC.

* lib/spawn-pipe.c [OS/2 kLIBC]: Check directory correctly if it means
a current directory.

4 years agodirent: Fix compilation error in C++ mode on OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 18:23:39 +0000 (19:23 +0100)]
dirent: Fix compilation error in C++ mode on OS/2 kLIBC.

* lib/dirent.in.h (dirfd): Redefine dirfd macro as a rpl function
always.

4 years agozerosize-ptr: Fix compilation on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:11 +0000 (01:40 +0900)]
zerosize-ptr: Fix compilation on OS/2 kLIBC.

* tests/zerosize-ptr.h [OS/2 kLIBC]: Don't use mmap().

4 years agostddef: Fix compilation for max_align_t on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:09 +0000 (01:40 +0900)]
stddef: Fix compilation for max_align_t on OS/2 kLIBC.

* lib/stddef.in.h [OS/2 kLIBC]: Include <cstddef> in C++ mode.

4 years agoyield: Implement for OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 17:44:19 +0000 (18:44 +0100)]
yield: Implement for OS/2 kLIBC.

* modules/yield (Depends-on): Add sched_yield.

4 years agosched_yield: Implement for OS/2 kLIBC.
KO Myung-Hun [Tue, 19 Jan 2021 17:41:09 +0000 (18:41 +0100)]
sched_yield: Implement for OS/2 kLIBC.

* lib/sched_yield.c (sched_yield) [OS/2 kLIBC]: New implementation.

4 years agospawn: Use special invocation for <spawn.h> on OS/2 kLIBC.
KO Myung-Hun [Mon, 18 Jan 2021 16:40:07 +0000 (01:40 +0900)]
spawn: Use special invocation for <spawn.h> on OS/2 kLIBC.

* lib/spawn.in.h: Use special invocation to include <spawn.h> properly
on OS/2 kLIBC.

4 years agonoreturn tests: Avoid test failure on Solaris 10/x86 with cc.
Bruno Haible [Mon, 18 Jan 2021 14:13:17 +0000 (15:13 +0100)]
noreturn tests: Avoid test failure on Solaris 10/x86 with cc.

* tests/test-noreturn.c (main): Return 0.

4 years agoautoupdate
Karl Berry [Mon, 18 Jan 2021 16:51:01 +0000 (08:51 -0800)]
autoupdate

4 years agouninorm tests: Fix compilation error on Cygwin.
Bruno Haible [Mon, 18 Jan 2021 08:10:55 +0000 (09:10 +0100)]
uninorm tests: Fix compilation error on Cygwin.

* tests/uninorm/test-nfc.c (n): Don't define when using a preinstalled
libunistring on Windows.
* tests/uninorm/test-nfd.c (n): Likewise.
* tests/uninorm/test-nfkc.c (n): Likewise.
* tests/uninorm/test-nfkd.c (n): Likewise.

4 years agoimmutable: Implement on native Windows.
Bruno Haible [Sun, 17 Jan 2021 23:32:52 +0000 (00:32 +0100)]
immutable: Implement on native Windows.

* lib/immutable.h (IMMUTABLE_EFFECTIVE): Set to 1 on native Windows.
* lib/immutable.c: Include <windows.h>.
(CreateFileMapping): New macro.
(init_pagesize, init_mmap_file, alloc_pages, free_pages): Add
implementation for native Windows.

4 years agocanonicalize-lgpl tests: Fix link error.
Bruno Haible [Sun, 17 Jan 2021 21:13:25 +0000 (22:13 +0100)]
canonicalize-lgpl tests: Fix link error.

* modules/canonicalize-lgpl-tests (Makefile.am): Link
test-canonicalize-lgpl with $(LIBINTL).

4 years agocanonicalize-lgpl: Work around // handling in realpath() of musl 1.2.2.
Bruno Haible [Sun, 17 Jan 2021 21:07:14 +0000 (22:07 +0100)]
canonicalize-lgpl: Work around // handling in realpath() of musl 1.2.2.

Reported by Natanael Copa <ncopa@alpinelinux.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2021-01/msg00021.html>.

* m4/canonicalize.m4 (gl_FUNC_REALPATH_WORKS): Add a test whether // is
the same as /, on Linux only.
* lib/canonicalize-lgpl.c: Correct indentation of preprocessor
directives.
* doc/posix-functions/realpath.texi: Mention the musl 1.2.2 bug.

4 years agocanonicalize[-lgpl] tests: Add more tests.
Bruno Haible [Sun, 17 Jan 2021 16:22:25 +0000 (17:22 +0100)]
canonicalize[-lgpl] tests: Add more tests.

* tests/test-canonicalize.c (main): Add detailed tests for // handling.
* tests/test-canonicalize-lgpl.c (main): Likewise.

4 years agoargp tests: Avoid test failures on Alpine Linux.
Bruno Haible [Sun, 17 Jan 2021 08:22:11 +0000 (09:22 +0100)]
argp tests: Avoid test failures on Alpine Linux.

* tests/test-argp-2.sh: Use the test framework (init.sh). Use the
'compare' function instead of 'diff -c'.
* tests/test-argp-version-etc-1.sh: Likewise.

4 years agoget-rusage-data tests: Avoid test failure on musl libc.
Bruno Haible [Sun, 17 Jan 2021 08:17:40 +0000 (09:17 +0100)]
get-rusage-data tests: Avoid test failure on musl libc.

* modules/get-rusage-data-tests (Files): Add m4/musl.m4.
(configure.ac): Invoke gl_MUSL_LIBC.
* tests/test-get-rusage-data.c (main): Treat musl libc like glibc.

4 years agoimmutable, get-rusage-data: Fix autoconf warning.
Bruno Haible [Sun, 17 Jan 2021 08:13:20 +0000 (09:13 +0100)]
immutable, get-rusage-data: Fix autoconf warning.

* m4/mmap-anon.m4 (gl_FUNC_MMAP_ANON): Define through AC_DEFUN_ONCE.

4 years agovma-iter: Port to 64-bit Haiku.
Bruno Haible [Sat, 16 Jan 2021 18:14:35 +0000 (19:14 +0100)]
vma-iter: Port to 64-bit Haiku.

* lib/vma-iter.c (vma_iterate): Adapt to changed signature of
get_next_area_info.

4 years agodoc: Update doc about realpath.
Bruno Haible [Fri, 15 Jan 2021 09:22:33 +0000 (10:22 +0100)]
doc: Update doc about realpath.

* doc/posix-functions/realpath.texi: Update info about macOS.

4 years agoverify: simplify static_assert configuration
Paul Eggert [Wed, 13 Jan 2021 23:46:33 +0000 (15:46 -0800)]
verify: simplify static_assert configuration

* lib/verify.h (_GL_HAVE__STATIC_ASSERT, _GL_HAVE__STATIC_ASSERT1):
Do not define for C++.  This should be good enough nowadays,
since recent-enough C++ compilers have static_assert.
(_GL_HAVE_STATIC_ASSERT_CXX11, _GL_HAVE_STATIC_ASSERT_CXX17):
Remove.  All uses replaced by simply checking __cpp_static_assert.

4 years agolib-msvc-compat: Update libtool usage recommendation.
Simon Josefsson [Wed, 13 Jan 2021 13:38:20 +0000 (14:38 +0100)]
lib-msvc-compat: Update libtool usage recommendation.

* doc/ld-output-def.texi (Visual Studio Compatibility): Install
.def files into libdir, not bindir.  Have libfoo-*.def file depend
on libfoo.la to fix parallell builds.

4 years agoverify: Use C++11 static_assert when available.
Bruno Haible [Tue, 12 Jan 2021 20:11:13 +0000 (21:11 +0100)]
verify: Use C++11 static_assert when available.

Reported by Alexandre Duret-Lutz <adl@lrde.epita.fr> in
<https://lists.gnu.org/archive/html/bug-gnulib/2021-01/msg00177.html>.

* lib/verify.h (_GL_HAVE_STATIC_ASSERT_CXX11): New macro.
(_GL_HAVE_STATIC_ASSERT_CXX17): Renamed from _GL_HAVE_STATIC_ASSERT1.
(_GL_VERIFY): Use static_assert when available with C++11 syntax.

4 years agotempname: consume less entropy
Paul Eggert [Tue, 12 Jan 2021 00:46:12 +0000 (16:46 -0800)]
tempname: consume less entropy

Derived from a glibc patch proposed by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2021-January/121302.html
* lib/tempname.c: Include stdbool.h.
(random_bits): New arg use_getrandom.
(try_tempname_len): Skip getrandom on the first try,
unless __GT_NOCREATE.
* modules/tempname (Depends-on): Add stdbool.

4 years agolchmod-tests: Fix link error.
Bruno Haible [Sun, 10 Jan 2021 22:06:39 +0000 (23:06 +0100)]
lchmod-tests: Fix link error.

* modules/lchmod-tests (Makefile.am): Don't assume that LIBINTL is set.

4 years agoCorrect preceeding change.
Simon Josefsson [Sun, 10 Jan 2021 10:28:31 +0000 (11:28 +0100)]
Correct preceeding change.

* top/gitsub.sh: Update link.

4 years agoimmutable: Add tests.
Bruno Haible [Sun, 10 Jan 2021 00:15:01 +0000 (01:15 +0100)]
immutable: Add tests.

* tests/test-immutable.sh: New file.
* tests/test-immutable.c: New file.
* modules/immutable-tests: New file.

4 years agoimmutable: New module.
Bruno Haible [Sun, 10 Jan 2021 00:13:04 +0000 (01:13 +0100)]
immutable: New module.

* lib/immutable.h: New file.
* lib/immutable.c: New file.
* m4/immutable.m4: New file.
* m4/mprotect.m4: New file, based on libffcall/m4/codeexec.m4.
* modules/immutable: New file.

4 years agoUse https:// instead of git://.
Simon Josefsson [Sun, 10 Jan 2021 00:08:38 +0000 (01:08 +0100)]
Use https:// instead of git://.

* build-aux/bootstrap (default_gnulib_url): Ditto.
* config/srclistvars.sh: Ditto.
* doc/gnulib-readme.texi (Git Checkout): Ditto.
* doc/gnulib-tool.texi (VCS Issues): Ditto.
* top/gitsub.sh: Update link.

4 years agosnippet/_Noreturn: port to pedantic clang
Paul Eggert [Sat, 9 Jan 2021 22:17:32 +0000 (14:17 -0800)]
snippet/_Noreturn: port to pedantic clang

Problem reported by Joe Nelson in:
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00152.html
* doc/noreturn.texi: Improve.
* lib/_Noreturn.h (_Noreturn):
* m4/gnulib-common.m4 (gl_COMMON_BODY):
Do not assume _Noreturn works as-is when __STRICT_ANSI__ is
defined, unless __STDC_VERSION__ indicates C11 or later.
* lib/_Noreturn.h (_Noreturn): Fall back on __attribute__
((__noreturn__)) if Clang; this merges the
2020-08-10T23:53:13Zbruno@clisp.org patch to m4/gnulib-common.m4.

4 years agoAllow setting CVS username for gnu-web-doc-update.
Darshit Shah [Sat, 9 Jan 2021 10:42:26 +0000 (11:42 +0100)]
Allow setting CVS username for gnu-web-doc-update.

* build-aux/gnu-web-doc-update: Introduce new option --user to set the
name of the user on Savannah, when it doesn't match $USER.

4 years agoexp* tests: Work around clang 6.0.1 optimization bugs on x86.
Bruno Haible [Sat, 9 Jan 2021 11:47:42 +0000 (12:47 +0100)]
exp* tests: Work around clang 6.0.1 optimization bugs on x86.

* tests/test-exp-ieee.h (test_function): Mark some variable as
'volatile'.
* tests/test-exp2-ieee.h (test_function): Likewise.

4 years agofchmodat: Work around trailing slash bug in fchmodat() on AIX 7.2.
Bruno Haible [Sat, 9 Jan 2021 07:20:17 +0000 (08:20 +0100)]
fchmodat: Work around trailing slash bug in fchmodat() on AIX 7.2.

* m4/fchmodat.m4 (gl_FUNC_FCHMODAT): In the test whether fchmodat works,
also test for the trailing slashes behaviour. Define
HAVE_NEARLY_WORKING_FCHMODAT if this is the only missing feature.
* lib/fchmodat.c (fchmodat): If HAVE_NEARLY_WORKING_FCHMODAT, handle
trailing slashes here.
* modules/fchmodat (Depends-on): Sort by condition, not alphabetically.
* doc/posix-functions/fchmodat.texi: Document the AIX bug.

4 years agofchmod-tests, fchmodat tests, lchmod tests: Add more tests.
Bruno Haible [Sat, 9 Jan 2021 05:11:24 +0000 (06:11 +0100)]
fchmod-tests, fchmodat tests, lchmod tests: Add more tests.

* tests/test-fchmod.c: Include <fcntl.h>.
(BASE): New macro.
(main): Add more tests.
* tests/test-fchmodat.c (main): Add more tests.
* tests/test-lchmod.c (main): Likewise.

4 years agoutimensat: Fix typo in last commit.
Bruno Haible [Sat, 9 Jan 2021 06:45:01 +0000 (07:45 +0100)]
utimensat: Fix typo in last commit.

* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Fix typo in macro explanation.

4 years agotruncate: Document last workaround.
Bruno Haible [Sat, 9 Jan 2021 06:43:37 +0000 (07:43 +0100)]
truncate: Document last workaround.

* doc/posix-functions/truncate.texi: Document the AIX bug.

4 years agodynarray: work even if ‘free’ is replaced
Paul Eggert [Sat, 9 Jan 2021 03:50:16 +0000 (19:50 -0800)]
dynarray: work even if ‘free’ is replaced

Problem reported by Darshit Shah in:
https://lists.gnu.org/r/bug-gnulib/2021-01/msg00140.html
* lib/malloc/dynarray-skeleton.c (DYNARRAY_FREE): New macro.
Use it everywhere instead of DYNARRAY_NAME (free).

4 years agotempname: don’t block for minutes
Paul Eggert [Sat, 9 Jan 2021 01:54:30 +0000 (17:54 -0800)]
tempname: don’t block for minutes

Derived from a patch proposed by Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2021-January/121302.html
* lib/tempname.c (random_bits): Use GRND_NONBLOCK.

4 years agotempname: sync with proposed glibc patch
Paul Eggert [Sat, 9 Jan 2021 01:31:28 +0000 (17:31 -0800)]
tempname: sync with proposed glibc patch

This is from Adhemerval Zanella in:
https://sourceware.org/pipermail/libc-alpha/2021-January/121301.html
* lib/tempname.c (__lxstat64): Remove.
(__lstat64, __stat64): New replacement macros.  All uses changed.

4 years agoregex: stop using alloca
Paul Eggert [Sat, 9 Jan 2021 01:17:32 +0000 (17:17 -0800)]
regex: stop using alloca

* lib/regex_internal.h: Do not include <alloca.h> or define
__libc_use_alloca or alloca.  Patch written by Adhemerval Zanella:
https://sourceware.org/pipermail/libc-alpha/2021-January/121374.html
* modules/regex (Depends-on): Remove alloca-opt.

4 years agoregexec: remove alloca usage in build_trtable
Paul Eggert [Fri, 8 Jan 2021 22:22:15 +0000 (14:22 -0800)]
regexec: remove alloca usage in build_trtable

Prompted by this different change proposed by Adhemerval Zanella:
https://sourceware.org/pipermail/libc-alpha/2021-January/121373.html
* lib/regexec.c (build_trtable): Prevent inlining,
so that it doesn’t bloat the caller’s stack.
Use auto variables instead of alloca/malloc.
After these changes, build_trtable’s total stack allocation is
only 20 KiB on a 64-bit machine, and this is less than glibc’s 64
KiB cutoff so there’s little point to using alloca to shrink it.
Although Gnulib traditionally has used a 4 KiB cutoff, going to 20
KiB here should not be a significant problem in practice;
Gnulib-using packages concerned about overflow of tiny stacks can
compile with something like gcc -fstack-clash-protection.
* config/srclist.txt: Comment out regexec.c for now.

4 years agoscratch_buffer: add scratch_buffer_dupfree macro
Paul Eggert [Fri, 8 Jan 2021 20:01:37 +0000 (12:01 -0800)]
scratch_buffer: add scratch_buffer_dupfree macro

* lib/scratch_buffer.h (__libc_scratch_buffer_dupfree):
New macro, needed to support recent changes in this module.

4 years agoregex: remove alloca usage on regex set_regs
Paul Eggert [Fri, 8 Jan 2021 20:00:09 +0000 (12:00 -0800)]
regex: remove alloca usage on regex set_regs

Derived from this patch by Adhemerval Zanella:
https://sourceware.org/pipermail/libc-alpha/2021-January/121372.html
* lib/regex_internal.h: Include dynarray.h, for Gnulib.
* lib/regexec.c (DYNARRAY_STRUCT, DYNARRAY_ELEMENT)
(DYNARRAY_PREFIX): New macros.
Include malloc/dynarray-skeleton.c.
(set_regs): Use dynarray rather than alloca.
* modules/regex (Depends-on): Add dynarray.

4 years agodynarray: new module
Paul Eggert [Fri, 8 Jan 2021 19:44:19 +0000 (11:44 -0800)]
dynarray: new module

* config/srclist.txt: Mention the new files.
* lib/cdefs.h (__attribute_maybe_unused__): New macro,
like Gnulib’s _GL_ATTRIBUTE_MAYBE_UNUSED but with glibc
naming conventions.
* lib/libc-config.h: Use it instead of __glibc_likely.
* lib/dynarray.h, modules/dynarray: New files.
* lib/malloc/dynarray-skeleton.c, lib/malloc/dynarray.h:
* lib/malloc/dynarray_at_failure.c:
* lib/malloc/dynarray_emplace_enlarge.c:
* lib/malloc/dynarray_finalize.c, lib/malloc/dynarray_resize.c:
* lib/malloc/dynarray_resize_clear.c, modules/dynarray:
New files, from glibc with the following changes needed for
portability to compilers that are not recent-enough GCC.
* lib/malloc/dynarray_at_failure.c: Include stdlib.h, for abort.
(__libc_dynarray_at_failure) [!_LIBC]: Simply abort.
* lib/malloc/dynarray_emplace_enlarge.c:
* lib/malloc/dynarray_resize.c:
Include intprops.h, and use INT_MULTIPLY_WRAPV instead
of __builtin_mul_overflow.
* lib/malloc/dynarray.h (__libc_dynarray_at_failure):
Use _Noreturn instead of __attribute__ ((noreturn)).
* lib/malloc/dynarray_resize_clear.c: Do not include stdlib.h;
it’s not needed.
(__libc_dynarray_resize_clear): Do not do arithmetic on void *.
* lib/malloc/dynarray-skeleton.c (struct DYNARRAY_STRUCT):
Do not use anonymous unions, as they are not in C99. All uses changed.
Use __nonnull (X) instead of __attribute__ ((nonnull X)),
and __attribute_maybe_unused__ instead of __attribute__ ((unused)).

4 years agobootstrap: Fix parsing of package name.
Simon Josefsson [Fri, 8 Jan 2021 10:49:59 +0000 (11:49 +0100)]
bootstrap: Fix parsing of package name.

* build-aux/bootstrap (package): Attempt to use autoconf --trace
to parse AC_INIT before falling back to sed expression.

4 years agolocalename: Fix link error with duplocale on AIX 7.2 (regr. 2019-12-18).
Bruno Haible [Thu, 7 Jan 2021 21:55:41 +0000 (22:55 +0100)]
localename: Fix link error with duplocale on AIX 7.2 (regr. 2019-12-18).

* m4/locale_h.m4 (gl_LOCALE_H_DEFAULTS): Initialize
LOCALENAME_ENHANCE_LOCALE_FUNCS.
* m4/intl-thread-locale.m4 (gt_FUNC_USELOCALE):
Set gt_working_uselocale.
(gt_INTL_THREAD_LOCALE_NAME): Set gt_fake_locales, gt_good_uselocale,
gt_localename_enhances_locale_funcs, LOCALENAME_ENHANCE_LOCALE_FUNCS.
Define HAVE_GOOD_USELOCALE, LOCALENAME_ENHANCE_LOCALE_FUNCS.
* m4/localename.m4 (gl_LOCALENAME): Test
gt_localename_enhances_locale_funcs instead of gt_nameless_locales.
* modules/locale (Makefile.am): Substitute
LOCALENAME_ENHANCE_LOCALE_FUNCS.
* lib/locale.in.h (newlocale, duplocale, freelocale): Don't override if
module 'localename' is in use but LOCALENAME_ENHANCE_LOCALE_FUNCS is 0.
* lib/localename.c (HAVE_GOOD_USELOCALE): Don't define here.
(get_locale_t_name, newlocale, duplocale, freelocale): Define if
LOCALENAME_ENHANCE_LOCALE_FUNCS.

4 years agoautoupdate
Karl Berry [Thu, 7 Jan 2021 15:53:54 +0000 (07:53 -0800)]
autoupdate

4 years agologb: Fix test failure on glibc/powerpc.
Bruno Haible [Wed, 6 Jan 2021 19:46:52 +0000 (20:46 +0100)]
logb: Fix test failure on glibc/powerpc.

* m4/logb.m4 (gl_FUNC_LOGB_WORKS): Fix typo in comment.

4 years agologb: Fix test failure on glibc/powerpc.
Bruno Haible [Wed, 6 Jan 2021 18:59:10 +0000 (19:59 +0100)]
logb: Fix test failure on glibc/powerpc.

* doc/posix-functions/logb.texi: Update platform info.
* m4/logb.m4 (gl_FUNC_LOGB_WORKS): Test against bug with negative
subnormal numbers.

4 years agolibc-config: simplify clang __has_* macros
Paul Eggert [Wed, 6 Jan 2021 18:02:33 +0000 (10:02 -0800)]
libc-config: simplify clang __has_* macros

cdefs.h sometimes used names like __glibc_clang_has_attribute and
sometimes __glibc_has_attribute.  There is no need in glibc or
Gnulib to distinguish clang from other compilers here, so be
consistent and use the simpler names.
* lib/cdefs.h (__glibc_has_builtin, __glibc_has_extension):
Rename from __glibc_clang_has_builtin, __glibc_clang_has_extension.
All uses changed.
(__glibc_clang_has_attribute): Remove. All uses replaced
by __glibc_has_attribute.
* lib/libc-config.h [!__glibc_likely]: Undef them here too.
This fixes a problem where __glibc_has_attribute was not undeffed.

4 years agoflock: Update documentation.
Bruno Haible [Wed, 6 Jan 2021 11:15:33 +0000 (12:15 +0100)]
flock: Update documentation.

* doc/glibc-functions/flock.texi: Document what to expect on AIX and
Solaris.

4 years agoilogbl: Fix compilation error with xlclang on AIX 7.2.
Bruno Haible [Wed, 6 Jan 2021 10:59:57 +0000 (11:59 +0100)]
ilogbl: Fix compilation error with xlclang on AIX 7.2.

* lib/math.in.h (ilogbl): Undefine macro before declaration.

4 years agoilogbl: Fix test failures on AIX 7.1 in 64-bit mode.
Bruno Haible [Wed, 6 Jan 2021 10:06:55 +0000 (11:06 +0100)]
ilogbl: Fix test failures on AIX 7.1 in 64-bit mode.

* m4/ilogbl.m4 (gl_FUNC_ILOGBL_WORKS): Test also some denormalized
argument.
* doc/posix-functions/ilogbl.texi: Mention the AIX bug.

4 years agoilogb: Fix test failures on AIX 7.1 in 64-bit mode.
Bruno Haible [Wed, 6 Jan 2021 10:06:25 +0000 (11:06 +0100)]
ilogb: Fix test failures on AIX 7.1 in 64-bit mode.

* m4/ilogb.m4 (gl_FUNC_ILOGB_WORKS): Test also some denormalized
argument.
* doc/posix-functions/ilogb.texi: Mention the AIX bug.

4 years agofclose: Fix test failure on AIX 7.2.
Bruno Haible [Wed, 6 Jan 2021 07:47:04 +0000 (08:47 +0100)]
fclose: Fix test failure on AIX 7.2.

* m4/fclose.m4 (gl_FUNC_FCLOSE_STDIN): New macro.
(gl_FUNC_FCLOSE): Invoke it. Set REPLACE_FCLOSE accordingly.
* doc/posix-functions/fclose.texi: Update platform information.
* doc/posix-functions/fflush.texi: Likewise.

4 years agopipe-filter-gi: Fix test failure on AIX 7.2.
Bruno Haible [Wed, 6 Jan 2021 06:23:14 +0000 (07:23 +0100)]
pipe-filter-gi: Fix test failure on AIX 7.2.

* lib/pipe-filter-aux.h (SSIZE_MAX) [AIX]: Set to 4096.

4 years agoutimens, utimensat, fdutimensat: Avoid test failures on AIX 7.2.
Bruno Haible [Wed, 6 Jan 2021 05:16:22 +0000 (06:16 +0100)]
utimens, utimensat, fdutimensat: Avoid test failures on AIX 7.2.

* lib/utimecmp.c (utimecmpat): On AIX, declare equality when the two
times differ by less than 0.01 seconds.
* tests/test-futimens.h (test_futimens): Pass UTIMECMP_TRUNCATE_SOURCE
flag.

4 years agoutimensat: Work around trailing slash bug in utimensat() on AIX 7.2.
Bruno Haible [Wed, 6 Jan 2021 01:08:41 +0000 (02:08 +0100)]
utimensat: Work around trailing slash bug in utimensat() on AIX 7.2.

* m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Require AC_CANONICAL_HOST. Add a
test for trailing slash handling. Improve cross-compilation guesses.
Conditionally define HAVE_NEARLY_WORKING_UTIMENSAT.
* lib/utimensat.c (rpl_utimensat): Add alternative implementation when
HAVE_NEARLY_WORKING_UTIMENSAT is defined.
* lib/utimens.c: Use the overridden utimensat when
HAVE_NEARLY_WORKING_UTIMENSAT is defined.
* doc/posix-functions/utimensat.texi: Mention the AIX bug.

4 years agoptsname_r, ptsname: Avoid test failures on AIX 7.2.
Bruno Haible [Tue, 5 Jan 2021 21:39:48 +0000 (22:39 +0100)]
ptsname_r, ptsname: Avoid test failures on AIX 7.2.

* tests/test-ptsname_r.c (main): On AIX, set a 20-seconds timer.
* tests/test-ptsname.c (main): Likewise. On AIX, open a pty through
/dev/ptc and don't test the BSD ptys.

4 years ago* modules/filename, modules/idx (Maintainer): Add glibc.
Paul Eggert [Tue, 5 Jan 2021 21:34:48 +0000 (13:34 -0800)]
* modules/filename, modules/idx (Maintainer): Add glibc.

4 years agolibc-config: merge from glibc
Paul Eggert [Tue, 5 Jan 2021 21:12:39 +0000 (13:12 -0800)]
libc-config: merge from glibc

Use a better way of keeping glibc <sys/cdefs.h> and gnulib
lib/cdefs.h mostly in sync, by using lib/cdefs.h only on platforms
where <sys/cdefs.h> does not work well enough for Gnulib.
* lib/cdefs.h: Go back to using _SYS_CDEFS_H rather than
_GL_DEFS_H as an include guard.
(__THROW, __THROWNL, __NTH, __NTHNL):
Define to noexcept for C++11 and later.
(__glibc_objsize, __glibc_objsize0): New, for _FORTIFY_SOURCE=3.
(__warndecl): Remove.
(__attribute_copy__): New macro, for GCC 9 support.
(__LDBL_REDIR, __LDBL_REDIR_DECL, __LDBL_REDIR1)
(__LDBL_REDIR1_DECL, __LDBL_REDIR1_NTH, __REDIRECT_NTH_LDBL)
(__REDIRECT_LDBL, __LDBL_REDIR_NTH):
Redirections for IEEE long double on powerpc64le.
(__LDBL_REDIR2_DECL): New macro.
(__attr_access): New macro, for GCC 10 bounds checking.
(__attribute_returns_twice__): New macro, for setjmp etc.
* lib/libc-config.h: Include <cdefs.h> only if __glibc_likely is
undefined.  The following changes apply only if __glibc_likely
is not defined.
(__LDBL_REDIR2_DECL, __attr_access, __attribute_returns_twice__)
(__glibc_clang_has_attribute, __glibc_clang_has_extension)
(__glibc_objsize, __glibc_objsize0):
Undef these new (or newer) <cdefs.h> macros.
(__P, __PMT, __always_inline): Do not undef, since cdefs.h does that.
(__glibc_likely): Do not undef, since this is inside
ifndef __glibc_likely.
(__warndecl): Do not undef; no longer defined.

4 years agomaintainer-makefile: correct preceding change
Jim Meyering [Tue, 5 Jan 2021 20:43:41 +0000 (12:43 -0800)]
maintainer-makefile: correct preceding change

* top/maint.mk (syntax-check-rules): Use LC_ALL=C, not LANG=C.

4 years agomaint: note syncs to glibc
Paul Eggert [Tue, 5 Jan 2021 20:03:00 +0000 (12:03 -0800)]
maint: note syncs to glibc

* config/srclist.txt: filename.h, idx.h, scratch_buffer.h and
scratch_buffer_dupfree.c are now identical to glibc.  Add
commentary about some other syncs we’d like.

4 years agoautoupdate
Karl Berry [Tue, 5 Jan 2021 15:49:07 +0000 (07:49 -0800)]
autoupdate

4 years agotruncate: Work around trailing slash bug in truncate() on AIX 7.2.
Bruno Haible [Tue, 5 Jan 2021 06:55:01 +0000 (07:55 +0100)]
truncate: Work around trailing slash bug in truncate() on AIX 7.2.

* m4/truncate.m4 (gl_FUNC_TRUNCATE): Add a test whether truncate
rejects trailing slashes. Set REPLACE_TRUNCATE and define
TRUNCATE_TRAILING_SLASH_BUG if not.
* lib/truncate.c (orig_truncate): New function.
(truncate): Add alternative implementation when
TRUNCATE_TRAILING_SLASH_BUG is defined.
* modules/truncate (Depends-on): Add sys_stat, stat.

4 years agomkfifoat: Fix cross-compilation guess (regression from 2021-01-04).
Bruno Haible [Tue, 5 Jan 2021 06:31:37 +0000 (07:31 +0100)]
mkfifoat: Fix cross-compilation guess (regression from 2021-01-04).

* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Fix copy-and-paste mistake.

4 years agoffsll: Override completely broken implementation on AIX in 32-bit mode.
Bruno Haible [Tue, 5 Jan 2021 06:15:09 +0000 (07:15 +0100)]
ffsll: Override completely broken implementation on AIX in 32-bit mode.

* m4/ffsll.m4 (gl_FUNC_FFSLL): Test whether ffsll minimally works. If
not, set REPLACE_FFSLL.
* lib/string.in.h (ffsll): Consider REPLACE_FFSLL.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Initialize
REPLACE_FFSLL.
* modules/string (Makefile.am): Substitute REPLACE_FFSLL.
* modules/ffsll (Depends-on, configure.ac): Consider REPLACE_FFSLL.
* doc/glibc-functions/ffsll.texi: Mention the AIX 7.2 bug.