Wed Dec 9 09:23:51 2009 UTC ()
Update to version 1.7.0.

Pkgsrc changes:
 o Adapt the patch to t/op/io.t to a change done upstream slightly
   after 1.7.0 was released.
 o Add a patch which fixes a problem exposed by one of the tests,
   related to library cloning, which caused dlclose() to be called
   twice with the same handle value, ref. Parrot ticket 1340.

Upstream changes:

New in 1.7.0
- Functionality
 + Parrot_capture_lex has been added to the PARROT_EXPORT API
 + PARROT_MAX_ARGS has been increased from 8 to 16 to allow for
   ops that take mo re than 8 args
- Performance
 + The profiling runcore now caches metadata for improved performance
- Maintenance and cleanup
  + Expanded the Parrot debugger documentation
  + Parrot debugger now uses the new Parrot STRING API
  + Continue to port rest of internals to use the STRING API
- Deprecations
 + The JIT subsystem has been removed and is being written from
   the ground up. More information can be found at
   https://trac.parrot.org/parrot/wiki/JITRewrite
 + Implicit optional named parameters (eligible in 2.1)
 + Continuation-based ExceptionHandlers (eligible in 2.1)
 + Use of undocumented variables in class_init (eligible in 2.1)
 + Parrot_oo_get_namespace (eligible in 2.1)
- Bugfix
  + Improved line number tracking in IMCC
- Tests
  + Converted many more Perl 5 tests to PIR
  + Expanded test coverage of the CallSignature, Namespace, FixedPMCArray,
    ResizeableIntegerArray and ExceptionHandler PMCs


(he)
diff -r1.23 -r1.24 pkgsrc/lang/parrot/Makefile
diff -r1.9 -r1.10 pkgsrc/lang/parrot/PLIST
diff -r1.18 -r1.19 pkgsrc/lang/parrot/distinfo
diff -r1.1 -r1.2 pkgsrc/lang/parrot/patches/patch-ai
diff -r0 -r1.1 pkgsrc/lang/parrot/patches/patch-ak

cvs diff -r1.23 -r1.24 pkgsrc/lang/parrot/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/parrot/Makefile 2009/10/21 14:23:13 1.23
+++ pkgsrc/lang/parrot/Makefile 2009/12/09 09:23:50 1.24
@@ -1,18 +1,17 @@ @@ -1,18 +1,17 @@
1# $NetBSD: Makefile,v 1.23 2009/10/21 14:23:13 he Exp $ 1# $NetBSD: Makefile,v 1.24 2009/12/09 09:23:50 he Exp $
2# 2#
3 3
4VERSION= 1.6.0 4VERSION= 1.7.0
5PKGREVISION= 1 
6RTYPE= devel 5RTYPE= devel
7DISTNAME= parrot-${VERSION} 6DISTNAME= parrot-${VERSION}
8CATEGORIES= lang 7CATEGORIES= lang
9MASTER_SITES= ftp://ftp.parrot.org/pub/parrot/releases/${RTYPE}/${VERSION}/ 8MASTER_SITES= ftp://ftp.parrot.org/pub/parrot/releases/${RTYPE}/${VERSION}/
10 9
11MAINTAINER= he@NetBSD.org 10MAINTAINER= he@NetBSD.org
12HOMEPAGE= http://www.parrotcode.org/ 11HOMEPAGE= http://www.parrotcode.org/
13COMMENT= Virtual machine made to run Perl 6 and other languages 12COMMENT= Virtual machine made to run Perl 6 and other languages
14LICENSE= artistic-2.0 13LICENSE= artistic-2.0
15 14
16PKG_DESTDIR_SUPPORT= user-destdir 15PKG_DESTDIR_SUPPORT= user-destdir
17USE_LANGUAGES= c c++ 16USE_LANGUAGES= c c++
18USE_TOOLS+= perl 17USE_TOOLS+= perl

cvs diff -r1.9 -r1.10 pkgsrc/lang/parrot/PLIST (expand / switch to unified diff)

