pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/41603: Making ECL work with threads
>Number: 41603
>Category: pkg
>Synopsis: Making ECL work with threads
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Jun 16 15:20:00 +0000 2009
>Originator: Matthew Mondor
>Release: NetBSD 5.0_STABLE
>Organization:
>Environment:
NetBSD behemoth.xisop 5.0_STABLE NetBSD 5.0_STABLE (GENERIC_MM) #2: Sat Jun 6
12:58:49 EDT 2009
root%behemoth.xisop@localhost:/usr/obj/sys/arch/i386/compile/GENERIC_MM i386
Architecture: i386
Machine: i386
>Description:
ECL is the only implementation of Common Lisp that I know
which can both compile to native code and support threads
on NetBSD so far. I managed to make it work although this
required minor fixes.
>How-To-Repeat:
>Fix:
These diffs were made against pkgsrc-2009Q1 but I verified and both
-current devel/boehm-gc and lang/ecl were the same.
First of all, boehm-gc requires threading support and unfortunately
for some reason it wasn't getting built with it. I propose the
following diff, assuming that the check against darwin was inversed:
Index: Makefile
===================================================================
RCS file: /nfs/ginseng/home/data/cvsup/netbsd/pkgsrc/devel/boehm-gc/Makefile,v
retrieving revision 1.62
diff -u -r1.62 Makefile
--- Makefile 22 May 2008 11:45:25 -0000 1.62
+++ Makefile 13 Jun 2009 21:10:29 -0000
@@ -27,7 +27,7 @@
.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} != "Darwin"
+.if ${OPSYS} == "Darwin"
CONFIGURE_ARGS+= --disable-threads
.endif
Then ecl 8.12.0 required minor modifications to build properly (I
had no luck with wip/ecl, there were other errors), so here is
patch-aa for 2009Q1/current pkgsrc:
--- ./src/c/package.d.orig 2008-12-17 10:41:52.000000000 -0500
+++ ./src/c/package.d 2009-06-16 10:26:24.000000000 -0400
@@ -179,7 +179,7 @@
{
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&x->pack.lock, &attr);
pthread_mutexattr_destroy(&attr);
}
--- ./src/c/threads.d.orig 2008-12-17 10:41:52.000000000 -0500
+++ ./src/c/threads.d 2009-06-16 10:29:10.000000000 -0400
@@ -316,10 +316,10 @@
output->lock.holder = Cnil;
output->lock.counter = 0;
if (recursive == Cnil) {
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
output->lock.recursive = 0;
} else {
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
output->lock.recursive = 1;
}
pthread_mutex_init(&output->lock.mutex, &attr);
@@ -497,7 +497,7 @@
cl_core.processes = OBJNULL;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&cl_core.global_lock, &attr);
pthread_mutexattr_destroy(&attr);
And diff against its pkgsrc stub:
Index: Makefile
===================================================================
RCS file: /nfs/ginseng/home/data/cvsup/netbsd/pkgsrc/lang/ecl/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile 19 Dec 2008 23:12:46 -0000 1.2
+++ Makefile 13 Jun 2009 18:20:24 -0000
@@ -21,6 +21,7 @@
CONFIGURE_ARGS+= --enable-boehm=system
CONFIGURE_ENV+= ECL_BOEHM_GC_HEADER=gc/gc.h
CONFIGURE_ARGS+= --with-system-gmp
+CONFIGURE_ARGS+= --enable-threads=yes
.include "../../devel/boehm-gc/buildlink3.mk"
.include "../../devel/gmp/buildlink3.mk"
Index: distinfo
===================================================================
RCS file: /nfs/ginseng/home/data/cvsup/netbsd/pkgsrc/lang/ecl/distinfo,v
retrieving revision 1.2
diff -u -r1.2 distinfo
--- distinfo 19 Dec 2008 23:12:46 -0000 1.2
+++ distinfo 16 Jun 2009 14:45:30 -0000
@@ -3,3 +3,4 @@
SHA1 (ecl-8.12.0.tar.gz) = dbbf5a8201b0e2b189b575faee8fb0e5bbe64ca2
RMD160 (ecl-8.12.0.tar.gz) = 63c4d93450b1c9abf25da135fafe93ae51eed898
Size (ecl-8.12.0.tar.gz) = 5000878 bytes
+SHA1 (patch-aa) = 8397697375ce8002a594be89f454fa61ec0a8a3c
Using these, ECL builds cleanly with thread support and a few local
tests showed that it works. I'm unsure if this removal of _NP
suffixes could cause problems on other OS like on Linux, however,
but this works fine on netbsd-5.
Thanks
Home |
Main Index |
Thread Index |
Old Index