pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 Add patches to gmodule so that RTLD_DEFAUL...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c9bc0d6f02b3
branches:  trunk
changeset: 572010:c9bc0d6f02b3
user:      roy <roy%pkgsrc.org@localhost>
date:      Fri Feb 19 11:44:56 2010 +0000

description:
Add patches to gmodule so that RTLD_DEFAULT is used on platforms that
define it and g_module_unload symbols are only resolved in the module
and not any dependencies.

diffstat:

 devel/glib2/Makefile         |   3 +-
 devel/glib2/distinfo         |   4 ++-
 devel/glib2/patches/patch-am |  53 ++++++++++++++++++++++++++++++++++++++++++++
 devel/glib2/patches/patch-an |  24 +++++++++++++++++++
 4 files changed, 82 insertions(+), 2 deletions(-)

diffs (118 lines):

diff -r 1939a9e12597 -r c9bc0d6f02b3 devel/glib2/Makefile
--- a/devel/glib2/Makefile      Fri Feb 19 10:17:33 2010 +0000
+++ b/devel/glib2/Makefile      Fri Feb 19 11:44:56 2010 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.169 2010/01/18 18:15:46 drochner Exp $
+# $NetBSD: Makefile,v 1.170 2010/02/19 11:44:56 roy Exp $
 
 # When updating glib2, please apply patch-ak to configure.in
 # Then run a matching version of autoconf to regen patch-aa.
 DISTNAME=              glib-2.22.4
 PKGNAME=               ${DISTNAME:S/glib/glib2/}
+PKGREVISION=           1
 CATEGORIES=            devel
 MASTER_SITES=          ftp://ftp.gtk.org/pub/glib/2.22/ \
                        ${MASTER_SITE_GNOME:=sources/glib/2.22/}
diff -r 1939a9e12597 -r c9bc0d6f02b3 devel/glib2/distinfo
--- a/devel/glib2/distinfo      Fri Feb 19 10:17:33 2010 +0000
+++ b/devel/glib2/distinfo      Fri Feb 19 11:44:56 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.127 2010/01/18 18:15:46 drochner Exp $
+$NetBSD: distinfo,v 1.128 2010/02/19 11:44:56 roy Exp $
 
 SHA1 (glib-2.22.4.tar.bz2) = be135a25c233a199f043161777d31ac30e42f435
 RMD160 (glib-2.22.4.tar.bz2) = 66dc6ec0f1b1d422f50f6d55700bee8d526318cc
@@ -15,6 +15,8 @@
 SHA1 (patch-aj) = 9e5a7ccf081e3ebdf7888a67b027b696f632177c
 SHA1 (patch-ak) = 04e3d1eb9648186776dee81d2db9507c0df0c62e
 SHA1 (patch-al) = 6c8b7c569fb5fae5eff719ebd2925d79f5df3b2e
+SHA1 (patch-am) = 68a86d0d20a41780a534d51065ff77cd7de33ab9
+SHA1 (patch-an) = d5b3d97b5746b5fb932db45b194cf89224e63801
 SHA1 (patch-ba) = b235c2037bce84e0cdd9c87abaac274550ec0c95
 SHA1 (patch-cb) = 0f084c33fb67fbb8e12448034450699da26289ff
 SHA1 (patch-cc) = dd73079b727bca9013465204dc3b53b76a280e54
diff -r 1939a9e12597 -r c9bc0d6f02b3 devel/glib2/patches/patch-am
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/glib2/patches/patch-am      Fri Feb 19 11:44:56 2010 +0000
@@ -0,0 +1,53 @@
+$NetBSD: patch-am,v 1.3 2010/02/19 11:44:56 roy Exp $
+
+We should only check the module itself for g_module_check_init and
+g_module_unload functions.
+
+This also makes loading a module a lot faster if these functions do
+not exist and the module as a lot of dependencies.
+
+--- gmodule/gmodule.c  2010-02-18 19:59:34.000000000 +0000
++++ gmodule/gmodule.c  2010-02-18 20:18:06.000000000 +0000
+@@ -474,25 +474,33 @@
+       module->cp_file_name = g_locale_from_utf8 (file_name, -1,
+                                                NULL, NULL, NULL);
+ #endif
+-      module->handle = handle;
++      /* we set RTLD_NEXT so we only load private functions from
++       * the module and not any dependencies */
++      module->handle = RTLD_NEXT;
+       module->ref_count = 1;
+       module->is_resident = FALSE;
+       module->unload = NULL;
+       module->next = modules;
+       modules = module;
++     
++      /* load private functions */
++      g_module_symbol (module, "g_module_check_init", (gpointer) &check_init);
++      g_module_symbol (module, "g_module_unload", (gpointer) &module->unload);
++
++      /* now set the real handle */
++      module->handle = handle;
+       
+       /* check initialization */
+-      if (g_module_symbol (module, "g_module_check_init", (gpointer) &check_init) && check_init != NULL)
+-      check_failed = check_init (module);
+-      
+-      /* we don't call unload() if the initialization check failed. */
+-      if (!check_failed)
+-      g_module_symbol (module, "g_module_unload", (gpointer) &module->unload);
+-      
+-      if (check_failed)
++      if (check_init != NULL)
++        check_failed = check_init(module);
++
++      if (check_failed != NULL)
+       {
+         gchar *error;
+ 
++          /* we don't call unload() if the initialization check failed. */
++        module->unload = NULL;
++
+         error = g_strconcat ("GModule (", 
+                                file_name ? file_name : "NULL", 
+                                ") initialization check failed: ", 
diff -r 1939a9e12597 -r c9bc0d6f02b3 devel/glib2/patches/patch-an
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/glib2/patches/patch-an      Fri Feb 19 11:44:56 2010 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-an,v 1.1 2010/02/19 11:44:56 roy Exp $
+
+Use RTLD_DEFAULT if the platform defines it.
+
+--- gmodule/gmodule-dl.c       2009-04-01 00:04:20.000000000 +0100
++++ gmodule/gmodule-dl.c       2010-02-19 07:13:26.000000000 +0000
+@@ -107,6 +107,9 @@
+ static gpointer
+ _g_module_self (void)
+ {
++#ifdef RTLD_DEFAULT
++  return RTLD_DEFAULT;
++#else
+   gpointer handle;
+   
+   /* to query symbols from the program itself, special link options
+@@ -118,6 +121,7 @@
+     g_module_set_error (fetch_dlerror (TRUE));
+   
+   return handle;
++#endif
+ }
+ 
+ static void



Home | Main Index | Thread Index | Old Index