 gmodule/meson.build | 7 +++++--
 meson.build         | 6 ++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git c/gmodule/meson.build i/gmodule/meson.build
index 191bca2446f9977e..551956599a616157 100644
--- c/gmodule/meson.build
+++ i/gmodule/meson.build
@@ -37,7 +37,7 @@ elif cc.has_function('NSLinkModule')
 elif cc.links(dlopen_dlsym_test_code, args : '-ldl', name : 'dlopen() and dlsym() in libdl')
   g_module_impl = 'G_MODULE_IMPL_DL'
   libdl_dep = cc.find_library('dl')
-  g_module_lib_args = '-ldl'
+  g_module_lib_args = ['-ldl']
 endif
 
 # additional checks for G_MODULE_IMPL_DL
@@ -72,8 +72,11 @@ if g_module_impl == ''
   message('WARNING: No suitable GModule implementation found!')
 endif
 
+# For pc files
+glib_conf.set('G_MODULE_SUPPORTED', g_module_impl == '0' ? 'false' : 'true')
+glib_conf.set('G_MODULE_LIBS', ' '.join(g_module_lib_args))
+
 gmoduleconf_conf.set('G_MODULE_IMPL', g_module_impl)
-gmoduleconf_conf.set('G_MODULE_SUPPORTED', g_module_impl != '0')
 gmoduleconf_conf.set('G_MODULE_HAVE_DLERROR', g_module_have_dlerror)
 gmoduleconf_conf.set('G_MODULE_NEED_USCORE', g_module_need_uscore)
 gmoduleconf_conf.set('G_MODULE_BROKEN_RTLD_GLOBAL', g_module_broken_rtld_global)
diff --git c/meson.build i/meson.build
index b38123d896749086..0d26f92238fbbfb3 100644
--- c/meson.build
+++ i/meson.build
@@ -1541,6 +1541,12 @@ glib_conf.set('GIO_MODULE_DIR', '${libdir}/gio/modules')
 # @G_MODULE_LIBS@ @SELINUX_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@
 # @PCRE_REQUIRES@ @GLIB_EXTRA_CFLAGS@ @G_THREAD_CFLAGS@
 
+# HACK
+glib_conf.set('G_THREAD_LIBS', '-pthread')
+glib_conf.set('G_THREAD_CFLAGS', '-pthread')
+glib_conf.set('G_MODULE_LDFLAGS', '-Wl,--export-dynamic')
+glib_conf.set('PCRE_REQUIRES', 'libpcre')
+
 # Tracing: dtrace
 want_dtrace = get_option('enable-dtrace')
 enable_dtrace = false
