aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-05-29 08:05:06 -0700
committerPaul Eggert2014-05-29 08:05:06 -0700
commit035159ed54cf2e1abc0439fbb6e628c9223f8e5d (patch)
treee99b3609d60f0bbda83dec913cf46cb5f32e2c6d
parent0bbb27fc3f52f87605cfadba62d52b72523b73a5 (diff)
downloademacs-035159ed54cf2e1abc0439fbb6e628c9223f8e5d.tar.gz
emacs-035159ed54cf2e1abc0439fbb6e628c9223f8e5d.zip
Don't substitute sigprocmask for pthread_sigmask.
sigprocmask isn't portable in a multithreaded process. * configure.ac (gl_THREADLIB): Remove dummy. Merge from gnulib, incorporating: 2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed * m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib. * src/Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed. Fixes: debbugs:17561
-rw-r--r--ChangeLog9
-rw-r--r--configure.ac2
-rw-r--r--m4/pthread_sigmask.m485
-rw-r--r--m4/timer_time.m439
-rw-r--r--src/ChangeLog5
-rw-r--r--src/Makefile.in6
6 files changed, 83 insertions, 63 deletions
diff --git a/ChangeLog b/ChangeLog
index 26f841e8eb0..921d211ac4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
12014-05-29 Paul Eggert <eggert@cs.ucla.edu>
2
3 Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
4 sigprocmask isn't portable in a multithreaded process.
5 * configure.ac (gl_THREADLIB): Remove dummy.
6 Merge from gnulib, incorporating:
7 2014-05-28 pthread_sigmask, timer-time: use gl_THREADLIB only if needed
8 * m4/pthread_sigmask.m4, m4/timer_time.m4: Update from gnulib.
9
12014-05-29 Glenn Morris <rgm@gnu.org> 102014-05-29 Glenn Morris <rgm@gnu.org>
2 11
3 * configure.ac: Explicitly drop some ancient Solaris versions. 12 * configure.ac: Explicitly drop some ancient Solaris versions.
diff --git a/configure.ac b/configure.ac
index e70c0fc6312..00bba75a76c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -704,8 +704,6 @@ AC_DEFUN([gl_CRYPTO_CHECK])
704# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, 704# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
705# as we don't use them. 705# as we don't use them.
706AC_DEFUN([gl_FCNTL_O_FLAGS]) 706AC_DEFUN([gl_FCNTL_O_FLAGS])
707# Avoid gnulib's threadlib module, as we do threads our own way.
708AC_DEFUN([gl_THREADLIB])
709 707
710# Initialize gnulib right after choosing the compiler. 708# Initialize gnulib right after choosing the compiler.
711dnl Amongst other things, this sets AR and ARFLAGS. 709dnl Amongst other things, this sets AR and ARFLAGS.
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index 4ba073231f9..2b3347f992d 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,4 +1,4 @@
1# pthread_sigmask.m4 serial 13 1# pthread_sigmask.m4 serial 14
2dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-2014 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -97,39 +97,43 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
97 dnl with -lpthread, the pthread_sigmask() function always returns 0 and has 97 dnl with -lpthread, the pthread_sigmask() function always returns 0 and has
98 dnl no effect. 98 dnl no effect.
99 if test -z "$LIB_PTHREAD_SIGMASK"; then 99 if test -z "$LIB_PTHREAD_SIGMASK"; then
100 AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread], 100 case " $LIBS " in
101 [gl_cv_func_pthread_sigmask_in_libc_works], 101 *' -lpthread '*) ;;
102 [ 102 *)
103 AC_RUN_IFELSE( 103 AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
104 [AC_LANG_SOURCE([[ 104 [gl_cv_func_pthread_sigmask_in_libc_works],
105#include <pthread.h> 105 [
106#include <signal.h> 106 AC_RUN_IFELSE(
107#include <stddef.h> 107 [AC_LANG_SOURCE([[
108int main () 108 #include <pthread.h>
109{ 109 #include <signal.h>
110 sigset_t set; 110 #include <stddef.h>
111 sigemptyset (&set); 111 int main ()
112 return pthread_sigmask (1729, &set, NULL) != 0; 112 {
113}]])], 113 sigset_t set;
114 [gl_cv_func_pthread_sigmask_in_libc_works=no], 114 sigemptyset (&set);
115 [gl_cv_func_pthread_sigmask_in_libc_works=yes], 115 return pthread_sigmask (1729, &set, NULL) != 0;
116 [ 116 }]])],
117changequote(,)dnl 117 [gl_cv_func_pthread_sigmask_in_libc_works=no],
118 case "$host_os" in 118 [gl_cv_func_pthread_sigmask_in_libc_works=yes],
119 freebsd* | hpux* | solaris | solaris2.[2-9]*) 119 [
120 gl_cv_func_pthread_sigmask_in_libc_works="guessing no";; 120 changequote(,)dnl
121 *) 121 case "$host_os" in
122 gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";; 122 freebsd* | hpux* | solaris | solaris2.[2-9]*)
123 esac 123 gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
124changequote([,])dnl 124 *)
125 ]) 125 gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
126 ]) 126 esac
127 case "$gl_cv_func_pthread_sigmask_in_libc_works" in 127 changequote([,])dnl
128 *no) 128 ])
129 REPLACE_PTHREAD_SIGMASK=1 129 ])
130 AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1], 130 case "$gl_cv_func_pthread_sigmask_in_libc_works" in
131 [Define to 1 if pthread_sigmask() may returns 0 and have no effect.]) 131 *no)
132 ;; 132 REPLACE_PTHREAD_SIGMASK=1
133 AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
134 [Define to 1 if pthread_sigmask may return 0 and have no effect.])
135 ;;
136 esac;;
133 esac 137 esac
134 fi 138 fi
135 139
@@ -184,11 +188,12 @@ int main ()
184 *) 188 *)
185 gl_cv_func_pthread_sigmask_unblock_works="guessing yes";; 189 gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
186 esac 190 esac
187 dnl Here we link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK, 191 m4_ifdef([gl_][THREADLIB],
188 dnl otherwise we get a false positive on those platforms where 192 [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
189 dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no". 193 dnl Otherwise we get a false positive on those platforms where
190 gl_save_LIBS="$LIBS" 194 dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
191 LIBS="$LIBS $LIBMULTITHREAD" 195 gl_save_LIBS=$LIBS
196 LIBS="$LIBS $LIBMULTITHREAD"])
192 AC_RUN_IFELSE( 197 AC_RUN_IFELSE(
193 [AC_LANG_SOURCE([[ 198 [AC_LANG_SOURCE([[
194#include <pthread.h> 199#include <pthread.h>
@@ -227,7 +232,7 @@ int main ()
227 [:], 232 [:],
228 [gl_cv_func_pthread_sigmask_unblock_works=no], 233 [gl_cv_func_pthread_sigmask_unblock_works=no],
229 [:]) 234 [:])
230 LIBS="$gl_save_LIBS" 235 m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS])
231 ]) 236 ])
232 case "$gl_cv_func_pthread_sigmask_unblock_works" in 237 case "$gl_cv_func_pthread_sigmask_unblock_works" in
233 *no) 238 *no)
diff --git a/m4/timer_time.m4 b/m4/timer_time.m4
index 8e2c921cbef..578ebe0809a 100644
--- a/m4/timer_time.m4
+++ b/m4/timer_time.m4
@@ -1,4 +1,4 @@
1# timer_time.m4 serial 2 1# timer_time.m4 serial 3
2dnl Copyright (C) 2011-2014 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-2014 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,12 @@ AC_DEFUN([gl_TIMER_TIME],
11 dnl Based on clock_time.m4. See details there. 11 dnl Based on clock_time.m4. See details there.
12 12
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
14 AC_REQUIRE([gl_THREADLIB]) 14
15 dnl Test whether the gnulib module 'threadlib' is in use.
16 dnl Some packages like Emacs use --avoid=threadlib.
17 dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
18 dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
19 m4_ifdef([gl_][THREADLIB], [AC_REQUIRE([gl_][THREADLIB])])
15 20
16 LIB_TIMER_TIME= 21 LIB_TIMER_TIME=
17 AC_SUBST([LIB_TIMER_TIME]) 22 AC_SUBST([LIB_TIMER_TIME])
@@ -19,21 +24,21 @@ AC_DEFUN([gl_TIMER_TIME],
19 AC_SEARCH_LIBS([timer_settime], [rt posix4], 24 AC_SEARCH_LIBS([timer_settime], [rt posix4],
20 [test "$ac_cv_search_timer_settime" = "none required" || 25 [test "$ac_cv_search_timer_settime" = "none required" ||
21 LIB_TIMER_TIME=$ac_cv_search_timer_settime]) 26 LIB_TIMER_TIME=$ac_cv_search_timer_settime])
22 dnl GLIBC uses threads to emulate posix timers when kernel support 27 m4_ifdef([gl_][THREADLIB],
23 dnl is not available (like Linux < 2.6 or when used with kFreeBSD) 28 [dnl GLIBC uses threads to emulate posix timers when kernel support
24 dnl Now the pthread lib is linked automatically in the normal case, 29 dnl is not available (like Linux < 2.6 or when used with kFreeBSD)
25 dnl but when linking statically, it needs to be explicitly specified. 30 dnl Now the pthread lib is linked automatically in the normal case,
26 AC_EGREP_CPP([Thread], 31 dnl but when linking statically, it needs to be explicitly specified.
27 [ 32 AC_EGREP_CPP([Thread],
28#include <features.h> 33 [#include <features.h>
29#ifdef __GNU_LIBRARY__ 34 #ifdef __GNU_LIBRARY__
30 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \ 35 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || (__GLIBC__ > 2)) \
31 && !(__UCLIBC__ && __HAS_NO_THREADS__) 36 && !(__UCLIBC__ && __HAS_NO_THREADS__)
32 Thread emulation available 37 Thread emulation available
33 #endif 38 #endif
34#endif 39 #endif
35 ], 40 ],
36 [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) 41 [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"])])
37 AC_CHECK_FUNCS([timer_settime]) 42 AC_CHECK_FUNCS([timer_settime])
38 LIBS=$gl_saved_libs 43 LIBS=$gl_saved_libs
39]) 44])
diff --git a/src/ChangeLog b/src/ChangeLog
index 33b8257cc1c..5189712d490 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12014-05-29 Paul Eggert <eggert@cs.ucla.edu>
2
3 Don't substitute sigprocmask for pthread_sigmask (Bug#17561).
4 * Makefile.in (LIB_PTHREAD_SIGMASK): Remove; all uses removed.
5
12014-05-29 Eli Zaretskii <eliz@gnu.org> 62014-05-29 Eli Zaretskii <eliz@gnu.org>
2 7
3 * buffer.c (init_buffer): Accept an argument 'initialized'. 8 * buffer.c (init_buffer): Accept an argument 'initialized'.
diff --git a/src/Makefile.in b/src/Makefile.in
index 0f4130b4dac..d90e9e0eef3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -125,7 +125,7 @@ LIBS_SYSTEM=@LIBS_SYSTEM@
125## -lm, or empty. 125## -lm, or empty.
126LIB_MATH=@LIB_MATH@ 126LIB_MATH=@LIB_MATH@
127 127
128## -lpthreads, or empty. 128## -lpthread, or empty.
129LIB_PTHREAD=@LIB_PTHREAD@ 129LIB_PTHREAD=@LIB_PTHREAD@
130 130
131LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@ 131LIBIMAGE=@LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@
@@ -293,8 +293,6 @@ LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
293LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@ 293LIBGNUTLS_LIBS = @LIBGNUTLS_LIBS@
294LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@ 294LIBGNUTLS_CFLAGS = @LIBGNUTLS_CFLAGS@
295 295
296LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
297
298INTERVALS_H = dispextern.h intervals.h composite.h 296INTERVALS_H = dispextern.h intervals.h composite.h
299 297
300GETLOADAVG_LIBS = @GETLOADAVG_LIBS@ 298GETLOADAVG_LIBS = @GETLOADAVG_LIBS@
@@ -413,7 +411,7 @@ LIBES = $(LIBS) $(W32_LIBS) $(LIBS_GNUSTEP) $(LIBX_BASE) $(LIBIMAGE) \
413 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \ 411 $(LIBXML2_LIBS) $(LIBGPM) $(LIBRESOLV) $(LIBS_SYSTEM) \
414 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \ 412 $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) $(SETTINGS_LIBS) $(LIBSELINUX_LIBS) \
415 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \ 413 $(FREETYPE_LIBS) $(FONTCONFIG_LIBS) $(LIBOTF_LIBS) $(M17N_FLT_LIBS) \
416 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) $(LIB_PTHREAD_SIGMASK) \ 414 $(LIBGNUTLS_LIBS) $(LIB_PTHREAD) \
417 $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ) 415 $(GFILENOTIFY_LIBS) $(LIB_MATH) $(LIBZ)
418 416
419all: emacs$(EXEEXT) $(OTHER_FILES) 417all: emacs$(EXEEXT) $(OTHER_FILES)