office-gobmx/external/libgpg-error/w32-disable-dllinit.patch.1
Thorsten Behrens b9c2fac7bc gpg4libre: call libgpg-error subsystem init
Due to a string of unhelpful coincidences, _gpgrt_lock_init never
got called in libgpg-error for Windows; resulting in occasional
crashes.

Change-Id: I95f508e4622777c21f90c76dce5b5ff420c81fa1
Reviewed-on: https://gerrit.libreoffice.org/45191
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Siegmund Gorr <siegmund.gorr@cib.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-11-24 16:03:38 +01:00

55 lines
1.8 KiB
Groff

Disable all DLL init functions in libgpg-error, since they're
not actually run in statically linked libs. And libtool seems
to unconditionally set that flag on all Windows builds.
diff -ur libgpg-error.org/src/init.c libgpg-error/src/init.c
--- libgpg-error.org/src/init.c 2017-02-28 10:11:05.000000000 +0100
+++ libgpg-error/src/init.c 2017-11-23 16:44:56.850797400 +0100
@@ -88,7 +88,7 @@
_gpg_err_init (void)
{
#ifdef HAVE_W32_SYSTEM
-# ifdef DLL_EXPORT
+# ifdef HAVE_DLL_INIT
/* We always have a constructor and thus this function is called
automatically. Due to the way the C init code of mingw works,
the constructors are called before our DllMain function is
@@ -130,7 +130,7 @@
void
_gpg_err_deinit (int mode)
{
-#if defined (HAVE_W32_SYSTEM) && !defined(DLL_EXPORT)
+#if defined (HAVE_W32_SYSTEM) && !defined(HAVE_DLL_INIT)
struct tls_space_s *tls;
tls = TlsGetValue (tls_index);
@@ -473,7 +473,7 @@
/* Entry point called by the DLL loader. */
-#ifdef DLL_EXPORT
+#ifdef HAVE_DLL_INIT
int WINAPI
DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
diff -ur libgpg-error.org/src/w32-gettext.c libgpg-error/src/w32-gettext.c
--- libgpg-error.org/src/w32-gettext.c 2016-12-02 22:51:19.000000000 +0100
+++ libgpg-error/src/w32-gettext.c 2017-11-23 16:43:28.450453000 +0100
@@ -1180,7 +1180,7 @@
DLL. If used as a static lib we can't control the process set; for
example it might be used with a main module which is not build with
mingw and thus does not know how to call the constructors. */
-#ifdef DLL_EXPORT
+#ifdef HAVE_DLL_INIT
static void module_init (void) _GPG_ERR_CONSTRUCTOR;
#endif
static void
@@ -1195,7 +1195,7 @@
}
}
-#if !defined(DLL_EXPORT) || !defined(_GPG_ERR_HAVE_CONSTRUCTOR)
+#if !defined(HAVE_DLL_INIT) || !defined(_GPG_ERR_HAVE_CONSTRUCTOR)
void
_gpg_w32__init_gettext_module (void)
{