From 13e14a6bfd9f29cbfeab0c5161d2a994f97532e7 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:53:53 +0100 Subject: Update/gnulib 2026 03 (#2247) * Sync with the 202601-stable Gnulib code (4a3650d887) * Ignore more deps stuff in gnulib * Remove autogenerated gnulib files * Ignore more gnulib generated headers --- gl/m4/threadlib.m4 | 45 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 33 deletions(-) (limited to 'gl/m4/threadlib.m4') diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4 index 333c8fe0..bdea4b97 100644 --- a/gl/m4/threadlib.m4 +++ b/gl/m4/threadlib.m4 @@ -1,6 +1,6 @@ # threadlib.m4 -# serial 45.1 -dnl Copyright (C) 2005-2025 Free Software Foundation, Inc. +# serial 49 +dnl Copyright (C) 2005-2026 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -57,16 +57,6 @@ AC_DEFUN([gl_ANYTHREADLIB_EARLY], [ AC_REQUIRE([AC_CANONICAL_HOST]) if test -z "$gl_anythreadlib_early_done"; then - AS_CASE([$host_os], - [osf*], - [# On OSF/1, the compiler needs the flag -D_REENTRANT so that it - # groks . cc also understands the flag -pthread, but - # we do not use it because 1. gcc-2.95 does not understand -pthread, - # 2. putting a flag into CPPFLAGS that has an effect on the linker - # causes the AC_LINK_IFELSE test below to succeed unexpectedly, - # leading to wrong values of LIBTHREAD and LTLIBTHREAD. - CPPFLAGS="$CPPFLAGS -D_REENTRANT" - ]) # Some systems optimize for single-threaded programs by default, and # need special flags to disable these optimizations. For example, the # definition of errno in . @@ -190,17 +180,13 @@ AC_DEFUN([gl_PTHREADLIB_BODY], gl_pthread_api=no LIBPTHREAD= LIBPMULTITHREAD= - # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that - # it groks . It is added above, in gl_ANYTHREADLIB_EARLY. AC_CHECK_HEADER([pthread.h], [gl_have_pthread_h=yes], [gl_have_pthread_h=no]) AS_IF([test "$gl_have_pthread_h" = yes], [ # Other possible tests: # -lpthreads (FSU threads, PCthreads) # -lgthreads - # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist - # in libc. IRIX 6.5 has the first one in both libc and libpthread, but - # the second one only in libpthread, and lock.c needs it. + # Test whether both pthread_mutex_lock exists in libc. # # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 # needs -pthread for some reason. See: @@ -212,10 +198,8 @@ AC_DEFUN([gl_PTHREADLIB_BODY], [AC_LANG_PROGRAM( [[#include pthread_mutex_t m; - pthread_mutexattr_t ma; ]], - [[pthread_mutex_lock (&m); - pthread_mutexattr_init (&ma);]])], + [[pthread_mutex_lock (&m);]])], [gl_pthread_api=yes LIBPTHREAD=$gl_pthread LIBPMULTITHREAD=$gl_pthread]) @@ -244,8 +228,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY], ]) echo "$as_me:__oline__: gl_pthread_in_glibc=$gl_pthread_in_glibc" >&AS_MESSAGE_LOG_FD - # Test for libpthread by looking for pthread_kill. (Not pthread_self, - # since it is defined as a macro on OSF/1.) + # Test for libpthread by looking for pthread_kill. AS_IF([test $gl_pthread_api = yes && test -z "$LIBPTHREAD"], [ # The program links fine without libpthread. But it may actually # need to link with libpthread in order to create multiple threads. @@ -451,18 +434,19 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], dnl gl_use_winpthreads_default defaults to "no", because in mingw 10, like dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash. m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no]) + dnl Don't display the --disable-threads option + dnl - if the package builds one or more libraries, because libraries must + dnl always be multithread-safe (as far as possible), + dnl - if the package defines gl_THREADLIB_DEFAULT_NO, because the option + dnl would then be a no-op. AC_ARG_ENABLE([threads], -AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ -AS_HELP_STRING([[--disable-threads]], [build without multithread safety])]), +AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([LT_INIT], [], [m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AS_HELP_STRING([[--disable-threads]], [build without multithread safety])])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" else AS_CASE([$host_os], - dnl Disable multithreading by default on OSF/1, because it interferes - dnl with fork()/exec(): When msgexec is linked with -lpthread, its - dnl child process gets an endless segmentation fault inside execvp(). - [osf*], [gl_use_threads=no], dnl Disable multithreading by default on Cygwin 1.5.x, because it has dnl bugs that lead to endless loops or crashes. See dnl . @@ -665,13 +649,8 @@ dnl dnl HP-UX 11 posix -lpthread N (cc) OK dnl Y (gcc) dnl -dnl IRIX 6.5 posix -lpthread Y 0.5 -dnl dnl AIX 4.3,5.1 posix -lpthread N AIX 4: 0.5; AIX 5: OK dnl -dnl OSF/1 4.0,5.1 posix -pthread (cc) N OK -dnl -lpthread (gcc) Y -dnl dnl Cygwin posix -lpthread Y OK dnl dnl Mingw windows N OK -- cgit v1.2.3-74-g34f1