Subject: pkg/25947: guile is non-threaded, and guile-gtk uses glib which is
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gdt@ir.bbn.com>
List: pkgsrc-bugs
Date: 06/16/2004 13:28:42
>Number:         25947
>Category:       pkg
>Synopsis:       guile is non-threaded, and guile-gtk uses glib which is
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 16 17:29:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Greg Troxel
>Release:        NetBSD current from 20040-2ish
>Organization:
        Greg Troxel <gdt@ir.bbn.com>
>Environment:
	
	
System: NetBSD foobar.ir.bbn.com 1.6ZI NetBSD 1.6ZI (BAZBAM) #5: Tue Jun  1 09:46:59 EDT 2004  root@foobar.ir.bbn.com:/n0/obj/bazbam/gdt/i386/sys/arch/i386/compile/BAZBAM i386
Architecture: i386
Machine: i386
>Description:
guile doesn't include pthread.buildlink3.mk
guile-gtk links with glib (1.2), which is built with threads.
When the guile-gtk code is linked in, the program becomes threaded and
libc functions already loaded do invariant checks for non-threadedness
and lose.

>How-To-Repeat:
$ guile
guile> (use-modules (gtk gtk))

observe core dump and read backtrace.

>Fix:
Apply to pkgsrc/lang/guile (thanks to someone from tech-pkg for the
hint).  I am not sure that setting CFLAGS is actually required.

Index: Makefile
===================================================================
RCS file: /NETBSD-CVS/pkgsrc/lang/guile/Makefile,v
retrieving revision 1.53
diff -u -r1.53 Makefile
--- Makefile	16 May 2004 17:52:11 -0000	1.53
+++ Makefile	16 Jun 2004 12:47:53 -0000
@@ -1,6 +1,7 @@
 # $NetBSD: Makefile,v 1.53 2004/05/16 17:52:11 danw Exp $
 
 DISTNAME=		guile-1.6.4
+PKGREVISION=		1
 CATEGORIES=		lang
 MASTER_SITES=		${MASTER_SITE_GNU:=guile/}
 
@@ -22,6 +23,10 @@
 TEST_DIRS=		${WRKSRC}
 TEST_TARGET=		check
 
+# Link the native thread so that Guile processes won't die when libpthread.so
+# is dl_open(3)'ed.
+CFLAGS+=		${PTHREAD_CFLAGS}
+
 .include "../../mk/bsd.prefs.mk"
 
 .if ${OPSYS} == "Darwin"
@@ -35,4 +40,5 @@
 .include "../../devel/libtool/buildlink3.mk"
 .include "../../devel/ncurses/buildlink3.mk"
 .include "../../devel/readline/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

>Release-Note:
>Audit-Trail:
>Unformatted: