mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 04:13:12 +00:00
glib: make sure RTLD_LOCAL is used for G_MODULE_BIND_LOCAL
Unlike Linux, Darwin defines `RTLD_LOCAL` as a non-zero value.
This commit is contained in:
parent
afa876d6fe
commit
bdc870b17a
@ -130,6 +130,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
# and by default meson installs in to $out/share/gdb/auto-load
|
||||
# which does not help
|
||||
./gdb_script.patch
|
||||
|
||||
# glib assumes that `RTLD_LOCAL` is defined to `0`, which is true on Linux and FreeBSD but not on Darwin.
|
||||
./gmodule-rtld_local.patch
|
||||
];
|
||||
|
||||
outputs = [ "bin" "out" "dev" "devdoc" ];
|
||||
|
13
pkgs/development/libraries/glib/gmodule-rtld_local.patch
Normal file
13
pkgs/development/libraries/glib/gmodule-rtld_local.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c
|
||||
index 6d1c5fab7..b21773bca 100644
|
||||
--- a/gmodule/gmodule-dl.c
|
||||
+++ b/gmodule/gmodule-dl.c
|
||||
@@ -136,7 +136,7 @@ _g_module_open (const gchar *file_name,
|
||||
|
||||
lock_dlerror ();
|
||||
handle = dlopen (file_name,
|
||||
- (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
|
||||
+ (bind_local ? RTLD_LOCAL : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
|
||||
if (!handle)
|
||||
{
|
||||
const gchar *message = fetch_dlerror (TRUE);
|
Loading…
Reference in New Issue
Block a user