--- pkgsrc/lang/parrot/PLIST 2009/09/20 10:57:04 1.9
+++ pkgsrc/lang/parrot/PLIST 2009/12/09 09:23:50 1.10
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1@comment $NetBSD: PLIST,v 1.9 2009/09/20 10:57:04 he Exp $ 1@comment $NetBSD: PLIST,v 1.10 2009/12/09 09:23:50 he Exp $
2bin/parrot 2bin/parrot
3bin/parrot_config 3bin/parrot_config
4bin/parrot_debugger 4bin/parrot_debugger
5bin/pbc_disassemble 5bin/pbc_disassemble
6bin/pbc_dump 6bin/pbc_dump
7bin/pbc_merge 7bin/pbc_merge
8bin/pbc_to_exe 8bin/pbc_to_exe
9include/parrot/${PKGVERSION}/parrot/atomic.h 9include/parrot/${PKGVERSION}/parrot/atomic.h
10include/parrot/${PKGVERSION}/parrot/atomic/fallback.h 10include/parrot/${PKGVERSION}/parrot/atomic/fallback.h
11include/parrot/${PKGVERSION}/parrot/atomic/gcc_pcc.h 11include/parrot/${PKGVERSION}/parrot/atomic/gcc_pcc.h
12include/parrot/${PKGVERSION}/parrot/atomic/gcc_x86.h 12include/parrot/${PKGVERSION}/parrot/atomic/gcc_x86.h
13include/parrot/${PKGVERSION}/parrot/atomic/sparc.h 13include/parrot/${PKGVERSION}/parrot/atomic/sparc.h
14include/parrot/${PKGVERSION}/parrot/caches.h 14include/parrot/${PKGVERSION}/parrot/caches.h
@@ -18,27 +18,26 @@ include/parrot/${PKGVERSION}/parrot/char @@ -18,27 +18,26 @@ include/parrot/${PKGVERSION}/parrot/char
18include/parrot/${PKGVERSION}/parrot/compiler.h 18include/parrot/${PKGVERSION}/parrot/compiler.h
19include/parrot/${PKGVERSION}/parrot/config.h 19include/parrot/${PKGVERSION}/parrot/config.h
20include/parrot/${PKGVERSION}/parrot/context.h 20include/parrot/${PKGVERSION}/parrot/context.h
21include/parrot/${PKGVERSION}/parrot/core_pmcs.h 21include/parrot/${PKGVERSION}/parrot/core_pmcs.h
22include/parrot/${PKGVERSION}/parrot/core_types.h 22include/parrot/${PKGVERSION}/parrot/core_types.h
23include/parrot/${PKGVERSION}/parrot/datatypes.h 23include/parrot/${PKGVERSION}/parrot/datatypes.h
24include/parrot/${PKGVERSION}/parrot/debugger.h 24include/parrot/${PKGVERSION}/parrot/debugger.h
25include/parrot/${PKGVERSION}/parrot/dynext.h 25include/parrot/${PKGVERSION}/parrot/dynext.h
26include/parrot/${PKGVERSION}/parrot/embed.h 26include/parrot/${PKGVERSION}/parrot/embed.h
27include/parrot/${PKGVERSION}/parrot/encoding.h 27include/parrot/${PKGVERSION}/parrot/encoding.h
28include/parrot/${PKGVERSION}/parrot/enums.h 28include/parrot/${PKGVERSION}/parrot/enums.h
29include/parrot/${PKGVERSION}/parrot/events.h 29include/parrot/${PKGVERSION}/parrot/events.h
30include/parrot/${PKGVERSION}/parrot/exceptions.h 30include/parrot/${PKGVERSION}/parrot/exceptions.h
31include/parrot/${PKGVERSION}/parrot/exec.h 
32include/parrot/${PKGVERSION}/parrot/exit.h 31include/parrot/${PKGVERSION}/parrot/exit.h
33include/parrot/${PKGVERSION}/parrot/extend.h 32include/parrot/${PKGVERSION}/parrot/extend.h
34include/parrot/${PKGVERSION}/parrot/extend_vtable.h 33include/parrot/${PKGVERSION}/parrot/extend_vtable.h
35include/parrot/${PKGVERSION}/parrot/feature.h 34include/parrot/${PKGVERSION}/parrot/feature.h
36include/parrot/${PKGVERSION}/parrot/gc_api.h 35include/parrot/${PKGVERSION}/parrot/gc_api.h
37include/parrot/${PKGVERSION}/parrot/global.h 36include/parrot/${PKGVERSION}/parrot/global.h
38include/parrot/${PKGVERSION}/parrot/global_setup.h 37include/parrot/${PKGVERSION}/parrot/global_setup.h
39include/parrot/${PKGVERSION}/parrot/has_header.h 38include/parrot/${PKGVERSION}/parrot/has_header.h
40include/parrot/${PKGVERSION}/parrot/hash.h 39include/parrot/${PKGVERSION}/parrot/hash.h
41include/parrot/${PKGVERSION}/parrot/hll.h 40include/parrot/${PKGVERSION}/parrot/hll.h
42include/parrot/${PKGVERSION}/parrot/imcc.h 41include/parrot/${PKGVERSION}/parrot/imcc.h
43include/parrot/${PKGVERSION}/parrot/interpreter.h 42include/parrot/${PKGVERSION}/parrot/interpreter.h
44include/parrot/${PKGVERSION}/parrot/io.h 43include/parrot/${PKGVERSION}/parrot/io.h
@@ -54,27 +53,26 @@ include/parrot/${PKGVERSION}/parrot/misc @@ -54,27 +53,26 @@ include/parrot/${PKGVERSION}/parrot/misc
54include/parrot/${PKGVERSION}/parrot/multidispatch.h 53include/parrot/${PKGVERSION}/parrot/multidispatch.h
55include/parrot/${PKGVERSION}/parrot/nci.h 54include/parrot/${PKGVERSION}/parrot/nci.h
56include/parrot/${PKGVERSION}/parrot/oo.h 55include/parrot/${PKGVERSION}/parrot/oo.h
57include/parrot/${PKGVERSION}/parrot/oo_private.h 56include/parrot/${PKGVERSION}/parrot/oo_private.h
58include/parrot/${PKGVERSION}/parrot/op.h 57include/parrot/${PKGVERSION}/parrot/op.h
59include/parrot/${PKGVERSION}/parrot/oplib.h 58include/parrot/${PKGVERSION}/parrot/oplib.h
60include/parrot/${PKGVERSION}/parrot/oplib/core_ops.h 59include/parrot/${PKGVERSION}/parrot/oplib/core_ops.h
61include/parrot/${PKGVERSION}/parrot/oplib/core_ops_cg.h 60include/parrot/${PKGVERSION}/parrot/oplib/core_ops_cg.h
62include/parrot/${PKGVERSION}/parrot/oplib/core_ops_cgp.h 61include/parrot/${PKGVERSION}/parrot/oplib/core_ops_cgp.h
63include/parrot/${PKGVERSION}/parrot/oplib/core_ops_switch.h 62include/parrot/${PKGVERSION}/parrot/oplib/core_ops_switch.h
64include/parrot/${PKGVERSION}/parrot/oplib/ops.h 63include/parrot/${PKGVERSION}/parrot/oplib/ops.h
65include/parrot/${PKGVERSION}/parrot/packfile.h 64include/parrot/${PKGVERSION}/parrot/packfile.h
66include/parrot/${PKGVERSION}/parrot/parrot.h 65include/parrot/${PKGVERSION}/parrot/parrot.h
67include/parrot/${PKGVERSION}/parrot/pic.h 
68include/parrot/${PKGVERSION}/parrot/platform.h 66include/parrot/${PKGVERSION}/parrot/platform.h
69include/parrot/${PKGVERSION}/parrot/platform_interface.h 67include/parrot/${PKGVERSION}/parrot/platform_interface.h
70include/parrot/${PKGVERSION}/parrot/pmc.h 68include/parrot/${PKGVERSION}/parrot/pmc.h
71include/parrot/${PKGVERSION}/parrot/pmc_freeze.h 69include/parrot/${PKGVERSION}/parrot/pmc_freeze.h
72include/parrot/${PKGVERSION}/parrot/pobj.h 70include/parrot/${PKGVERSION}/parrot/pobj.h
73include/parrot/${PKGVERSION}/parrot/runcore_api.h 71include/parrot/${PKGVERSION}/parrot/runcore_api.h
74include/parrot/${PKGVERSION}/parrot/runcore_profiling.h 72include/parrot/${PKGVERSION}/parrot/runcore_profiling.h
75include/parrot/${PKGVERSION}/parrot/runcore_trace.h 73include/parrot/${PKGVERSION}/parrot/runcore_trace.h
76include/parrot/${PKGVERSION}/parrot/scheduler.h 74include/parrot/${PKGVERSION}/parrot/scheduler.h
77include/parrot/${PKGVERSION}/parrot/scheduler_private.h 75include/parrot/${PKGVERSION}/parrot/scheduler_private.h
78include/parrot/${PKGVERSION}/parrot/settings.h 76include/parrot/${PKGVERSION}/parrot/settings.h
79include/parrot/${PKGVERSION}/parrot/slice.h 77include/parrot/${PKGVERSION}/parrot/slice.h
80include/parrot/${PKGVERSION}/parrot/stat.h 78include/parrot/${PKGVERSION}/parrot/stat.h
@@ -283,27 +281,26 @@ share/doc/parrot/${PKGVERSION}/PBC_COMPA @@ -283,27 +281,26 @@ share/doc/parrot/${PKGVERSION}/PBC_COMPA
283share/doc/parrot/${PKGVERSION}/RESPONSIBLE_PARTIES 281share/doc/parrot/${PKGVERSION}/RESPONSIBLE_PARTIES
284share/doc/parrot/${PKGVERSION}/pod/faq.pod 282share/doc/parrot/${PKGVERSION}/pod/faq.pod
285share/doc/parrot/${PKGVERSION}/pod/gettingstarted.pod 283share/doc/parrot/${PKGVERSION}/pod/gettingstarted.pod
286share/doc/parrot/${PKGVERSION}/pod/glossary.pod 284share/doc/parrot/${PKGVERSION}/pod/glossary.pod
287share/doc/parrot/${PKGVERSION}/pod/intro.pod 285share/doc/parrot/${PKGVERSION}/pod/intro.pod
288share/doc/parrot/${PKGVERSION}/pod/ops/bit.pod 286share/doc/parrot/${PKGVERSION}/pod/ops/bit.pod
289share/doc/parrot/${PKGVERSION}/pod/ops/cmp.pod 287share/doc/parrot/${PKGVERSION}/pod/ops/cmp.pod
290share/doc/parrot/${PKGVERSION}/pod/ops/core.pod 288share/doc/parrot/${PKGVERSION}/pod/ops/core.pod
291share/doc/parrot/${PKGVERSION}/pod/ops/debug.pod 289share/doc/parrot/${PKGVERSION}/pod/ops/debug.pod
292share/doc/parrot/${PKGVERSION}/pod/ops/experimental.pod 290share/doc/parrot/${PKGVERSION}/pod/ops/experimental.pod
293share/doc/parrot/${PKGVERSION}/pod/ops/io.pod 291share/doc/parrot/${PKGVERSION}/pod/ops/io.pod
294share/doc/parrot/${PKGVERSION}/pod/ops/math.pod 292share/doc/parrot/${PKGVERSION}/pod/ops/math.pod
295share/doc/parrot/${PKGVERSION}/pod/ops/object.pod 293share/doc/parrot/${PKGVERSION}/pod/ops/object.pod
296share/doc/parrot/${PKGVERSION}/pod/ops/pic.pod 
297share/doc/parrot/${PKGVERSION}/pod/ops/pmc.pod 294share/doc/parrot/${PKGVERSION}/pod/ops/pmc.pod
298share/doc/parrot/${PKGVERSION}/pod/ops/set.pod 295share/doc/parrot/${PKGVERSION}/pod/ops/set.pod
299share/doc/parrot/${PKGVERSION}/pod/ops/string.pod 296share/doc/parrot/${PKGVERSION}/pod/ops/string.pod
300share/doc/parrot/${PKGVERSION}/pod/ops/sys.pod 297share/doc/parrot/${PKGVERSION}/pod/ops/sys.pod
301share/doc/parrot/${PKGVERSION}/pod/ops/var.pod 298share/doc/parrot/${PKGVERSION}/pod/ops/var.pod
302share/doc/parrot/${PKGVERSION}/pod/pmc/array.pod 299share/doc/parrot/${PKGVERSION}/pod/pmc/array.pod
303share/doc/parrot/${PKGVERSION}/pod/pmc/documentation.pod 300share/doc/parrot/${PKGVERSION}/pod/pmc/documentation.pod
304share/doc/parrot/${PKGVERSION}/pod/pmc/struct.pod 301share/doc/parrot/${PKGVERSION}/pod/pmc/struct.pod
305share/doc/parrot/${PKGVERSION}/pod/pmc/subs.pod 302share/doc/parrot/${PKGVERSION}/pod/pmc/subs.pod
306share/doc/parrot/${PKGVERSION}/pod/user/pir/exceptions.pod 303share/doc/parrot/${PKGVERSION}/pod/user/pir/exceptions.pod
307share/doc/parrot/${PKGVERSION}/pod/user/pir/intro.pod 304share/doc/parrot/${PKGVERSION}/pod/user/pir/intro.pod
308share/doc/parrot/${PKGVERSION}/pod/user/pir/objects.pod 305share/doc/parrot/${PKGVERSION}/pod/user/pir/objects.pod
309share/doc/parrot/${PKGVERSION}/pod/user/pir/pmcs.pod 306share/doc/parrot/${PKGVERSION}/pod/user/pir/pmcs.pod

