ports/161911: [patch] editors/emacs-devel: broken pthread_sigmask()

Nali Toja nalitoja at gmail.com
Sat Oct 22 23:40:06 UTC 2011


>Number:         161911
>Category:       ports
>Synopsis:       [patch] editors/emacs-devel: broken pthread_sigmask()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 22 23:40:05 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Nali Toja
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
BATCH=
WITHOUT_X11=
WITHOUT_DBUS=
WITHOUT_GNUTLS=
>Description:
The last gnulib merge in r105666 breaks the one defined in libthr by
marking it with defines checked against the stub in libc.

  PTHREAD_SIGMASK_INEFFECTIVE [1]
  PTHREAD_SIGMASK_UNBLOCK_BUG [2]

while HAVE_PTHREAD assumes the symbol comes from -lpthread. It's a bit
unclear whether this is a bug in gnulib, emacs or actually a feature[3],
so let's follow gnulib instructions (at least for now)

    dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
    dnl specified.
    dnl The package either has prepared CPPFLAGS and LIBS for use of POSIX:2008
    dnl threads, or wants to build single-threaded programs.
    if test $ac_cv_func_pthread_sigmask = yes; then
      dnl pthread_sigmask exists and does not require extra libraries.
      dnl Assume that it is declared.
      :
    
as according to GNULIB_TOOL_FLAGS in WRKSRC/Makefile.in emacs uses
--avoid=threadlib and some system libs (e.g. dbus) bring -lpthread, anyway.

[1] http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=2616a65
[2] http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=commitdiff;h=2909043
[3] nox11 emacs seems to work fine without linking against -lpthread
>How-To-Repeat:
$ emacs -Q -nw /path/to/bsd.port.mk (or any other versioned file)
M-x vc-annotate

  (Annotate [waiting...] from bsd.port.mk)

In my case it permanently waits while consuming 100% cpu in top(1) where
`cvs' process (from `list-processes') has long since exited.
>Fix:
--- pthread_sigmask.diff begins here ---
Index: editors/emacs-devel/Makefile
===================================================================
RCS file: /a/.csup/ports/editors/emacs-devel/Makefile,v
retrieving revision 1.58
diff -u -p -r1.58 Makefile
--- editors/emacs-devel/Makefile	17 Oct 2011 04:55:31 -0000	1.58
+++ editors/emacs-devel/Makefile	22 Oct 2011 21:55:34 -0000
@@ -32,8 +32,8 @@ GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
 USE_NCURSES=	yes
 USE_XZ=		yes
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
+CPPFLAGS+=	-I${LOCALBASE}/include ${PTHREAD_CFLAGS}
+LDFLAGS+=	-L${LOCALBASE}/lib ${PTHREAD_LIBS}
 CONFIGURE_ARGS=	--localstatedir=/var
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
 USE_AUTOTOOLS=	autoconf:env automake:env aclocal:env autoheader:env
--- pthread_sigmask.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list