]> git.ipfire.org Git - thirdparty/gnulib.git/log
thirdparty/gnulib.git
4 months agounistr/base: Add tests.
Bruno Haible [Fri, 3 Oct 2025 19:50:29 +0000 (21:50 +0200)] 
unistr/base: Add tests.

* tests/unistr/test-unistr-h.c: New file.
* modules/unistr/base-tests: New file.
* tests/unistr/test-unistr-h-c++.cc: New file.
* modules/unistr/base-c++-tests: New file.

4 months agounistr, unigbrk: Fix compilation error in C++ mode (regr. 2025-02-09).
Bruno Haible [Fri, 3 Oct 2025 19:50:13 +0000 (21:50 +0200)] 
unistr, unigbrk: Fix compilation error in C++ mode (regr. 2025-02-09).

Reported by Ryan Carsten Schmidt <gnulib@ryandesign.com>
at <https://savannah.gnu.org/bugs/?67576>.

* lib/unistr.in.h (u*_check, u*_chr, u*_next, u*_prev, u*_strchr,
u*_strrchr, u*_strpbrk, u*_strstr): Define C++ templates outside of
'extern "C"' block.
* lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.

4 months agoautoupdate
Karl Berry [Wed, 1 Oct 2025 15:07:41 +0000 (08:07 -0700)] 
autoupdate

4 months agoxsetenv: Revert the previous change.
Collin Funk [Sun, 28 Sep 2025 20:30:15 +0000 (13:30 -0700)] 
xsetenv: Revert the previous change.

* modules/xsetenv (Description): Restore the description of unsetenv.

4 months agoxsetenv: Remove unnecessary text from module description.
Collin Funk [Sun, 28 Sep 2025 18:51:48 +0000 (11:51 -0700)] 
xsetenv: Remove unnecessary text from module description.

* modules/xsetenv (Description): Remove mention of the unsetenv function
which is not provided by this module.

4 months agoautoupdate
Karl Berry [Thu, 25 Sep 2025 14:44:28 +0000 (07:44 -0700)] 
autoupdate

4 months agoUpdate to Unicode 17.0.0.
Bruno Haible [Wed, 24 Sep 2025 21:28:18 +0000 (23:28 +0200)] 
Update to Unicode 17.0.0.

* lib/gen-uni-tables.c (is_property_alphabetic): Add three
YANGQIN SIGNs.
(UC_JOINING_GROUP_THIN_NOON): New enum item.
(fill_arabicshaping, joining_group_as_c_identifier): Handle
UC_JOINING_GROUP_THIN_NOON.
(LBP_*): Split LBP_SA into LBP_SA1 and LBP_SA2.
(LBP_HH, LBP_SA): New enum items.
(get_lbp): Use them. Update such that unilbrk/lbrkprop.txt comes out as
expected.
(debug_output_lbp): Handle LBP_HH. Print either LBP_SA1, LBP_SA2 as
LBP_SA.
(fill_org_lbp, debug_output_org_lbp): Handle LBP_HH.
(lbp_value_to_string): Handle LBP_HH. Handle LBP_SA1, LBP_SA2 instead of
LBP_SA.
(output_lbrk_rules_as_tables): Update for LBP_HH change. Update rules
LBP12a, LB21 as specified by
https://www.unicode.org/reports/tr14/tr14-55.html.
(get_wbp): Update such that uniwbrk/wbrkprop.txt comes out as expected.

* lib/unictype.in.h (UC_JOINING_GROUP_THIN_NOON): New enum item.
* lib/unictype/joininggroup_byname.gperf: Handle it.
* lib/unictype/joininggroup_name.h: Likewise.

* lib/unilbrk/lbrktables.h (LBP_*): Split LBP_SA into LBP_SA1 and
LBP_SA2.
(LBP_HH): New enum item.
(unilbrk_table): Update bounds.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Use LBP_HL_HY instead of LBP_HL_BA. Use LBP_SA1 instead of LBP_SA. Treat
LBP_SA2 like LBP_CM. Update rules LB20a and LB21a, as specified by
https://www.unicode.org/reports/tr14/tr14-55.html.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.

* tests/unigbrk/test-u8-grapheme-breaks.c (main): Use U+2B50 instead of
U+2605, because U+2605 no longer is an Extended_Pictographic character.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u8-grapheme-next.c (main): Likewise.
* tests/unigbrk/test-u16-grapheme-next.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-next.c (main): Likewise.
* tests/unigbrk/test-u8-grapheme-prev.c (main): Likewise.
* tests/unigbrk/test-u16-grapheme-prev.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-prev.c (main): Likewise.

* tests/uniwidth/test-uc_width2.sh: Update expected test result.

* All generated files under lib/uni* and tests/uni*: Regenerate.
* tests/uniname/NameAliases.txt: Update.
* tests/uniname/UnicodeData.txt: Update.
* tests/uninorm/NormalizationTest.txt: Update.
* tests/unigbrk/GraphemeBreakTest.txt: Update.
* tests/uniwbrk/WordBreakTest.txt: Update.
* tests/unilbrk/LineBreakTest.txt: Update.

* All the affected modules: Bump required libunistring version.

4 months agounilbrk: Fix handling of future emojis in rule LB30b.
Bruno Haible [Wed, 24 Sep 2025 21:28:14 +0000 (23:28 +0200)] 
unilbrk: Fix handling of future emojis in rule LB30b.

