From 1518a778ed84ceca81f0ec5bccf690816b958c3b Mon Sep 17 00:00:00 2001 From: Mario Sanchez Prada Date: Thu, 10 Aug 2017 20:47:59 +0200 Subject: [PATCH] main: Add private libdirs to GIR's list of search paths for scanned libraries This is not strictly necessary when linking the shell with DT_RPATH as the runtime paths will be extracted from the introspected libraries and used from gobject introspection to find them when loading them based on the typelib files, but when linking with DT_RUNPATH, as it's the case for some linkers (e.g. ld.gold, or ld.bfd in some distros like Debian). By explicitly prepending this directory as a library path for GIR, we're making sure that the wrapped shared objects installed in Mutter's and GNOME Shell's private directories can be found in all cases. https://bugzilla.gnome.org/show_bug.cgi?id=777519 --- src/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.c b/src/main.c index 660b60eb7..9a89aa4d6 100644 --- a/src/main.c +++ b/src/main.c @@ -200,6 +200,14 @@ shell_introspection_init (void) g_irepository_prepend_search_path (MUTTER_TYPELIB_DIR); g_irepository_prepend_search_path (GNOME_SHELL_PKGLIBDIR); + + /* We need to explicitly add the directories where the private libraries are + * installed to the GIR's library path, so that they can be found at runtime + * when linking using DT_RUNPATH (instead of DT_RPATH), which is the default + * for some linkers (e.g. gold) and in some distros (e.g. Debian). + */ + g_irepository_prepend_library_path (MUTTER_TYPELIB_DIR); + g_irepository_prepend_library_path (GNOME_SHELL_PKGLIBDIR); } static void