unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask
@ 2019-05-02 23:09 Alex Gramiak
  2019-05-03  0:42 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Gramiak @ 2019-05-02 23:09 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

The nearby comment states "Avoid gnulib's test for pthread_sigmask", but
the method used doesn't seem to work.

What I see is that gl_INIT is called, which calls
gl_FUNC_PTHREAD_SIGMASK.

The method in the attached patch is the same as used for avoiding other
gnulib tests.

If the test is really to be avoided, then I would think it to be better
to remove m4/pthread_sigmask.m4 so that gl_INIT doesn't include the test
in the first place. It doesn't look like any of the code uses the result
of it.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pthread_sigmask avoidance --]
[-- Type: text/x-patch, Size: 973 bytes --]

From a30ccae87d6f4f7d8cb0c061625e09c59c960052 Mon Sep 17 00:00:00 2001
From: Alexander Gramiak <agrambot@gmail.com>
Date: Thu, 2 May 2019 16:49:15 -0600
Subject: [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask

The previous method wasn't working correctly.
---
 configure.ac | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 79fe0c98c6..333da87aa5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -876,11 +876,8 @@ AC_DEFUN
 # as we don't use them.
 AC_DEFUN([gl_FCNTL_O_FLAGS])
 # Avoid gnulib's test for pthread_sigmask.
-funcs=
-for func in $ac_func_list; do
-  test $func = pthread_sigmask || AS_VAR_APPEND([funcs], [" $func"])
-done
-ac_func_list=$funcs
+AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK])
+
 # Use the system putenv even if it lacks GNU features, as we don't need them,
 # and the gnulib replacement runs afoul of a FreeBSD 10.1 bug; see Bug#19874.
 AC_CHECK_FUNCS_ONCE([putenv])
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask
  2019-05-02 23:09 [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask Alex Gramiak
@ 2019-05-03  0:42 ` Paul Eggert
  2019-05-03  5:48   ` Alex Gramiak
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Eggert @ 2019-05-03  0:42 UTC (permalink / raw)
  To: Alex Gramiak; +Cc: emacs-devel

On 5/2/19 4:09 PM, Alex Gramiak wrote:
> The nearby comment states "Avoid gnulib's test for pthread_sigmask", but
> the method used doesn't seem to work.
>
> What I see is that gl_INIT is called, which calls
> gl_FUNC_PTHREAD_SIGMASK.

It what sense is it not working? gl_FUNC_PTHREAD_SIGMASK is not the same
as "gnulib's test for pthread_sigmask", so the comment is not
contradicted by the fact that gl_INIT calls gl_FUNC_PTHREAD_SIGMASK. The
latter macro does some useful sanity checking on platforms where
pthread_sigmask exists but doesn't do anything, e.g., on Solaris 11
Update 3 or older if you don't define _REENTRANT then Emacs's pthreaded
code will likely fail in subtle ways (see
<https://blogs.oracle.com/solaris/mtreentrant-v2>).




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask
  2019-05-03  0:42 ` Paul Eggert
@ 2019-05-03  5:48   ` Alex Gramiak
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Gramiak @ 2019-05-03  5:48 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

Paul Eggert <eggert@cs.ucla.edu> writes:

> On 5/2/19 4:09 PM, Alex Gramiak wrote:
>> The nearby comment states "Avoid gnulib's test for pthread_sigmask", but
>> the method used doesn't seem to work.
>>
>> What I see is that gl_INIT is called, which calls
>> gl_FUNC_PTHREAD_SIGMASK.
>
> It what sense is it not working? gl_FUNC_PTHREAD_SIGMASK is not the same
> as "gnulib's test for pthread_sigmask", so the comment is not
> contradicted by the fact that gl_INIT calls gl_FUNC_PTHREAD_SIGMASK.

Ah, I get it now; it's referring to the AC_CHECK_FUNCS_ONCE in
pthread_sigmask.m4 rather than the tests for pthread_sigmask
functionality.

Is there a reason to test for it in configure.ac instead of in
pthread_sigmask.m4? I would think that it makes sense to use gnulib's
version since it uses AC_CHECK_FUNCS_ONCE over AC_CHECK_FUNCS.

> The latter macro does some useful sanity checking on platforms where
> pthread_sigmask exists but doesn't do anything, e.g., on Solaris 11
> Update 3 or older if you don't define _REENTRANT then Emacs's
> pthreaded code will likely fail in subtle ways (see
> <https://blogs.oracle.com/solaris/mtreentrant-v2>).

Thanks, I understand now. However, considering that the pthread_sigmask
tests are relatively slow, is there an easy way to specify some common
platforms that don't have this problem so that they can skip the tests?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-03  5:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-02 23:09 [PATCH] * configure.ac: Avoid gnulib's test for pthread_sigmask Alex Gramiak
2019-05-03  0:42 ` Paul Eggert
2019-05-03  5:48   ` Alex Gramiak

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).