* lib/unilbrk/lbrktables.h (LBP_ID): Renamed from LBP_ID1.
(LBP_EBF): Renamed from LBP_ID2.
* lib/gen-uni-tables.c (LBP_ID): Renamed from LBP_ID1.
(LBP_EBF): Renamed from LBP_ID2.
(get_lbp): Update. Move is_property_extended_pictographic invocation.
(debug_output_org_lbp): Augment the information from the LineBreak.txt
file with the Extended_Pictographic property. Print the LBP_ID and
LBP_EBF values distinctly.
(fill_org_lbp): Assign value LBP_EBF to all unassigned
Extended_Pictographic characters.
(debug_output_org_lbp): Handle LBP_EBF.
(lbp_value_to_string): Update.
(output_lbrk_rules_as_tables): Treat LBP_EBF like LBP_EB instead of like
LBP_ID.
* lib/unilbrk/u8-possible-linebreaks.c (u8_possible_linebreaks_loop):
Update.
* lib/unilbrk/u16-possible-linebreaks.c (u16_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/u32-possible-linebreaks.c (u32_possible_linebreaks_loop):
Likewise.
* lib/unilbrk/lbrkprop2.h: Regenerated.
* lib/unilbrk/lbrktables.c: Regenerated.
* tests/unilbrk/test-uc-possible-linebreaks.c (main): Skip test cases
that contain the U+1F8FF character.
* modules/unilbrk/*-linebreaks: Bump required libunistring version.

4 months agoautoupdate
Karl Berry [Wed, 24 Sep 2025 15:25:57 +0000 (08:25 -0700)] 
autoupdate

4 months agogen-uni-tables: Fix compilation error (regression 2025-09-17).
Bruno Haible [Tue, 23 Sep 2025 19:44:46 +0000 (21:44 +0200)] 
gen-uni-tables: Fix compilation error (regression 2025-09-17).

* lib/gen-uni-tables.c (streq, memeq): Move definitions before their
first use.

4 months agoClarify link dependency towards libgcrypt or OpenSSL's libcrypto.
Bruno Haible [Tue, 23 Sep 2025 08:22:38 +0000 (10:22 +0200)] 
Clarify link dependency towards libgcrypt or OpenSSL's libcrypto.

* modules/crypto/gc-arcfour (Link): New section.
* modules/crypto/gc-arctwo (Link): Likewise.
* modules/crypto/gc-camellia (Link): Likewise.
* modules/crypto/gc-des (Link): Likewise.
* modules/crypto/gc-hmac-md5 (Link): Likewise.
* modules/crypto/gc-hmac-sha1 (Link): Likewise.
* modules/crypto/gc-hmac-sha256 (Link): Likewise.
* modules/crypto/gc-hmac-sha512 (Link): Likewise.
* modules/crypto/gc-md2 (Link): Likewise.
* modules/crypto/gc-md4 (Link): Likewise.
* modules/crypto/gc-md5 (Link): Likewise.
* modules/crypto/gc-pbkdf2 (Link): Likewise.
* modules/crypto/gc-pbkdf2-sha1 (Link): Likewise.
* modules/crypto/gc-rijndael (Link): Likewise.
* modules/crypto/gc-sha1 (Link): Likewise.
* modules/crypto/gc-sha256 (Link): Likewise.
* modules/crypto/gc-sha512 (Link): Likewise.
* modules/crypto/gc-sm3 (Link): Likewise.
* modules/crypto/gc-random (Link): Add $(LIB_CRYPTO).

4 months agocrypto/gc-arctwo-tests: Fix link error when OpenSSL is enabled.
Collin Funk [Tue, 23 Sep 2025 04:27:13 +0000 (21:27 -0700)] 
crypto/gc-arctwo-tests: Fix link error when OpenSSL is enabled.

* modules/crypto/gc (Link): Add $(LIB_CRYPTO).
* modules/crypto/gc-arctwo-tests (Makefile.am): Link the test program to
@LIB_CRYPTO@.

4 months agofchownat: Revert my earlier change today entirely.
Bruno Haible [Tue, 23 Sep 2025 00:21:58 +0000 (02:21 +0200)] 
fchownat: Revert my earlier change today entirely.

* doc/posix-functions/fchownat.texi: Revert last change.

4 months agofchownat: improve on test failure fix
Paul Eggert [Mon, 22 Sep 2025 23:41:41 +0000 (16:41 -0700)] 
fchownat: improve on test failure fix

* lib/fchownat.c (rpl_fchownat):
Clear the flag only if the trailing slash check needs to be made.
Do this before checking for the nofollow bug, to
avoid the need for the fork+chdir+lchown dance in that case.
Move the empty-filename check earlier, so that its file[0] check
can more easily be combined with the trailing slash check.
* m4/chown.m4, m4/fchownat.m4, modules/fchownat:
Revert most recent change.

4 months agofchownat: Fix test failure on OpenBSD and Cygwin 2.9 (regr. 2025-09-20).
Bruno Haible [Mon, 22 Sep 2025 11:44:06 +0000 (13:44 +0200)] 
fchownat: Fix test failure on OpenBSD and Cygwin 2.9 (regr. 2025-09-20).

* doc/posix-functions/fchownat.texi: Document that the dereferencing bug
also affects OpenBSD and Cygwin 2.9.
* m4/chown.m4 (gl_FUNC_CHOWN_CTIME): New macro, extracted from
gl_FUNC_CHOWN.
(gl_FUNC_CHOWN): Invoke it.
* m4/fchownat.m4 (gl_FUNC_FCHOWNAT_DEREF_BUG): Guess that a platform
that has the chown ctime bug also has the fchownat AT_SYMLINK_NOFOLLOW
bug.
* modules/fchownat (Files): Add m4/chown.m4.

4 months agofchownat: fix recently introduced flag typo
Paul Eggert [Mon, 22 Sep 2025 01:56:18 +0000 (18:56 -0700)] 
fchownat: fix recently introduced flag typo

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00282.html
* lib/fchownat.c (rpl_fchownat): Fix typo by passing
our flag to fstatat.

4 months agopthread-once: Improve configuration.
Bruno Haible [Sun, 21 Sep 2025 22:00:40 +0000 (00:00 +0200)] 
pthread-once: Improve configuration.

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): Use a configure test to
determine whether linking with $(LIBPMULTITHREAD) is necessary.

4 months agotests: avoid grep in init.sh
Paul Eggert [Sun, 21 Sep 2025 20:49:18 +0000 (13:49 -0700)] 
tests: avoid grep in init.sh

* tests/init.sh (warn_, gl_shell_test_script_):
Avoid the use of grep, as that introduces an unwanted dependency.
On older systems like Solaris there can be many greps and they
can be buggy, so it’s better to not rely on them in a central
part of the test harness.

4 months agotests: avoid test failure due to rmdir race
Paul Eggert [Sun, 21 Sep 2025 20:43:01 +0000 (13:43 -0700)] 
tests: avoid test failure due to rmdir race

* tests/init.sh (remove_tmp_): If the rm -rf fails, wait a second
and try again.  This works around a problem I observed on Solaris
10 on a circa 2001 Sun Fire 280R with a single 750 MHz UltraSPARC
III, where a subprocess had not yet exited by the time the test
script attempted to remove the subprocess’s working directory.
This can happen, for example, if the process A in the shell
command ‘A | B’ closes stdout, checks that the close succeeded
-- a necessary check if stdout is NFS, on Solaris anyway --
and uses that check to affect its exit status.
In this situation, B can read end-of-file from its standard input
and exit before A exits, and then the shell, which waits only for B,
can then attempt to remove A’s working directory during cleanup.
This is not a problem on GNU/Linux where one can remove a
process’s working directory, but it is a problem on Solaris 10
which does not allow this.  POSIX allows the Solaris 10 behavior.

4 months agodoc: Update for Android API level 37.
Bruno Haible [Sun, 21 Sep 2025 19:30:58 +0000 (21:30 +0200)] 
doc: Update for Android API level 37.

* doc/glibc-functions/sched_getattr.texi: Document that the function is
missing on Android API level <= 36.
* doc/glibc-functions/sched_setattr.texi: Likewise.

4 months agodoc: Update for Android API level 36.
Bruno Haible [Sun, 21 Sep 2025 19:28:33 +0000 (21:28 +0200)] 
doc: Update for Android API level 36.

* doc/glibc-functions/pthread_getaffinity_np.texi: Document that the
function is missing on Android API level <= 35.
* doc/glibc-functions/pthread_setaffinity_np.texi: Likewise.

4 months agochown, lchown: Fix regression on Cygwin 2.9.0 (regression today).
Bruno Haible [Sun, 21 Sep 2025 18:59:20 +0000 (20:59 +0200)] 
chown, lchown: Fix regression on Cygwin 2.9.0 (regression today).

* m4/chown.m4 (AC_FUNC_CHOWN): Restore the previous configure-time test
on OpenBSD and Cygwin platforms.
* doc/posix-functions/chown.texi: Update platforms list.

4 months agolchown: Fix compilation error on macOS (regression today).
Bruno Haible [Sun, 21 Sep 2025 18:40:43 +0000 (20:40 +0200)] 
lchown: Fix compilation error on macOS (regression today).

* lib/lchown.c: Include stat-time.h.

4 months agochown: simplify CHOWN_CHANGE_TIME_BUG checking
Paul Eggert [Sun, 21 Sep 2025 16:28:00 +0000 (09:28 -0700)] 
chown: simplify CHOWN_CHANGE_TIME_BUG checking

* m4/chown.m4 (AC_FUNC_CHOWN): Just use $host_os when checking for
CHOWN_CHANGE_TIME_BUG.  This should be good enough for currently
supported Gnulib targets.

4 months agofchownat: fix security races and other bugs
Paul Eggert [Sun, 21 Sep 2025 14:55:00 +0000 (07:55 -0700)] 
fchownat: fix security races and other bugs

This fixes some unlikely security races,
where our “no-op” chmod undid some other process’s chmod.
Ironically this bug occurred on OpenBSD, our most paranoid target.
This patch also fixes some EOVERFLOW bugs,
along with a performance bug and a CHOWN_CHANGE_TIME_BUG with fchownat.
* lib/chown.c, lib/fchownat.c, lib/lchown.c:
Remove unnecessary inconsistencies.
Include stat-time.h.
(CHOWN_CHANGE_TIME_BUG, CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE)
(CHOWN_MODIFIES_SYMLINK, CHOWN_TRAILING_SLASH_BUG):
Default to 0, and prefer ‘if (...)’ to ‘#ifdef ...’.
(utimensat) [!HAVE_UTIMENSAT]: Default to a no-op.
(rpl_chown, rpl_fchownat, rpl_lchown):
Prefer ‘if (...)’ to ‘#ifdef ...’.
Statically, call the stat-like and chown-like functions just once.
Do not fail if the stat-like function fails with EOVERFLOW,
if existence is all we care about.
Use utimensat to update ctime, instead of a chmod-like function.
* lib/fchownat.c (rpl_fchownat): Defend against OpenBSD’s
CHOWN_CHANGE_TIME_BUG.  This bug in rpl_fchownat was exposed by
yesterday’s fix that caused rpl_fchownat to call fchownat instead
of using the tricky old fork/chdir business.
* m4/chown.m4 (gl_FUNC_CHOWN):
Check for utimensat if the ctime bug is present.
* modules/chown, modules/lchown, modules/fchownat:
(Depends-on): Add stat-time.

4 months agopthread-once: Fix link error on glibc < 2.34 systems (regr. yesterday).
Bruno Haible [Sun, 21 Sep 2025 06:24:38 +0000 (08:24 +0200)] 
pthread-once: Fix link error on glibc < 2.34 systems (regr. yesterday).

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): Use $LIBPMULTITHREAD also on
glibc systems.

4 months agosig2str: Port to Android API level 36.
Collin Funk [Sun, 21 Sep 2025 05:45:29 +0000 (22:45 -0700)] 
sig2str: Port to Android API level 36.

* m4/sig2str.m4 (gl_FUNC_SIG2STR): Use gl_CHECK_FUNCS_ANDROID to check
for sig2str and str2sig instead of AC_CHECK_FUNCS.
* doc/posix-functions/sig2str.texi: Document that the function is
missing on Android API 35 and lower.
* doc/posix-functions/str2sig.texi: Likewise.

4 months agoqsort_r: Port to Android API level 36.
Collin Funk [Sun, 21 Sep 2025 05:41:16 +0000 (22:41 -0700)] 
qsort_r: Port to Android API level 36.

* m4/qsort_r.m4 (gl_FUNC_QSORT_R): Use gl_CHECK_FUNCS_ANDROID to check
for qsort_r instead of AC_CHECK_FUNCS_ONCE.
* doc/glibc-functions/qsort_r.texi: Document that the function is
missing on Android API 35 and lower.

4 months agolchmod: Port to Android API level 36.
Collin Funk [Sun, 21 Sep 2025 05:36:22 +0000 (22:36 -0700)] 
lchmod: Port to Android API level 36.

* m4/lchmod.m4 (gl_FUNC_LCHMOD): Use gl_CHECK_FUNCS_ANDROID to check for
lchmod instead of AC_CHECK_FUNCS_ONCE.
* m4/lchown.m4 (gl_FUNC_LCHOWN): Likewise.
* doc/glibc-functions/lchmod.texi (lchmod): Document that the function
is missing on Android API 35 and lower.

4 months agopthread-once: Reduce link dependencies.
Bruno Haible [Sun, 21 Sep 2025 00:11:03 +0000 (02:11 +0200)] 
pthread-once: Reduce link dependencies.

Linking with -lpthread is not needed on musl libc, macOS, NetBSD,
Solaris, Cygwin, Haiku, Android.

Reported by Michael Osipov <michael.osipov@innomotics.com> and
Tijl Coosemans <tijl@FreeBSD.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00019.html>.

* m4/pthread-once.m4 (gl_PTHREAD_ONCE): Require gl_PTHREADLIB. Set
PTHREAD_ONCE_LIB.
* modules/pthread-once (Link): Link with $(PTHREAD_ONCE_LIB) instead of
$(LIBPMULTITHREAD).
* modules/pthread-once-tests (Makefile.am): Update accordingly.

4 months agonl_langinfo: Work around nl_langinfo multithread-safety bug on macOS 26.
Bruno Haible [Sat, 20 Sep 2025 13:49:50 +0000 (15:49 +0200)] 
nl_langinfo: Work around nl_langinfo multithread-safety bug on macOS 26.

* m4/nl_langinfo.m4 (gl_FUNC_NL_LANGINFO): Set NL_LANGINFO_MTSAFE to 0
on macOS.
* lib/nl_langinfo.c (ITEMS): Define appropriately on macOS.
* doc/posix-functions/nl_langinfo.texi: Document the macOS bug.

4 months agofchownat: fix unlikely EOVERFLOW bug
Paul Eggert [Sat, 20 Sep 2025 07:31:08 +0000 (00:31 -0700)] 
fchownat: fix unlikely EOVERFLOW bug

* lib/fchownat.c (rpl_fchownat) [CHOWN_TRAILING_SLASH_BUG]:
Do the right thing if fstatat fails with EOVERFLOW.
This matters only on obsolete platforms like Solaris 9,
but it’s easy to do it right.  Simplify neighboring code.

4 months agofchownat: fix missing HAVE_FCHOWNAT
Paul Eggert [Sat, 20 Sep 2025 07:25:52 +0000 (00:25 -0700)] 
fchownat: fix missing HAVE_FCHOWNAT

* m4/fchownat.m4 (gl_FUNC_FCHOWNAT): Use AC_CHECK_FUNCS instead of
AC_CHECK_FUNC, so that we define HAVE_FCHOWNAT if fchownat
exists. lib/fchownat.c uses HAVE_FCHOWNAT in some cases.

4 months agofchownat: depend on fstatat
Paul Eggert [Sat, 20 Sep 2025 06:53:47 +0000 (23:53 -0700)] 
fchownat: depend on fstatat

* modules/fchownat (Depends-on): Add fstatat.
This fixes a dependency bug I introduced on 2022-03-09
when I made the statat module obsolute.

4 months agostringeq: Fix use in C++ mode.
Bruno Haible [Fri, 19 Sep 2025 22:03:51 +0000 (00:03 +0200)] 
stringeq: Fix use in C++ mode.

* lib/string.in.h (memeq, streq): Define with "C" linkage.

4 months agomap-c++-tests: Fix compilation error (regression 2025-09-17).
Bruno Haible [Fri, 19 Sep 2025 14:26:52 +0000 (16:26 +0200)] 
map-c++-tests: Fix compilation error (regression 2025-09-17).

* tests/test-map-c++.cc (streq): Remove function.
* modules/map-c++-tests (Depends-on): Add stringeq.

4 months agostack-trace: Add support for Oracle DeveloperStudio cc.
Bruno Haible [Thu, 18 Sep 2025 18:57:26 +0000 (20:57 +0200)] 
stack-trace: Add support for Oracle DeveloperStudio cc.

* m4/stack-trace.m4 (gl_STACK_TRACE_EARLY): Use option
'-Wl,-export-dynamic' instead of '-rdynamic'.

4 months agolocalcharset: fix macOS build
Pádraig Brady [Thu, 18 Sep 2025 13:33:49 +0000 (14:33 +0100)] 
localcharset: fix macOS build

* lib/localcharset.c: s/ostreq/streq/ typo.

4 months agothreadlib: Improve support for HP-UX.
Bruno Haible [Wed, 17 Sep 2025 20:11:16 +0000 (22:11 +0200)] 
threadlib: Improve support for HP-UX.

* m4/threadlib.m4 (gl_ANYTHREADLIB_EARLY): Define _REENTRANT also on
HP-UX.

4 months agostringeq: Make use of Autoconf more reliable.
Bruno Haible [Wed, 17 Sep 2025 20:05:22 +0000 (22:05 +0200)] 
stringeq: Make use of Autoconf more reliable.

* m4/stringeq.m4: New file.
* modules/stringeq (Files): Add it.
(configure.ac): Don't set HAVE_DECL_MEMEQ, HAVE_DECL_STREQ. Instead,
invoke gl_FUNC_STREQ and gl_FUNC_MEMEQ.

4 months agocpu-supports: support checks on any architecture
Pádraig Brady [Wed, 17 Sep 2025 18:09:54 +0000 (19:09 +0100)] 
cpu-supports: support checks on any architecture

* lib/cpu-supports.h (gcc_feature_to_glibc_hwcap): Define the
map for all architectures, because for example one can build
and detect and run x86_64 intrinsics in code built with -m32.
This should not add runtime overhead, as mentioned previously
the map resolves at compile time with standard optimizations.

4 months agotests: support -ftrivial-auto-var-init
Pádraig Brady [Wed, 17 Sep 2025 15:51:52 +0000 (16:51 +0100)] 
tests: support -ftrivial-auto-var-init

Tested with gcc 15 and clang 20.
Note clang didn't need the adjustment,
but it was applied for clang also, to be defensive.

* tests/test-memset_explicit.c (do_secret_stuff): Mark stack variable
as not to be initialized with either zero or pattern on each invocation.
tests/test-explicit_bzero.c (do_secret_stuff): Likewise.

4 months agostringeq: port to platforms declaring memeq, streq
Paul Eggert [Wed, 17 Sep 2025 17:11:02 +0000 (10:11 -0700)] 
stringeq: port to platforms declaring memeq, streq

Work even if the system <string.h> declares memeq and streq.
Current standards allow systems to do that,
and we hope future systems will do it.
* lib/string.in.h (memeq) [HAVE_DECL_MEMEQ]: Do not define.
(streq) [HAVE_DECL_STREQ]: Do not define.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Default HAVE_DECL_MEMEQ,
HAVE_DECL_STREQ.
* modules/string-h (string-h):
Substitute HAVE_DECL_MEMEQ, HAVE_DECL_STREQ.
* modules/stringeq (configure.ac):
Define HAVE_DECL_MEMEQ, HAVE_DECL_STREQ.

4 months agogen-uni-tables: Fix module description (left-over from 2025-05-11).
Bruno Haible [Wed, 17 Sep 2025 16:33:18 +0000 (18:33 +0200)] 
gen-uni-tables: Fix module description (left-over from 2025-05-11).

Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00223.html>.

* modules/gen-uni-tables (Depends-on): Remove str_startswith,
str_endswith.

4 months agoAdd copyright notices.
Bruno Haible [Wed, 17 Sep 2025 16:28:35 +0000 (18:28 +0200)] 
Add copyright notices.

* lib/string.c: Add copyright notice. Use <string.h>, not "string.h".

4 months agostringeq: diagnose for streq instead of STREQ
Paul Eggert [Wed, 17 Sep 2025 06:09:25 +0000 (23:09 -0700)] 
stringeq: diagnose for streq instead of STREQ

* top/maint.mk (sc_prohibit_strcmp): In diagnostic, suggest streq
instead of STREQ/STRNEQ.

4 months agostringeq: prefer streq to strcmp in other modules
Paul Eggert [Wed, 17 Sep 2025 06:08:01 +0000 (23:08 -0700)] 
stringeq: prefer streq to strcmp in other modules

* lib/acl-internal.c, lib/argmatch.c, lib/argp-help.c:
* lib/argp-parse.c, lib/bcp47.c, lib/c32_get_mapping.c:
* lib/c32_get_type_test.c, lib/concat-filename.c:
* lib/cpu-supports.h, lib/dfa.c, lib/duplocale.c, lib/exclude.c:
* lib/findprog-in.c, lib/findprog.c, lib/fopen.c, lib/freopen.c:
* lib/fts.c, lib/gen-uni-tables.c, lib/getfilecon.c:
* lib/getlogin.c, lib/getugroups.c, lib/hard-locale.c:
* lib/hashcode-named-file.c, lib/hashkey-string.c:
* lib/iconv_open.c, lib/idcache.c, lib/lc-charset-unicode.c:
* lib/localcharset.c, lib/localename-environ.c:
* lib/localename-unsafe.c, lib/mbs_endswith.c, lib/mountlist.c:
* lib/newlocale.c, lib/nl_langinfo.c, lib/nproc.c, lib/open.c:
* lib/os2-spawn.c, lib/parse-datetime.y, lib/popen.c:
* lib/progreloc.c, lib/propername.c, lib/pt_chown.c, lib/putenv.c:
* lib/qcopy-acl.c, lib/readutmp.c, lib/rpmatch.c:
* lib/setlocale-fixes.c, lib/setlocale.c, lib/sig2str.c:
* lib/spawni.c, lib/stat.c, lib/str_endswith.c, lib/streq.h:
* lib/striconveha.c, lib/struniq.h, lib/supersede.c:
* lib/time_rz.c, lib/unicodeio.c, lib/vasnprintf.c:
* lib/vc-mtime.c, lib/wctrans-impl.h, lib/wctype-impl.h:
Prefer streq to strcmp when either will do.
Do not make this change to files shared with glibc.
Do not make the change to test files, at least not for now.
* lib/gen-uni-tables.c (streq): New static function, in same style.
* modules/acl-permissions, modules/argp, modules/c32_get_mapping:
* modules/c32_get_type_test, modules/concat-filename:
* modules/cpu-supports, modules/dfa, modules/duplocale:
* modules/exclude, modules/findprog, modules/findprog-in:
* modules/fopen, modules/fopen-gnu, modules/freopen, modules/fts:
* modules/getlocalename_l-simple, modules/getlocalename_l-unsafe:
* modules/getlogin, modules/getugroups, modules/hard-locale:
* modules/hashcode-named-file, modules/hashkey-string:
* modules/iconv_open, modules/idcache, modules/localcharset:
* modules/localename, modules/localename-unsafe:
* modules/mbs_endswith, modules/mountlist, modules/newlocale:
* modules/nl_langinfo, modules/nproc, modules/open:
* modules/parse-datetime, modules/popen:
* modules/posix_spawn-internal, modules/propername:
* modules/pt_chown, modules/putenv-gnu, modules/qcopy-acl:
* modules/rpmatch, modules/selinux-h, modules/setenv:
* modules/setlocale, modules/setlocale-fixes, modules/sig2str:
* modules/spawn-pipe, modules/stat, modules/str_endswith:
* modules/streq, modules/striconveha, modules/supersede:
* modules/time_rz, modules/uchar-h, modules/unicodeio:
* modules/uniconv/base, modules/wctrans, modules/wctype:
(Depends-on): Add stringeq.

4 months agostringeq: prefer memeq to memcmp in other modules
Paul Eggert [Wed, 17 Sep 2025 01:57:41 +0000 (18:57 -0700)] 
stringeq: prefer memeq to memcmp in other modules

* lib/argmatch.c, lib/argmatch.h, lib/backupfile.c, lib/bcp47.c:
* lib/boot-time.c, lib/csharpcomp.c, lib/csharpexec.c:
* lib/file-has-acl.c, lib/gen-uni-tables.c, lib/get_ppid_of.c:
* lib/get_progname_of.c, lib/getlogin_r.c, lib/getprogname.c:
* lib/getumask.c, lib/isnan.c, lib/mbchar.h, lib/mem-hash-map.c:
* lib/memcoll.c, lib/progname.c, lib/progreloc.c:
* lib/pthread_sigmask.c, lib/quotearg.c, lib/readutmp.c:
* lib/same.c, lib/signbitd.c, lib/signbitf.c, lib/signbitl.c:
* lib/string-desc.c, lib/string.c, lib/string.in.h:
* lib/unictype/3level.h, lib/unictype/3levelbit.h:
* lib/uniname/uniname.c, lib/vc-mtime.c:
Prefer memeq to memcmp when either will do.
Do not make this change to files shared with glibc.
Do not make the change to test files, at least not for now.
* lib/gen-uni-tables.c (memeq): New static function, in same style.
* modules/argmatch, modules/backupfile, modules/bcp47:
* modules/boot-time, modules/csharpcomp, modules/csharpexec:
* modules/file-has-acl:
* modules/get_ppid_of, modules/get_progname_of:
* modules/getlogin_r, modules/getprogname, modules/getumask:
* modules/isnan, modules/mbchar, modules/mem-hash-map:
* modules/memcoll, modules/progname, modules/pthread_sigmask:
* modules/quotearg, modules/readutmp, modules/relocatable-prog:
* modules/relocatable-prog-wrapper, modules/same, modules/signbit:
* modules/string-desc, modules/stringeq, modules/uniname/uniname:
* modules/vc-mtime:
(Depends-on): Add stringeq.

4 months agostringeq: new module
Paul Eggert [Tue, 16 Sep 2025 21:34:11 +0000 (14:34 -0700)] 
stringeq: new module

* MODULES.html.sh (func_all_modules): Add stringeq.
* lib/string.c, modules/stringeq: New files.
* lib/string.in.h: Use _GL_INLINE-related macros.
(memeq, streq): New functions, if stringeq module is in use.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS):
New var GNULIB_STRINGEQ.
* modules/string-h (string.h): Substitute GNULIB_STRINGEQ.

4 months agodoc: MODULES.html.sh: add missing cpu-supports entry
Pádraig Brady [Wed, 17 Sep 2025 14:56:07 +0000 (15:56 +0100)] 
doc: MODULES.html.sh: add missing cpu-supports entry

* MODULES.html.sh: Add "cpu-supports" to Misc section.

4 months agostdio-h: Work around [v][f]printf bugs in mingw with msvcrt.
Bruno Haible [Wed, 17 Sep 2025 07:31:31 +0000 (09:31 +0200)] 
stdio-h: Work around [v][f]printf bugs in mingw with msvcrt.

Reported by 松延 英樹 <maznobu@gmail.com> in
<https://github.com/mlocati/gettext-iconv-windows/issues/52>.

* lib/stdio.in.h (gl_consolesafe_fprintf, gl_consolesafe_printf,
gl_consolesafe_vfprintf, gl_consolesafe_vprintf): New declarations.
(fprintf): When msvcrt is in use, use gl_consolesafe_fprintf.
(printf): When msvcrt is in use, use gl_consolesafe_printf.
(vfprintf): When msvcrt is in use, use gl_consolesafe_vfprintf.
(vprintf): When msvcrt is in use, use gl_consolesafe_vprintf.
* lib/stdio-consolesafe.c: Include fseterr.h.
(gl_consolesafe_fprintf, gl_consolesafe_printf, gl_consolesafe_vfprintf,
gl_consolesafe_vprintf): New functions.
* lib/stdio-write.c (vfprintf): When msvcrt is in use, use
gl_consolesafe_vfprintf.
* modules/stdio-h (Depends-on): Add fseterr.
* doc/posix-functions/fprintf.texi: Document the mingw bug.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.

4 months agostdio-h: Work around fwrite bug in msvcrt.
Bruno Haible [Wed, 17 Sep 2025 06:38:14 +0000 (08:38 +0200)] 
stdio-h: Work around fwrite bug in msvcrt.

Reported by 松延 英樹 <maznobu@gmail.com> in
<https://github.com/mlocati/gettext-iconv-windows/issues/52>.

* lib/stdio.in.h (gl_consolesafe_fwrite): New declaration.
(fwrite): When msvcrt is in use, use gl_consolesafe_fwrite.
* lib/stdio-consolesafe.c: New file.
* lib/stdio-write.c (fwrite): When msvcrt is in use, use
gl_consolesafe_fwrite.
* modules/stdio.h (Files): Add lib/stdio-consolesafe.c.
(Depends-on): Add stdckdint-h.
(configure.ac): Define condition GL_COND_OBJ_STDIO_CONSOLESAFE.
(Makefile.am): Arrange to compile stdio-consolesafe.c.
* doc/posix-functions/fwrite.texi: Document the workaround.

4 months agostrerror_r-posix: Fix truncation code (regression today).
Bruno Haible [Tue, 16 Sep 2025 20:04:46 +0000 (22:04 +0200)] 
strerror_r-posix: Fix truncation code (regression today).

* lib/strerror_r.c (strerror_r): Fix use of snprintf again.

4 months agointtypes-h tests: Avoid compilation error on mingw.
Bruno Haible [Tue, 16 Sep 2025 19:35:12 +0000 (21:35 +0200)] 
inttypes-h tests: Avoid compilation error on mingw.

Reported by Michele Locati in
<https://lists.gnu.org/archive/html/bug-gettext/2024-09/msg00015.html>.

* tests/test-inttypes-h.c (l): On mingw without __USE_MINGW_ANSI_STDIO,
don't test for the presence of SCN*8, SCN*LEAST8, SCN*FAST8}.
* doc/posix-headers/inttypes.texi: Mention the mingw bug.

4 months agocpu-supports: remove assert dependency
Pádraig Brady [Tue, 16 Sep 2025 16:38:57 +0000 (17:38 +0100)] 
cpu-supports: remove assert dependency

Avoid LGPL incompatibility issues by removing assert.

* lib/cpu-supports.c (hwcaps_allowed): Replace assert()s
with defensive returns allowing the passed hwcap.
* modules/cpu-supports: Remove the dependency.

4 months agomcel: document that errno is unspecified
Paul Eggert [Tue, 16 Sep 2025 16:14:38 +0000 (09:14 -0700)] 
mcel: document that errno is unspecified

4 months agoDocument msvcrt (native Windows) bugs regarding console output.
Bruno Haible [Tue, 16 Sep 2025 15:08:44 +0000 (17:08 +0200)] 
Document msvcrt (native Windows) bugs regarding console output.

* doc/posix-functions/fputc.texi: Document a bug found in msvcrt.
* doc/posix-functions/putc.texi: Likewise.
* doc/posix-functions/fwrite.texi: Document another bug found in msvcrt.

4 months agostrerror_r: Ensure a trailing NUL when truncating.
Bruno Haible [Tue, 16 Sep 2025 14:51:55 +0000 (16:51 +0200)] 
strerror_r: Ensure a trailing NUL when truncating.

* lib/strerror_r.c (strerror_r): Fix use of snprintf.

4 months agostrtof: Work around mingw bug with overflow.
Bruno Haible [Tue, 16 Sep 2025 14:30:38 +0000 (16:30 +0200)] 
strtof: Work around mingw bug with overflow.

* lib/strtod.c (STRTOD): Recognize overflow.
* modules/strtof (Depends-on): Add isinf.
* modules/strtod (Depends-on): Likewise.
* modules/strtold (Depends-on): Likewise.
* doc/posix-functions/strtof.texi: Update mingw version.

4 months agopagealign_alloc tests: Fix link error.
Bruno Haible [Tue, 16 Sep 2025 13:07:55 +0000 (15:07 +0200)] 
pagealign_alloc tests: Fix link error.

* modules/pagealign_alloc-tests (Makefile.am): Link
bench-pagealign_alloc with $(LIBINTL).

4 months agotests: avoid infinite loop in init.sh
Pádraig Brady [Mon, 15 Sep 2025 13:43:16 +0000 (14:43 +0100)] 
tests: avoid infinite loop in init.sh

This was noticed when building expr in coreutils
with -fsanitize=memory, which induced false failures
resulting in an infinite loop.

* tests/init.sh: Break from the loop if there's an issue with expr(1).

4 months agocpu-supports: relicense under LGPL
Pádraig Brady [Mon, 15 Sep 2025 11:44:49 +0000 (12:44 +0100)] 
cpu-supports: relicense under LGPL

* modules/cpu-supports: Relicense under LGPL
to match the crc-x86_64 module.

4 months agothreadlib: Omit unsupported configure option.
Bruno Haible [Mon, 15 Sep 2025 16:09:03 +0000 (18:09 +0200)] 
threadlib: Omit unsupported configure option.

Reported by Michael Osipov <michael.osipov@innomotics.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-09/msg00009.html>.

* m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): If libtool is in use, don't
display the --disable-threads option.

4 months agoautoupdate
Karl Berry [Mon, 15 Sep 2025 15:34:43 +0000 (08:34 -0700)] 
autoupdate

4 months agopagealign_alloc tests: Fix link error.
Bruno Haible [Mon, 15 Sep 2025 06:32:29 +0000 (08:32 +0200)] 
pagealign_alloc tests: Fix link error.

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

4 months agogettext-h: Avoid warning with gcc < 4.2.
Bruno Haible [Sun, 14 Sep 2025 16:29:29 +0000 (18:29 +0200)] 
gettext-h: Avoid warning with gcc < 4.2.

Reported by Orgad Shaneh <orgads@gmail.com> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00183.html>.

* lib/gettext.h (gettext, dgettext, dcgettext): Don't use attribute
__gnu_inline__ with gcc < 4.2.

4 months agoautoupdate
Karl Berry [Sun, 14 Sep 2025 15:06:52 +0000 (08:06 -0700)] 
autoupdate

4 months agocrc-x86_64: honor GLIBC_TUNABLES to disable acceleration
Pádraig Brady [Fri, 12 Sep 2025 17:01:08 +0000 (18:01 +0100)] 
crc-x86_64: honor GLIBC_TUNABLES to disable acceleration

* modules/crc-x86_64: Depend on cpu-supports.
* lib/crc.c: Call the cpu_supports() wrapper that honors glibc hwcaps.

4 months agocpu-supports: a module to honor GLIBC_TUNABLES=glibc.cpu.hwcaps
Pádraig Brady [Fri, 12 Sep 2025 15:55:45 +0000 (16:55 +0100)] 
cpu-supports: a module to honor GLIBC_TUNABLES=glibc.cpu.hwcaps

This functionality is useful to allow better test coverage at least,
and may be useful for users to tune their environment,
avoiding CPU throttling for example.

* lib/cpu-supports.h (cpu_supports): A new wrapper that
checks that the GLIBC_TUNABLES environment variable allows
the hardware feature, before checking with __builtin_cpu_supports().
(cpu_may_support): Only perform the GLIBC_TUNABLES check,
which is useful if using other interfaces like getauxval().
(gcc_feature_to_glibc_hwcap): An internal helper that will resolve
at compile time with standard optimizations enabled.
* lib/cpu-supports.c (hwcap_allowed): Query the GLIBC_TUNABLES
environment variable (read once per process), to see if the
passed GLIBC_HWCAP is allowed.
* modules/cpu-supports: New module definition.
* modules/cpu-supports-tests: New test module definition.
* tests/test-cpu-supports.c: New tests.

4 months agogettext-h: Avoid -Wtrailing-whitespace in a better way.
Bruno Haible [Sun, 14 Sep 2025 01:06:51 +0000 (03:06 +0200)] 
gettext-h: Avoid -Wtrailing-whitespace in a better way.

* m4/gettext_h.m4: New file, extracted from modules/gettext-h. Add back
the newline at the end of the AH_BOTTOM argument.
* modules/gettext-h (Files): Add it.
(configure.ac): Invoke gl_GETTEXT_H.

4 months agogettext-h: Avoid -Wtrailing-whitespace in config.h.
Collin Funk [Sun, 14 Sep 2025 00:34:21 +0000 (17:34 -0700)] 
gettext-h: Avoid -Wtrailing-whitespace in config.h.

* modules/gettext-h (configure.ac): Move the closing bracket and
parentheses of AH_BOTTOM to the preceding line.

4 months agopagealign_alloc: Don't waste large amounts of memory (regr. 2025-09-10).
Bruno Haible [Sat, 13 Sep 2025 23:17:38 +0000 (01:17 +0200)] 
pagealign_alloc: Don't waste large amounts of memory (regr. 2025-09-10).

* tests/bench-pagealign_alloc.c: Update results.

4 months agopagealign_alloc: Don't waste large amounts of memory (regr. 2025-09-10).
Bruno Haible [Sat, 13 Sep 2025 22:25:21 +0000 (00:25 +0200)] 
pagealign_alloc: Don't waste large amounts of memory (regr. 2025-09-10).

* lib/pagealign_alloc.c (get_default_impl): Choose a default that does
not waste large amounts of memory.

4 months agopagealign_alloc: Add unit test for scalability.
Bruno Haible [Sat, 13 Sep 2025 22:25:12 +0000 (00:25 +0200)] 
pagealign_alloc: Add unit test for scalability.

* tests/test-pagealign_alloc.c: New file.
* modules/pagealign_alloc-tests (Files): Add it.
(Depends-on): Add xalloc.
(configure.ac): Check for alarm().
(Makefile.am): Arrange to compile and run test-pagealign_alloc.

4 months agopagealign_alloc: Fix scalability problem.
Bruno Haible [Sat, 13 Sep 2025 22:24:21 +0000 (00:24 +0200)] 
pagealign_alloc: Fix scalability problem.

Reported by Harry Sintonen <sintonen@iki.fi> in
<https://lists.gnu.org/archive/html/bug-gnulib/2025-09/msg00108.html>.

* lib/pagealign_alloc.c: Include gl_xmap.h, gl_hash_map.h. Don't include
xalloc.h.
(info_t, memnode_t, struct memnode_s): Remove types.
(memnode_table): Remove variable.
(new_memnode, get_memnode): Remove functions.
(page_info_map): New variable.
(pagealign_alloc): Use gl_map_put instead of new_memnode.
(pagealign_free): Use gl_map_getremove instead of get_memnode.
* modules/pagealign_alloc (Depends-on): Add xmap, hash-map. Remove
xalloc.

4 months agopagealign_alloc: Fix crashes (regression 2025-09-11).
Bruno Haible [Sat, 13 Sep 2025 20:36:06 +0000 (22:36 +0200)] 
pagealign_alloc: Fix crashes (regression 2025-09-11).

* lib/pagealign_alloc.c (pagealign_alloc, pagealign_free): Add missing
'break' statements. For PA_IMPL_VIRTUAL_ALLOC, don't use new_memnode and
get_memnode.

4 months agoendian: port to Solaris 11.4 and macOS 15
Paul Eggert [Sat, 13 Sep 2025 20:01:00 +0000 (13:01 -0700)] 
endian: port to Solaris 11.4 and macOS 15

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00174.html
* lib/byteswap.in.h (_GL_BYTESWAP_INLINE):
Define before including stdint.h.
* lib/endian.in.h (bswap_16, bswap_32, bswap_64):
Declare as _GL_BYTESWAP_INLINE rather than as extern.
Conditionalize these decls with _GL_BYTESWAP_INLINE rather than
with _GL_BYTESWAP_H.

4 months agoautoupdate
Karl Berry [Sat, 13 Sep 2025 16:02:51 +0000 (09:02 -0700)] 
autoupdate

4 months agogettext-h: Move fallback definition of GNULIB_TEXT_DOMAIN.
Bruno Haible [Sat, 13 Sep 2025 15:34:13 +0000 (17:34 +0200)] 
gettext-h: Move fallback definition of GNULIB_TEXT_DOMAIN.

* lib/gettext.h (GNULIB_TEXT_DOMAIN): Remove macro.
* modules/gettext-h (configure.ac): Define it here instead.

4 months agopagealign_alloc: Improve documentation.
Bruno Haible [Fri, 12 Sep 2025 23:44:53 +0000 (01:44 +0200)] 
pagealign_alloc: Improve documentation.

Suggested by Paul Eggert.

* lib/pagealign_alloc.h: Document that this module is not multithread-
safe.

4 months agopagealign_alloc: Tweak the benchmark.
Bruno Haible [Fri, 12 Sep 2025 23:46:42 +0000 (01:46 +0200)] 
pagealign_alloc: Tweak the benchmark.

* tests/bench-pagealign_alloc.c (show_stats): Reformat.
(main): Fix usage message.

4 months agovma-iter: Improve on OpenBSD.
Bruno Haible [Fri, 12 Sep 2025 23:31:23 +0000 (01:31 +0200)] 
vma-iter: Improve on OpenBSD.

* lib/vma-iter.c (vma_iterate_bsd): Call sysctl() in a loop, not just
once.
(vma_iterate) [__OpenBSD__]: Don't return the interval that ends at 0.

4 months agogitsub.sh: Revert last change.
Bruno Haible [Fri, 12 Sep 2025 22:48:22 +0000 (00:48 +0200)] 
gitsub.sh: Revert last change.

* top/gitsub.sh: Revert 2025-09-06 change.

4 months agoendian: port to gcc 4.1 + glibc 2.4
Paul Eggert [Thu, 11 Sep 2025 19:49:07 +0000 (12:49 -0700)] 
endian: port to gcc 4.1 + glibc 2.4

Problem reported by Orgad Shaneh in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00128.html
* lib/endian.in.h (bswap_16, bswap_32, bswap_64) [_GL_BYTESWAP_H]:
Declare before using.

4 months agopagealign_alloc: Add benchmark for comparing different implementations.
Bruno Haible [Thu, 11 Sep 2025 14:59:54 +0000 (16:59 +0200)] 
pagealign_alloc: Add benchmark for comparing different implementations.

* lib/pagealign_alloc.h (pagealign_impl_t): New type.
(pagealign_impl): New declaration.
* lib/pagealign_alloc.c: On native Windows, include <malloc.h> and
<windows.h>.
(pagealign_impl): New variable.
(info_t): Change to a union type.
(get_default_impl): New function.
(pagealign_alloc, pagealign_free): Dispatch according to pagealign_impl.
* tests/bench-pagealign_alloc.c: New file.
* modules/pagealign_alloc-tests: New file.

4 months agopagealign_alloc, vma-prot tests: Fix use of HAVE_MMAP (regr. yesterday).
Bruno Haible [Thu, 11 Sep 2025 12:38:39 +0000 (14:38 +0200)] 
pagealign_alloc, vma-prot tests: Fix use of HAVE_MMAP (regr. yesterday).

* m4/mmap-anon.m4 (gl_FUNC_MMAP_ANON): Test for sys/mman.h. Use
ac_cv_header_sys_mman_h instead of gl_have_mmap.
* lib/pagealign_alloc.c: Test HAVE_SYS_MMAN_H instead of HAVE_MMAP.
* tests/test-vma-prot.c: Likewise.

4 months agopagealign_alloc: prefer posix_memalign
Paul Eggert [Thu, 11 Sep 2025 01:23:58 +0000 (18:23 -0700)] 
pagealign_alloc: prefer posix_memalign

Problem reported by Harry Sintonen in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00108.html
* lib/pagealign_alloc.c (info_t, memnode_t, struct memnode_s)
(memnode_table, new_memnode, get_memnode):
Omit if HAVE_POSIX_MEMALIGN, even if HAVE_MMAP.
(pagealign_alloc, pagealign_free): Prefer posix_memalign to mmap.

4 months agoRemove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:22:53 +0000 (23:22 +0200)] 
Remove support for IRIX.

* all-modules: Update comments.
* build-aux/install-reloc: Likewise.
* build-aux/reloc-ldflags: Likewise.
* gnulib-tool: Likewise.
* gnulib-tool.py: Likewise.
* gnulib-tool.sh: Likewise.
* lib/aligned-malloc.h: Likewise.
* lib/boot-time.c: Likewise.
* lib/c32is-impl.h: Likewise.
* lib/c32srtombs-state.c: Likewise.
* lib/c32to-impl.h: Likewise.
* lib/c32width.c: Likewise.
* lib/errno.in.h: Likewise.
* lib/euidaccess.c: Likewise.
* lib/fbufmode.c: Likewise.
* lib/fenv-except-state-get.c: Likewise.
* lib/fenv-except-state-set.c: Likewise.
* lib/fenv-except-tracking-clear.c: Likewise.
* lib/fenv-except-tracking-set.c: Likewise.
* lib/fenv-except-tracking-test.c: Likewise.
* lib/fenv-except-trapping.c: Likewise.
* lib/fenv-round.c: Likewise.
* lib/fflush.c: Likewise.
* lib/fileblocks.c: Likewise.
* lib/forkpty.c: Likewise.
* lib/fpending.c: Likewise.
* lib/fpurge.c: Likewise.
* lib/freadable.c: Likewise.
* lib/freadahead.c: Likewise.
* lib/freading.c: Likewise.
* lib/freadptr.c: Likewise.
* lib/freadseek.c: Likewise.
* lib/fseeko.c: Likewise.
* lib/fseterr.c: Likewise.
* lib/fsusage.c: Likewise.
* lib/fwritable.c: Likewise.
* lib/fwriting.c: Likewise.
* lib/getdomainname.c: Likewise.
* lib/idpriv-drop.c: Likewise.
* lib/idpriv-droptemp.c: Likewise.
* lib/limits.in.h: Likewise.
* lib/mbrtoc16.c: Likewise.
* lib/mbrtoc32.c: Likewise.
* lib/mbsrtoc32s-state.c: Likewise.
* lib/mbsrtowcs-state.c: Likewise.
* lib/mbtowc-lock.h: Likewise.
* lib/minmax.h: Likewise.
* lib/netdb.in.h: Likewise.
* lib/pipe-filter-ii.c: Likewise.
* lib/posix_openpt.c: Likewise.
* lib/ptsname_r.c: Likewise.
* lib/readutmp.c: Likewise.
* lib/readutmp.h: Likewise.
* lib/resource-ext.h: Likewise.
* lib/safe-read.h: Likewise.
* lib/safe-write.h: Likewise.
* lib/save-cwd.c: Likewise.
* lib/stdbool.in.h: Likewise.
* lib/striconv.c: Likewise.
* lib/striconveh.c: Likewise.
* lib/termcap.h: Likewise.
* lib/terminfo.h: Likewise.
* lib/unistd.in.h: Likewise.
* lib/vasnprintf.c: Likewise.
* lib/wcrtomb.c: Likewise.
* lib/wcsrtombs-state.c: Likewise.
* m4/fenv-environment.m4: Likewise.
* m4/fenv-exceptions-state.m4: Likewise.
* m4/fenv-exceptions-tracking.m4: Likewise.
* m4/fenv-rounding.m4: Likewise.
* m4/fmod.m4: Likewise.
* m4/getdomainname.m4: Likewise.
* m4/getloadavg.m4: Likewise.
* m4/getopt.m4: Likewise.
* m4/hypot.m4: Likewise.
* m4/hypotf.m4: Likewise.
* m4/hypotl.m4: Likewise.
* m4/iconv.m4: Likewise.
* m4/intl-thread-locale.m4: Likewise.
* m4/largefile.m4: Likewise.
* m4/libdl.m4: Likewise.
* m4/locale-ja.m4: Likewise.
* m4/locale_h.m4: Likewise.
* m4/log.m4: Likewise.
* m4/log10.m4: Likewise.
* m4/log10f.m4: Likewise.
* m4/logf.m4: Likewise.
* m4/modf.m4: Likewise.
* m4/modff.m4: Likewise.
* m4/modfl.m4: Likewise.
* m4/pthread-rwlock.m4: Likewise.
* m4/semaphore.m4: Likewise.
* m4/socklen.m4: Likewise.
* m4/stdint.m4: Likewise.
* m4/strtod.m4: Likewise.
* m4/strtof.m4: Likewise.
* m4/strtold.m4: Likewise.
* modules/sigsegv: Likewise.
* posix-modules: Likewise.
* pygnulib/GLImport.py: Likewise.
* tests/init.sh: Likewise.
* tests/test-echo.sh: Likewise.
* tests/test-isatty.c: Likewise.
* tests/test-math-h.c: Likewise.
* tests/test-nonblocking-pipe.h: Likewise.
* tests/test-nonblocking-socket.h: Likewise.
* tests/test-strtod.h: Likewise.
* tests/test-strtof.h: Likewise.
* tests/test-strtold.h: Likewise.
* tests/test-vasnprintf.c: Likewise.
* tests/test-vasnwprintf.c: Likewise.

4 months agodoc: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:22:50 +0000 (23:22 +0200)] 
doc: Remove support for IRIX.

* doc/gnulib.texi (Header files): Update.
* doc/posix-functions/sig2str.texi: Don't mention IRIX problem.
* doc/posix-functions/str2sig.texi: Likewise.
* doc/posix-functions/strerror.texi: Likewise.
* doc/posix-headers/sys_stat.texi: Don't mention IRIX.
* doc/posix-headers/sys_types.texi: Likewise.

4 months agotests: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:19:32 +0000 (23:19 +0200)] 
tests: Remove support for IRIX.

* tests/minus-zero.h (compute_minus_zerof, compute_minus_zerod,
compute_minus_zerol): Remove code for IRIX.
* tests/test-c32isgraph.c (main): Likewise.
* tests/test-c32isprint.c (main): Likewise.
* tests/test-getaddrinfo.c (simple): Likewise.
* tests/test-isgraph_l.c (main): Likewise.
* tests/test-isprint_l.c (main): Likewise.
* tests/test-localeconv-mt.c (ENCODING): Likewise.
* tests/test-nl_langinfo-mt.c (ENCODING): Likewise.
* tests/test-setlocale_null-mt-all.c (ENCODING): Likewise.
* tests/test-setlocale_null-mt-one.c (ENCODING): Likewise.
* tests/test-sethostname1.c: Likewise.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
* tests/test-frexpl.c (MIN_NORMAL_EXP): Likewise.
* tests/test-ilogbl.c (MIN_NORMAL_EXP): Likewise.
* tests/test-logbl.c (MIN_NORMAL_EXP): Likewise.
* tests/test-printf-frexpl.c (MIN_NORMAL_EXP, MIN_SUBNORMAL_EXP):
Likewise.
* tests/test-fma2.h (MIN_SUBNORMAL_EXP): Remove macro.
(test_function): Inline its value.
* tests/test-lseek.c (main): Update comments.
* tests/test-sigabbrev_np.c (main): Remove cases for SIGCKPT, SIGPTINTR,
SIGPTRESCHED, SIGRESTART, SIGUME.
* tests/test-sigdescr_np.c (main): Likewise.
* modules/math-h-c++-tests (Makefile.am): Don't link test-math-h-c++
with extra libraries.

4 months agorelocatable-prog: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:19:26 +0000 (23:19 +0200)] 
relocatable-prog: Remove support for IRIX.

* build-aux/config.libpath: Remove code for IRIX.

4 months agohavelib: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:57 +0000 (23:18 +0200)] 
havelib: Remove support for IRIX.

* build-aux/config.rpath: Remove code for IRIX.

4 months agowctype-h: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:43 +0000 (23:18 +0200)] 
wctype-h: Remove support for IRIX.

* lib/wctype.in.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit,
iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit,
towlower, towupper): Remove workaround for IRIX.

4 months agowchar-h: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:40 +0000 (23:18 +0200)] 
wchar-h: Remove support for IRIX.

* lib/wchar.in.h: Don't set or test
_@GUARD_PREFIX@_ALREADY_INCLUDING_WCHAR_H.
(rpl_mbstate_t): Remove type.
(wctob): Test HAVE_WCTOB instead of HAVE_DECL_WCTOB.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_WCTOB instead of
HAVE_DECL_WCTOB.
* modules/wchar-h (Makefile.am): Substitute HAVE_WCTOB instead of
HAVE_DECL_WCTOB.
* m4/wctob.m4 (gl_FUNC_WCTOB): Don't set HAVE_DECL_WCTOB.

4 months agounicodeio: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:37 +0000 (23:18 +0200)] 
unicodeio: Remove support for IRIX.

* lib/unicodeio.c (unicode_to_mb): Remove code for IRIX.

4 months agothreads-h: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:34 +0000 (23:18 +0200)] 
threads-h: Remove support for IRIX.

* lib/threads.in.h (TSS_DTOR_ITERATIONS): Assume that
PTHREAD_DESTRUCTOR_ITERATIONS is defined.

4 months agothread: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:29 +0000 (23:18 +0200)] 
thread: Remove support for IRIX.

* lib/glthread/thread.h: Remove code for IRIX.

4 months agothreadlib: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:18:04 +0000 (23:18 +0200)] 
threadlib: Remove support for IRIX.

* m4/threadlib.m4 (gl_PTHREADLIB_BODY): Assume that
pthread_mutexattr_init and pthread_mutex_lock are defined in the same
library.

4 months agosys_select-h: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:17:33 +0000 (23:17 +0200)] 
sys_select-h: Remove support for IRIX.

* lib/sys_select.in.h: Remove code for IRIX.

4 months agosysexits-h: Remove support for IRIX.
Bruno Haible [Wed, 10 Sep 2025 21:17:04 +0000 (23:17 +0200)] 
sysexits-h: Remove support for IRIX.

* lib/sysexits.in.h: Remove code for IRIX.