Blame SOURCES/winpr-library-Use-RTLD_GLOBAL-for-dlopen.patch

69b17f
From d8cd671cc68d503757e32eb80f7a4dee44e47754 Mon Sep 17 00:00:00 2001
69b17f
From: Ondrej Holy <oholy@redhat.com>
69b17f
Date: Wed, 27 May 2020 08:43:00 +0200
69b17f
Subject: [PATCH] winpr/library: Use RTLD_GLOBAL for dlopen
69b17f
69b17f
LoadLibraryA implementation uses the RTLD_LOCAL flag for dlopen currently.
69b17f
This flag doesn't allow the symbols to be used by the subsequently loaded
69b17f
libraries. This is a problem for the video channel when -DBUILTIN_CHANNELS=OFF
69b17f
is used as it uses functions from the geometry channel. Let's use RTLD_GLOBAL
69b17f
instead to prevent "undefined symbol" errors in such cases.
69b17f
69b17f
Fixes: https://github.com/FreeRDP/FreeRDP/issues/6236
69b17f
---
69b17f
 winpr/libwinpr/library/library.c | 2 +-
69b17f
 1 file changed, 1 insertion(+), 1 deletion(-)
69b17f
69b17f
diff --git a/winpr/libwinpr/library/library.c b/winpr/libwinpr/library/library.c
69b17f
index f44a96d27..8d33227b2 100644
69b17f
--- a/winpr/libwinpr/library/library.c
69b17f
+++ b/winpr/libwinpr/library/library.c
69b17f
@@ -125,7 +125,7 @@ HMODULE LoadLibraryA(LPCSTR lpLibFileName)
69b17f
 	return hModule;
69b17f
 #else
69b17f
 	HMODULE library;
69b17f
-	library = dlopen(lpLibFileName, RTLD_LOCAL | RTLD_LAZY);
69b17f
+	library = dlopen(lpLibFileName, RTLD_GLOBAL | RTLD_LAZY);
69b17f
 
69b17f
 	if (!library)
69b17f
 	{
69b17f
-- 
69b17f
2.26.2
69b17f