[glib] Meson: Do not build tests with nodelete/Bsymbolic-functions
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Meson: Do not build tests with nodelete/Bsymbolic-functions
- Date: Wed, 9 May 2018 11:56:10 +0000 (UTC)
commit b6cb22f32bf3df3c21310bd10b9c122ca4b8e3f6
Author: Xavier Claessens <xavier claessens collabora com>
Date: Tue May 1 09:44:19 2018 -0400
Meson: Do not build tests with nodelete/Bsymbolic-functions
-z nodelete breaks the libresourceplugin module usage in the resources.c
test, which expects to be able to unload it.
Make the Meson build match what the autotools build does: only pass
glib_link_flags to the headline libraries (glib-2.0, gio-2.0,
gobject-2.0, gthread-2.0, gmodule-2.0) and omit it from all other build
targets.
https://bugzilla.gnome.org/show_bug.cgi?id=788771
gio/meson.build | 3 +--
glib/meson.build | 2 +-
gmodule/meson.build | 4 +++-
gobject/meson.build | 4 +++-
gthread/meson.build | 4 +++-
meson.build | 9 ++++++++-
6 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gio/meson.build b/gio/meson.build
index 5a4a8c53e..8adf35031 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -793,14 +793,13 @@ libgio = library('gio-2.0',
install : true,
include_directories : [configinc, gioinc],
link_with : internal_deps,
- #libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS)',
# '$(gio_win32_res_ldflag)',
dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep,
libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
platform_deps, network_libs],
c_args : gio_c_args,
# intl.lib is not compatible with SAFESEH
- link_args : noseh_link_args,
+ link_args : [noseh_link_args, glib_link_flags],
)
giomodulesdir = get_option('gio_module_dir')
diff --git a/glib/meson.build b/glib/meson.build
index 9d186201d..3646d7038 100644
--- a/glib/meson.build
+++ b/glib/meson.build
@@ -234,7 +234,7 @@ libglib = library('glib-2.0',
soversion : soversion,
install : true,
# intl.lib is not compatible with SAFESEH
- link_args : noseh_link_args,
+ link_args : [noseh_link_args, glib_link_flags],
include_directories : configinc,
link_with : [charset_lib, gnulib_lib],
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
diff --git a/gmodule/meson.build b/gmodule/meson.build
index 3b57fb477..ddec32ab0 100644
--- a/gmodule/meson.build
+++ b/gmodule/meson.build
@@ -102,7 +102,9 @@ libgmodule = library('gmodule-2.0',
install : true,
include_directories : [configinc, gmoduleinc],
dependencies : [libdl_dep, libglib_dep],
- c_args : ['-DG_LOG_DOMAIN="GModule"', '-DG_DISABLE_DEPRECATED'] + glib_hidden_visibility_args)
+ c_args : ['-DG_LOG_DOMAIN="GModule"', '-DG_DISABLE_DEPRECATED'] + glib_hidden_visibility_args,
+ link_args : [glib_link_flags],
+)
supported_var = 'gmodule_supported=@0@'.format(g_module_impl != '0')
diff --git a/gobject/meson.build b/gobject/meson.build
index 98e306d7f..aa8f5398e 100644
--- a/gobject/meson.build
+++ b/gobject/meson.build
@@ -69,7 +69,9 @@ libgobject = library('gobject-2.0',
install : true,
include_directories : [configinc],
dependencies : [libintl, libffi_dep, libglib_dep],
- c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args)
+ c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args,
+ link_args : glib_link_flags,
+)
pkg.generate(libraries : libgobject,
requires : ['glib-2.0'],
diff --git a/gthread/meson.build b/gthread/meson.build
index 3787dba3b..6b0748f15 100644
--- a/gthread/meson.build
+++ b/gthread/meson.build
@@ -18,7 +18,9 @@ libgthread = library('gthread-2.0',
soversion : soversion,
install : true,
dependencies : [libglib_dep],
- c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args)
+ c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args,
+ link_args : glib_link_flags,
+)
pkg.generate(libraries : [libgthread, thread_dep],
requires : ['glib-2.0'],
diff --git a/meson.build b/meson.build
index b1d22cfe5..d35d37f5a 100644
--- a/meson.build
+++ b/meson.build
@@ -349,7 +349,14 @@ else
endif
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c')
-add_project_link_arguments(cc.get_supported_link_arguments(test_c_link_args), language: 'c')
+
+# FIXME: We cannot build some of the GResource tests with -z nodelete, which
+# means we cannot use that flag in add_project_link_arguments(), and must add
+# it to the relevant targets manually. We do the same with -Bsymbolic-functions
+# because that is what the autotools build did.
+# See https://github.com/mesonbuild/meson/pull/3520 for a way to eventually
+# improve this.
+glib_link_flags = cc.get_supported_link_arguments(test_c_link_args)
# Windows Support (Vista+)
if host_system == 'windows'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]