[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pthread_sigmask and glibc
From: |
Bruno Haible |
Subject: |
Re: pthread_sigmask and glibc |
Date: |
Wed, 3 Aug 2011 01:10:35 +0200 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Hi Eric,
> doc/posix-functions/pthread_sigmask.texi does not mention any issues
> with glibc, but the pthread_sigmask module ends up replacing
> pthread_sigmask anyways:
>
> configure:7526: checking for pthread_sigmask
> configure:7526: gcc -o conftest -g -O2 conftest.c >&5
> /tmp/ccRmi1Nr.o: In function `main':
> /home/remote/eblake/gnulib/testdir20236/build/conftest.c:76: undefined
> reference to `pthread_sigmask'
>
> GNULIB_PTHREAD_SIGMASK='1'
> HAVE_PTHREAD_SIGMASK='0'
> LIB_PTHREAD_SIGMASK=''
> REPLACE_PTHREAD_SIGMASK='1'
I reproduce the issue with
$ ./gnulib-tool --create-testdir --dir=/tmp/testdir --with-tests
--single-configure pthread_sigmask
> Why? Because AC_CHECK_FUNCS_ONCE does not add the mandatory -pthread
> compiler switch, and glibc only provides pthread_sigmask when compiling
> for threads. This seems fishy to me; it seems like we have a bug in
> pthread_sigmask.m4 for not recognizing glibc's version, and populating
> $(LIB_PTHREAD_SIGMASK) with -pthread as appropriate.
Yes. Looking at the generated configure shows
if test $ac_cv_func_pthread_sigmask = yes; then
:
else
HAVE_PTHREAD_SIGMASK=0
REPLACE_PTHREAD_SIGMASK=1
fi
That is, the m4_ifdef([gl_[]THREADLIB] test evaluated to false, although
it was meant to evaluate to true. I'm applying this fix. With it, I get
in config.status:
S["GNULIB_PTHREAD_SIGMASK"]="1"
S["HAVE_PTHREAD_SIGMASK"]="1"
S["LIB_PTHREAD_SIGMASK"]="-lpthread"
S["REPLACE_PTHREAD_SIGMASK"]="0"
which is as expected.
2011-08-02 Bruno Haible <address@hidden>
pthread_sigmask: Actually use results of gl_THREADLIB.
* m4/pthread_sigmask.m4 (gl_FUNC_PTHREAD_SIGMASK): Test and require
gl_THREADLIB, not gl_[]THREADLIB.
Reported by Eric Blake.
--- m4/pthread_sigmask.m4.orig Wed Aug 3 01:01:53 2011
+++ m4/pthread_sigmask.m4 Wed Aug 3 01:01:52 2011
@@ -1,4 +1,4 @@
-# pthread_sigmask.m4 serial 11
+# pthread_sigmask.m4 serial 12
dnl Copyright (C) 2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,8 +13,8 @@
dnl Some packages like Emacs use --avoid=threadlib.
dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
- m4_ifdef([gl_[]THREADLIB], [
- AC_REQUIRE([gl_[]THREADLIB])
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
if test "$gl_threads_api" = posix; then
if test $ac_cv_func_pthread_sigmask = yes; then
--
In memoriam Amatore Sciesa <http://it.wikipedia.org/wiki/Amatore_Sciesa>