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

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