1From 456bac53f19d3094aa2007054c87d86c9d65b423 Mon Sep 17 00:00:00 2001 2From: Ross Burton <ross.burton@intel.com> 3Date: Fri, 11 Mar 2016 15:35:55 +0000 4Subject: [PATCH] glib-2.0: relocate the GIO module directory for native builds 5 6Instead of hard-coding GIO_MODULE_PATH when glib is built, use dladdr() to 7determine where libglib.so is and use that path to calculate GIO_MODULES_DIR. 8 9This solves relocation problems with GIOModule for native builds of glib. 10 11Upstream-Status: Inappropriate 12Signed-off-by: Ross Burton <ross.burton@intel.com> 13 14Port patch to 2.48 15Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> 16--- 17 gio/giomodule.c | 7 ------- 18 1 file changed, 7 deletions(-) 19 20diff --git a/gio/giomodule.c b/gio/giomodule.c 21index 76c2028..6deba7c 100644 22--- a/gio/giomodule.c 23+++ b/gio/giomodule.c 24@@ -1260,11 +1260,6 @@ get_gio_module_dir (void) 25 g_free (install_dir); 26 #else 27 module_dir = g_strdup (GIO_MODULE_DIR); 28-#ifdef __APPLE__ 29-#include "TargetConditionals.h" 30-/* Only auto-relocate on macOS, not watchOS etc; older macOS SDKs only define TARGET_OS_MAC */ 31-#if (defined (TARGET_OS_OSX) && TARGET_OS_OSX) || \ 32- (!defined (TARGET_OS_OSX) && defined (TARGET_OS_MAC) && TARGET_OS_MAC) 33 #include <dlfcn.h> 34 { 35 g_autofree gchar *path = NULL; 36@@ -1283,8 +1278,6 @@ get_gio_module_dir (void) 37 } 38 } 39 } 40-#endif 41-#endif 42 #endif 43 } 44 45