Subject: Re: remaining issues with gnome-2.20
To: Julio M. Merino Vidal <jmmv84@gmail.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-pkg
Date: 11/03/2007 16:18:28
This is a multipart MIME message.

--==_Exmh_28456335000
Content-Type: text/plain; charset=us-ascii


M.Drochner@fz-juelich.de said:
> The problem is that your patch does only fix the case of symbols
> residing in dlopen'd modules but not that of symbols residing in
> libraries loaded by dlopen'd modules. I can't imagine a solution for
> that which is not a disgusting hack. 

There might be a workaround: use the RTLD_DEFAULT pseudo-handle
(which is "reserved" in SUSv3, but works in NetBSD). See the
appended patch.
What do you think?

best regards
Matthias





-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. 
Vorsitzender)
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------

--==_Exmh_28456335000
Content-Type: text/plain ; name="dlsym.txt"; charset=us-ascii
Content-Description: dlsym.txt
Content-Disposition: attachment; filename="dlsym.txt"

Index: patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/devel/glib2/patches/patch-ab,v
retrieving revision 1.11
diff -u -r1.11 patch-ab
--- patches/patch-ab	2 Mar 2005 15:38:08 -0000	1.11
+++ patches/patch-ab	3 Nov 2007 15:14:15 -0000
@@ -1,10 +1,10 @@
-$NetBSD: patch-ab,v 1.11 2005/03/02 15:38:08 wiz Exp $
+$NetBSD$
 
 http://bugzilla.gnome.org/show_bug.cgi?id=140329
 
---- gmodule/gmodule.c.orig	2005-01-02 17:03:56.000000000 +0100
+--- gmodule/gmodule.c.orig	2007-10-16 07:44:43.000000000 +0200
 +++ gmodule/gmodule.c
-@@ -560,6 +560,24 @@ g_module_error (void)
+@@ -599,6 +599,31 @@ g_module_error (void)
    return g_static_private_get (&module_error_private);
  }
  
@@ -13,23 +13,30 @@
 +		     const gchar	*symbol_name,
 +		     gpointer		*symbol)
 +{
++  gpointer hdl = module->handle;
++#if defined (G_MODULE_BROKEN_DLOPEN_NULL) && defined(__NetBSD__) && defined(RTLD_DEFAULT)
++  /* use some special handle to access global namespace */
++  if (module == main_module)
++    hdl = RTLD_DEFAULT;
++#endif
++
 +#ifdef	G_MODULE_NEED_USCORE
 +  {
 +    gchar *name;
 +
 +    name = g_strconcat ("_", symbol_name, NULL);
-+    *symbol = _g_module_symbol (module->handle, name);
++    *symbol = _g_module_symbol (hdl, name);
 +    g_free (name);
 +  }
 +#else	/* !G_MODULE_NEED_USCORE */
-+  *symbol = _g_module_symbol (module->handle, symbol_name);
++  *symbol = _g_module_symbol (hdl, symbol_name);
 +#endif	/* !G_MODULE_NEED_USCORE */
 +}
 +
  gboolean
  g_module_symbol (GModule	*module,
  		 const gchar	*symbol_name,
-@@ -577,17 +595,28 @@ g_module_symbol (GModule	*module,
+@@ -616,17 +641,28 @@ g_module_symbol (GModule	*module,
    
    g_static_rec_mutex_lock (&g_module_global_lock);
  

--==_Exmh_28456335000--