diff -up glib-2.34.3/glib/glib-init.c.orig glib-2.34.3/glib/glib-init.c
--- glib-2.34.3/glib/glib-init.c.orig	2013-03-26 13:49:30.028166262 +0100
+++ glib-2.34.3/glib/glib-init.c	2013-03-26 13:52:08.558355118 +0100
@@ -217,6 +217,11 @@ g_debug_init (void)
 static void
 glib_init (void)
 {
+#if defined (G_OS_WIN32)
+  g_clock_win32_init ();
+  g_thread_win32_init ();
+#endif
+
   g_messages_prefixed_init ();
   g_debug_init ();
 }
@@ -225,6 +230,8 @@ glib_init (void)
 
 HMODULE glib_dll;
 
+#ifdef DLL_EXPORT
+
 BOOL WINAPI
 DllMain (HINSTANCE hinstDLL,
          DWORD     fdwReason,
@@ -234,12 +241,10 @@ DllMain (HINSTANCE hinstDLL,
     {
     case DLL_PROCESS_ATTACH:
       glib_dll = hinstDLL;
-      g_clock_win32_init ();
-      g_thread_win32_init ();
-      glib_init ();
       break;
 
     case DLL_THREAD_DETACH:
+      /* FIXME: This won't get called in a static build */
       g_thread_win32_thread_detach ();
       break;
 
@@ -251,7 +256,11 @@ DllMain (HINSTANCE hinstDLL,
   return TRUE;
 }
 
-#elif defined (G_HAS_CONSTRUCTORS)
+#endif
+
+#endif
+
+#ifdef G_HAS_CONSTRUCTORS
 
 #ifdef G_DEFINE_CONSTRUCTOR_NEEDS_PRAGMA
 #pragma G_DEFINE_CONSTRUCTOR_PRAGMA_ARGS(glib_init_ctor)