cvs diff -r1.18 -r1.19 pkgsrc/lang/parrot/distinfo (expand / switch to unified diff)

--- pkgsrc/lang/parrot/distinfo 2009/10/22 11:31:44 1.18
+++ pkgsrc/lang/parrot/distinfo 2009/12/09 09:23:50 1.19
@@ -1,11 +1,12 @@ @@ -1,11 +1,12 @@
1$NetBSD: distinfo,v 1.18 2009/10/22 11:31:44 he Exp $ 1$NetBSD: distinfo,v 1.19 2009/12/09 09:23:50 he Exp $
2 2
3SHA1 (parrot-1.6.0.tar.gz) = 2258c3a0da32ed8c1ce55ee460e81a841d06a2c1 3SHA1 (parrot-1.7.0.tar.gz) = 68e4b330f879549f920497332754ebf651c7e82e
4RMD160 (parrot-1.6.0.tar.gz) = ca5907643a9e972971daac51afd1b95a30103fa5 4RMD160 (parrot-1.7.0.tar.gz) = 11831164b7c203ee83fb911b84c94873ea112fcc
5Size (parrot-1.6.0.tar.gz) = 3977952 bytes 5Size (parrot-1.7.0.tar.gz) = 3810349 bytes
6SHA1 (patch-ad) = 9002a7ca55f8f960bea669e383431b3eeb83a878 6SHA1 (patch-ad) = 9002a7ca55f8f960bea669e383431b3eeb83a878
7SHA1 (patch-ae) = 72e4752112dab2f0b72ede5c45b77fd5b5554606 7SHA1 (patch-ae) = 72e4752112dab2f0b72ede5c45b77fd5b5554606
8SHA1 (patch-af) = f2d67ac311aec9960a47b54eacdc8b72e83521eb 8SHA1 (patch-af) = f2d67ac311aec9960a47b54eacdc8b72e83521eb
9SHA1 (patch-ag) = 7a43d15e4e6fb76d4c4619affee4c3c8e0dd3444 9SHA1 (patch-ag) = 7a43d15e4e6fb76d4c4619affee4c3c8e0dd3444
10SHA1 (patch-ai) = 7430f01b99ed95996e5c76c2ffdc8122084bb822 10SHA1 (patch-ai) = c4b610754c00bd5e2dcf2df7b730aa96bb69da5a
11SHA1 (patch-aj) = df1d64aa5a3b5f3ed7389a72a855baa14dc7df38 11SHA1 (patch-aj) = df1d64aa5a3b5f3ed7389a72a855baa14dc7df38
 12SHA1 (patch-ak) = 2caa175c26fcf717f6377fadd04b74a7c9cf750d

