pkgsrc-Changes archive

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

CVS commit: pkgsrc/devel/glib2



Module Name:    pkgsrc
Committed By:   prlw1
Date:           Wed Jun 30 14:26:11 UTC 2021

Modified Files:
        pkgsrc/devel/glib2: Makefile distinfo
Added Files:
        pkgsrc/devel/glib2/patches: patch-gmodule_gmodule-dl.c
            patch-gmodule_gmodule.c

Log Message:
Re-add patches I wrote in October 2018:

    glib2's gobject subsystem is essentially a wrapper for dlopen. In
    view of comments in PR lib/49791 which can be summarised as
    "RTLD_GLOBAL is a bug", make gobject use RTLD_DEFAULT instead.

This should fix PR pkg/56212

The upstream merge request

    https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2171

has been updated - feel free to add a description of the problems you
experienced without this patch to it.


To generate a diff of this commit:
cvs rdiff -u -r1.281 -r1.282 pkgsrc/devel/glib2/Makefile
cvs rdiff -u -r1.287 -r1.288 pkgsrc/devel/glib2/distinfo
cvs rdiff -u -r0 -r1.3 pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c \
    pkgsrc/devel/glib2/patches/patch-gmodule_gmodule.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/glib2/Makefile
diff -u pkgsrc/devel/glib2/Makefile:1.281 pkgsrc/devel/glib2/Makefile:1.282
--- pkgsrc/devel/glib2/Makefile:1.281   Tue Apr 13 19:22:14 2021
+++ pkgsrc/devel/glib2/Makefile Wed Jun 30 14:26:11 2021
@@ -1,5 +1,6 @@
-# $NetBSD: Makefile,v 1.281 2021/04/13 19:22:14 adam Exp $
+# $NetBSD: Makefile,v 1.282 2021/06/30 14:26:11 prlw1 Exp $
 
+PKGREVISION=   1
 .include "Makefile.common"
 
 CATEGORIES=    devel gnome

Index: pkgsrc/devel/glib2/distinfo
diff -u pkgsrc/devel/glib2/distinfo:1.287 pkgsrc/devel/glib2/distinfo:1.288
--- pkgsrc/devel/glib2/distinfo:1.287   Fri Jun 25 07:23:19 2021
+++ pkgsrc/devel/glib2/distinfo Wed Jun 30 14:26:11 2021
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.287 2021/06/25 07:23:19 adam Exp $
+$NetBSD: distinfo,v 1.288 2021/06/30 14:26:11 prlw1 Exp $
 
 SHA1 (glib-2.68.3.tar.xz) = aa1e007c1e6340981c0c8f6d715b63d37b3cfaea
 RMD160 (glib-2.68.3.tar.xz) = 2e4d20249d9db0c108596db4e7691eb389bb9666
@@ -23,6 +23,8 @@ SHA1 (patch-glib_meson.build) = 65cbe6e3
 SHA1 (patch-glib_tests_hash.c) = a7e19ca55fcbbc0b188c34755cae5b6b65b67f1a
 SHA1 (patch-glib_tests_include.c) = 12d98caebfb87c1146821d518c37c45f97fc7be0
 SHA1 (patch-glib_tests_meson.build) = d358bd579eb09655c608106092bdeed8f16ff4d0
+SHA1 (patch-gmodule_gmodule-dl.c) = 7a179e4ae0fabb0e807bf061b06111ac910a8d82
+SHA1 (patch-gmodule_gmodule.c) = a020920b8e5bad34550c9963eb2fc27bef24c5c9
 SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d
 SHA1 (patch-gobject_meson.build) = 412b65558aa4cf9648ee84a57ad6dfcc988b1a1d
 SHA1 (patch-meson.build) = f186c7e8ab2c5ba779a1227ae75b15adc0ea17f9

Added files:

Index: pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c
diff -u /dev/null pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c:1.3
--- /dev/null   Wed Jun 30 14:26:11 2021
+++ pkgsrc/devel/glib2/patches/patch-gmodule_gmodule-dl.c       Wed Jun 30 14:26:11 2021
@@ -0,0 +1,45 @@
+$NetBSD: patch-gmodule_gmodule-dl.c,v 1.3 2021/06/30 14:26:11 prlw1 Exp $
+
+RTL_GLOBAL is a bug.
+https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2171
+
+--- gmodule/gmodule-dl.c.orig  2021-06-10 18:57:57.268194400 +0000
++++ gmodule/gmodule-dl.c
+@@ -106,36 +106,13 @@ _g_module_open (const gchar *file_name,
+ static gpointer
+ _g_module_self (void)
+ {
+-  gpointer handle;
+-  
+-  /* to query symbols from the program itself, special link options
+-   * are required on some systems.
+-   */
+-
+-  /* On Android 32 bit (i.e. not __LP64__), dlopen(NULL)
+-   * does not work reliable and generally no symbols are found
+-   * at all. RTLD_DEFAULT works though.
+-   * On Android 64 bit, dlopen(NULL) seems to work but dlsym(handle)
+-   * always returns 'undefined symbol'. Only if RTLD_DEFAULT or 
+-   * NULL is given, dlsym returns an appropriate pointer.
+-   */
+-#if defined(__BIONIC__)
+-  handle = RTLD_DEFAULT;
+-#else
+-  handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
+-#endif
+-  if (!handle)
+-    g_module_set_error (fetch_dlerror (TRUE));
+-  
+-  return handle;
++  return RTLD_DEFAULT;
+ }
+ 
+ static void
+ _g_module_close (gpointer handle)
+ {
+-#if defined(__BIONIC__)
+   if (handle != RTLD_DEFAULT)
+-#endif
+     {
+       if (dlclose (handle) != 0)
+       g_module_set_error (fetch_dlerror (TRUE));
Index: pkgsrc/devel/glib2/patches/patch-gmodule_gmodule.c
diff -u /dev/null pkgsrc/devel/glib2/patches/patch-gmodule_gmodule.c:1.3
--- /dev/null   Wed Jun 30 14:26:11 2021
+++ pkgsrc/devel/glib2/patches/patch-gmodule_gmodule.c  Wed Jun 30 14:26:11 2021
@@ -0,0 +1,19 @@
+$NetBSD: patch-gmodule_gmodule.c,v 1.3 2021/06/30 14:26:11 prlw1 Exp $
+
+RTL_GLOBAL is a bug.
+https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2171
+
+--- gmodule/gmodule.c.orig     2021-06-10 18:57:57.268194400 +0000
++++ gmodule/gmodule.c
+@@ -506,9 +506,8 @@ g_module_open (const gchar    *file_name
+       if (!main_module)
+       {
+         handle = _g_module_self ();
+-/* On Android 64 bit, RTLD_DEFAULT is (void *)0x0
+- * so it always fails to create main_module if file_name is NULL */
+-#if !defined(__BIONIC__) || !defined(__LP64__)
++/* On Linux, handle == RTLD_DEFAULT is (void *)0x0 */
++#if G_MODULE_IMPL != G_MODULE_IMPL_DL
+         if (handle)
+ #endif
+           {



Home | Main Index | Thread Index | Old Index