--- openssl-3.0.7/crypto/dllmain.c.orig	2022-12-22 12:52:31.011614800 +0100
+++ openssl-3.0.7/crypto/dllmain.c	2022-12-22 12:52:32.210778100 +0100
@@ -35,7 +35,9 @@
     case DLL_THREAD_ATTACH:
         break;
     case DLL_THREAD_DETACH:
+# ifndef __CYGWIN__
         OPENSSL_thread_stop();
+# endif
         break;
     case DLL_PROCESS_DETACH:
         break;
--- openssl-3.0.7/providers/fips/self_test.c.orig	2022-12-22 12:51:17.776136100 +0100
+++ openssl-3.0.7/providers/fips/self_test.c	2022-12-22 12:51:26.809452500 +0100
@@ -96,7 +96,9 @@
         init();
         break;
     case DLL_PROCESS_DETACH:
+# ifndef __CYGWIN__
         cleanup();
+# endif
         break;
     default:
         break;