cvs diff -r1.1 -r1.2 pkgsrc/lang/parrot/patches/Attic/patch-ai (expand / switch to unified diff)

--- pkgsrc/lang/parrot/patches/Attic/patch-ai 2009/10/21 14:23:13 1.1
+++ pkgsrc/lang/parrot/patches/Attic/patch-ai 2009/12/09 09:23:51 1.2
@@ -1,62 +1,50 @@ @@ -1,62 +1,50 @@
1$NetBSD: patch-ai,v 1.1 2009/10/21 14:23:13 he Exp $ 1$NetBSD: patch-ai,v 1.2 2009/12/09 09:23:51 he Exp $
2 2
3I beleive this test works for all relevant pkgsrc platforms. 3Mirror a change committed just after the release: the open_pipe_for_writing
4It has been similarly transformed upstream after 1.7.0 was released. 4test should work everywhere.
5 5
6--- t/op/io.t.orig 2008-12-18 06:19:20.000000000 +0100 6--- t/op/io.t.orig 2009-10-20 23:30:03.000000000 +0200
7+++ t/op/io.t 7+++ t/op/io.t
8@@ -51,28 +51,9 @@ Tests various io opcodes. 8@@ -51,22 +51,6 @@ Tests various io opcodes.
9 ok(1, 'open with null mode') 9 ok(1, 'open with null mode')
10 .end 10 .end
11  11
12-.sub 'tt661_todo_test' :anon 12-.sub 'tt661_todo_test' :anon
13- # Checks whether the platform is linux, MSWin32, darwin: on other 13- # Checks whether the platform is linux, MSWin32, darwin: on other
14- # platforms, the following tests are todo'ed. 14- # platforms, the following tests are todo'ed.
15- .include 'sysinfo.pasm' 15- .include 'sysinfo.pasm'
16- $S0 = sysinfo .SYSINFO_PARROT_OS 16- $S0 = sysinfo .SYSINFO_PARROT_OS
17- if $S0 == 'linux' goto tt661_ok 17- if $S0 == 'linux' goto tt661_ok
18- if $S0 == 'MSWin32' goto tt661_ok 18-# if $S0 == 'MSWin32' goto tt661_ok
19- if $S0 == 'darwin' goto tt661_ok 19- if $S0 == 'darwin' goto tt661_ok
20- if $S0 == 'openbsd' goto tt661_ok 20- if $S0 == 'openbsd' goto tt661_ok
21- 21-
22- .return (0) 22- .return (0)
23- 23-
24- tt661_ok: 24- tt661_ok:
25- .return (1) 25- .return (1)
26-.end 26-.end
27- 27-
28 .include 'iglobals.pasm' 28 .include 'iglobals.pasm'
29  29
30 .sub 'open_pipe_for_reading' 30 .sub 'open_pipe_for_reading'
31- $I0 = tt661_todo_test() 31@@ -103,8 +87,6 @@ Tests various io opcodes.
32- unless $I0 goto open_pipe_for_reading_todoed 
33- 
34 .local pmc interp 
35 interp = getinterp 
36  
37@@ -103,15 +84,9 @@ Tests various io opcodes. 
38 open_pipe_for_reading_failed: 
39 nok(1, 'open pipe for reading') 
40 .return () 
41- 
42- open_pipe_for_reading_todoed: 
43- todo(1, 'Unimplemented in this platform, TT #661') 
44 .end 32 .end
45  33
46 .sub 'open_pipe_for_writing' 34 .sub 'open_pipe_for_writing'
47- $I0 = tt661_todo_test() 35- $I0 = tt661_todo_test()
48- unless $I0 goto open_pipe_for_writing_todoed 36- unless $I0 goto open_pipe_for_writing_todoed
49- 
50 .local pmc interp 37 .local pmc interp
51 interp = getinterp 38 interp = getinterp
52  39
53@@ -144,9 +119,6 @@ Tests various io opcodes. 40@@ -137,10 +119,6 @@ Tests various io opcodes.
54 open_pipe_for_writing_failed: 41 open_pipe_for_writing_failed:
55 nok(1, 'open pipe for writing') 42 nok(1, 'open pipe for writing')
56 .return () 43 .return ()
57- 44-
58- open_pipe_for_writing_todoed: 45- open_pipe_for_writing_todoed:
59- todo(1, 'Unimplemented in this platform, TT #661') 46- todo(1, 'Unimplemented in this platform, TT #661')
 47-
