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

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