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

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