60 .end 48 .end
61  49
62 # Local Variables: 50 # Local Variables:

File Added: pkgsrc/lang/parrot/patches/Attic/patch-ak
$NetBSD: patch-ak,v 1.1 2009/12/09 09:23:51 he Exp $

Prevent problem exposed by "library cloning", where the dlopen()-returned
handle is copied, causing dlclose() to be called twice with the same handle,
which in turn triggers a warning from ld.elf_so on NetBSD.  Ref.
http://trac.parrot.org/parrot/ticket/1340.

Index: config/gen/platform/generic/dl.c
===================================================================
--- config/gen/platform/generic/dl.c	(revision 42823)
+++ config/gen/platform/generic/dl.c	(working copy)
@@ -22,11 +22,69 @@
 */
 
 #ifdef PARROT_HAS_HEADER_DLFCN
+#  include <stddef.h>
+#  include <stdlib.h>
 #  include <dlfcn.h>
 #endif
 
 #define PARROT_DLOPEN_FLAGS RTLD_LAZY
 
+#ifdef PARROT_HAS_HEADER_DLFCN
+
+struct handle_entry {
+    void *handle;
+    struct handle_entry *next;
+};
+
+struct handle_entry *handle_list = NULL;
+
+static void
+push_handle_entry(void *handle)
+{
+    struct handle_entry *e;
+
+    e = malloc(sizeof(struct handle_entry));
+    if (!e) { return; }
+    e->handle = handle;
+    e->next = handle_list;
+    handle_list = e;
+}
+
+static void *
+find_handle_entry(void *handle)
+{
+    struct handle_entry *e;
+
+    for(e = handle_list; e; e = e->next) {
+	if (e->handle == handle)
+	    return handle;
+    }
+    return NULL;
+}
+
+static void
+remove_handle_entry(void *handle)
+{
+    struct handle_entry *cur, *prev, *p;
+
+    if (handle_list) {
+	if (handle_list->handle == handle) {
+	    p = handle_list;
+	    handle_list = p->next;
+	    free(p);
+	} else {
+	    for (cur = handle_list; cur; prev = cur, cur = cur->next) {
+		if (cur->handle == handle) {
+		    prev->next = cur->next;
+		    free(cur);
+		}
+	    }
+	}
+    }
+}
+#endif /* PARROT_HAS_HEADER_DLFCN */
+
+
 /*
 
 =item C<void * Parrot_dlopen(const char *filename)>
@@ -39,7 +97,11 @@
 Parrot_dlopen(const char *filename)
 {
 #ifdef PARROT_HAS_HEADER_DLFCN
-    return dlopen(filename, PARROT_DLOPEN_FLAGS);
+    void *h;
+
+    h = dlopen(filename, PARROT_DLOPEN_FLAGS);
+    push_handle_entry(h);
+    return h;
 #else
     return 0;
 #endif
@@ -93,7 +155,13 @@
 Parrot_dlclose(void *handle)
 {
 #ifdef PARROT_HAS_HEADER_DLFCN
-    return dlclose(handle);
+    int rv;
+
+    if (find_handle_entry(handle)) {
+	remove_handle_entry(handle);
+	rv = dlclose(handle);
+	return rv;
+    }
 #else
     return -1;
 #endif