From 82295998ac18abada0cdef4b679a3c4a1d59c302 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 20 Aug 2024 14:36:29 +0100 Subject: [PATCH] Revert "gmodule-dl: Use RTLD_DEFAULT on FreeBSD too" This reverts commit bb2ab2647db9ae9a5bba38678d926198eb2b8120. It appears to break the use of `G_MODULE_BIND_LOCAL`, as evidenced by the `test_local_binding()` test in `module-test.c` failing on FreeBSD ever since that test was added. See #3415. Looking back at the merge request (!3656), I should have pressed for detail on why this change was needed. Fixes: #3415 --- gmodule/gmodule-dl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c index 871d71b5d..41a36706a 100644 --- a/gmodule/gmodule-dl.c +++ b/gmodule/gmodule-dl.c @@ -167,7 +167,7 @@ _g_module_self (void) * NULL is given, dlsym returns an appropriate pointer. */ lock_dlerror (); -#if defined(__ANDROID__) || defined(__NetBSD__) || defined(__FreeBSD__) +#if defined(__ANDROID__) || defined(__NetBSD__) handle = RTLD_DEFAULT; #else handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); @@ -182,7 +182,7 @@ _g_module_self (void) static void _g_module_close (gpointer handle) { -#if defined(__ANDROID__) || defined(__NetBSD__) || defined(__FreeBSD__) +#if defined(__ANDROID__) || defined(__NetBSD__) if (handle != RTLD_DEFAULT) #endif {