diff --git a/gio/meson.build b/gio/meson.build
index 325263626..5bd762675 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -711,7 +711,7 @@ else
   gio_dtrace_hdr = []
 endif
 
-libgio = shared_library('gio-2.0',
+libgio = library('gio-2.0',
   gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources,
   gio_dtrace_hdr, gio_dtrace_obj,
   version : library_version,
diff --git a/glib/meson.build b/glib/meson.build
index 1da0bcd3c..af2633c60 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -219,8 +219,7 @@ pcre_static_args = []
 if use_pcre_static_flag
   pcre_static_args = ['-DPCRE_STATIC']
 endif
-
-libglib = shared_library('glib-2.0',
+libglib = library('glib-2.0',
   glib_dtrace_obj, glib_dtrace_hdr,
   sources : [deprecated_sources, glib_sources, thread_src, plat_src],
   version : library_version,
@@ -235,6 +234,7 @@ libglib = shared_library('glib-2.0',
 )
 
 libglib_dep = declare_dependency(link_with : libglib,
+  dependencies: thread_dep,
   # We sadly need to export configinc here because everyone includes <glib/*.h>
   include_directories : [configinc, glibinc])
 
diff --git a/gmodule/meson.build b/gmodule/meson.build
index 191bca244..531491921 100644
--- a/gmodule/meson.build
+++ b/gmodule/meson.build
@@ -84,7 +84,7 @@ gmoduleconf_h = configure_file(input : 'gmoduleconf.h.in',
 
 install_headers(['gmodule.h'], subdir : 'glib-2.0')
 
-libgmodule = shared_library('gmodule-2.0',
+libgmodule = library('gmodule-2.0',
   sources : ['gmodule.c'],
   version : library_version,
   soversion : soversion,
diff --git a/gobject/meson.build b/gobject/meson.build
index aecca57c7..b52c0d7d2 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -53,7 +53,7 @@ else
   gobject_dtrace_hdr = []
 endif
 
-libgobject = shared_library('gobject-2.0',
+libgobject = library('gobject-2.0',
   gobject_dtrace_obj, gobject_dtrace_hdr,
   sources : [gobject_c_sources],
   version : library_version,
diff --git a/gthread/meson.build b/gthread/meson.build
index 8ccac3369..dd46da52e 100644
--- a/gthread/meson.build
+++ b/gthread/meson.build
@@ -1,6 +1,6 @@
 # Just a skeleton lib for backwards compatibility since all the functionaliy
 # has been moved into glib now
-libgthread = shared_library('gthread-2.0',
+libgthread = library('gthread-2.0',
   sources : [ 'gthread-impl.c' ],
   version : library_version,
   soversion : soversion,
