aboutsummaryrefslogtreecommitdiffstats
path: root/community/wine/wine-dlclose-bug41703.patch
diff options
context:
space:
mode:
authorMartell Malone <martellmalone@gmail.com>2018-04-04 22:28:29 -0700
committerNatanael Copa <ncopa@alpinelinux.org>2019-03-20 07:04:54 +0000
commit32fd86f9ce1cbb54edb3b24f88a69504607283de (patch)
tree91dd4c44efd5b8d02b2f064ed661b99d10b434e6 /community/wine/wine-dlclose-bug41703.patch
parentde12271c656e8a0018e9e84316121e353141eaef (diff)
downloadaports-32fd86f9ce1cbb54edb3b24f88a69504607283de.tar.bz2
aports-32fd86f9ce1cbb54edb3b24f88a69504607283de.tar.xz
community/wine: fix crypto emulation
Diffstat (limited to 'community/wine/wine-dlclose-bug41703.patch')
-rw-r--r--community/wine/wine-dlclose-bug41703.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/community/wine/wine-dlclose-bug41703.patch b/community/wine/wine-dlclose-bug41703.patch
new file mode 100644
index 0000000000..7b92d79bdd
--- /dev/null
+++ b/community/wine/wine-dlclose-bug41703.patch
@@ -0,0 +1,69 @@
+This patch comes from https://bugs.winehq.org/show_bug.cgi?id=41703
+by xw897002528 on 2017-07-29 04:23:37 CDT as attachment 58819
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1123,6 +1123,12 @@ then
+
+ dnl *** End of X11/Xlib.h check
+
++ dnl Check for the unload_after_dlclose libc
++ AC_RUN_IFELSE(
++ [AC_LANG_PROGRAM([[#include <dlfcn.h>]], [[dlclose(dlopen("./conftest", 0)); return 0;]])],
++ ac_save_CPPFLAGS="$ac_save_CPPFLAGS -DNO_UNLOAD_AFTER_DLCLOSE",
++ [])
++
+ dnl Check for the presence of OpenGL
+ opengl_msg=""
+ if test "x$with_opengl" != "xno"
+--- a/dlls/ntdll/loader.c
++++ b/dlls/ntdll/loader.c
+@@ -2289,6 +2289,13 @@
+ if (mod->Flags & LDR_WINE_INTERNAL && mod->SectionHandle == handle)
+ {
+ info.wm = CONTAINING_RECORD(mod, WINE_MODREF, ldr);
++#ifdef NO_UNLOAD_AFTER_DLCLOSE
++ if (info.wm->ldr.LoadCount == 0) {
++ RtlEnterCriticalSection( &loader_section );
++ info.wm->ldr.LoadCount = 1;
++ RtlLeaveCriticalSection( &loader_section );
++ }
++#endif
+ TRACE( "Found %s at %p for builtin %s\n",
+ debugstr_w(info.wm->ldr.FullDllName.Buffer), info.wm->ldr.BaseAddress, debugstr_w(path) );
+ break;
+@@ -3199,6 +3199,9 @@
+ * LdrShutdownProcess (NTDLL.@)
+ *
+ */
++#ifdef NO_UNLOAD_AFTER_DLCLOSE
++static void MODULE_FlushModrefs(void);
++#endif
+ void WINAPI LdrShutdownProcess(void)
+ {
+ TRACE("()\n");
+@@ -3194,6 +3203,12 @@
+ TRACE("()\n");
++#ifdef NO_UNLOAD_AFTER_DLCLOSE
++ RtlEnterCriticalSection( &loader_section );
++ process_detach();
++ MODULE_FlushModrefs();
++ RtlLeaveCriticalSection( &loader_section );
++#endif
+ process_detaching = TRUE;
+ process_detach();
+ }
+
+
+@@ -3384,7 +3398,11 @@
+ if ( free_lib_count <= 1 )
+ {
++#ifdef NO_UNLOAD_AFTER_DLCLOSE
++ TRACE("apply no-op dlclose hacks on this platform\n");
++#else
+ process_detach();
+ MODULE_FlushModrefs();
++#endif
+ }
+
+ TRACE("END\n");