[CCing bug-gnulib]

Hi Michael,

> -mt translates to in C mode:
> > -D_REENTRANT
> > -D_POSIX_C_SOURCE=199506L
> > -lpthread

Thanks.

-lpthread is already handled by threadlib.m4.

-D_POSIX_C_SOURCE=199506L is something we don't want to have, because
(as far as I understand) it reduces the set of symbols visible from the
*.h files.

-D_REENTRANT: I'm adding it in threadlib.m4, through this Gnulib patch:


2025-09-17  Bruno Haible  <[email protected]>

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

diff --git a/m4/threadlib.m4 b/m4/threadlib.m4
index d38238c837..a93aa5c1f7 100644
--- a/m4/threadlib.m4
+++ b/m4/threadlib.m4
@@ -1,5 +1,5 @@
 # threadlib.m4
-# serial 48
+# serial 49
 dnl Copyright (C) 2005-2025 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -62,7 +62,7 @@ AC_DEFUN([gl_ANYTHREADLIB_EARLY]
     # definition of errno in <errno.h>.
     AS_CASE([$host_os],
       [aix* | freebsd*], [CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"],
-      [solaris*], [CPPFLAGS="$CPPFLAGS -D_REENTRANT"])
+      [hpux* | solaris*], [CPPFLAGS="$CPPFLAGS -D_REENTRANT"])
     gl_anythreadlib_early_done=done
   fi
 ])




Reply via email to