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
This commit is contained in:
Xavier Claessens 2018-05-01 09:44:19 -04:00 committed by Philip Withnall
parent e924f77736
commit b6cb22f32b
6 changed files with 19 additions and 7 deletions

View File

@ -793,14 +793,13 @@ libgio = library('gio-2.0',
install : true, install : true,
include_directories : [configinc, gioinc], include_directories : [configinc, gioinc],
link_with : internal_deps, link_with : internal_deps,
#libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS)',
# '$(gio_win32_res_ldflag)', # '$(gio_win32_res_ldflag)',
dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep, dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep,
libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep, libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep,
platform_deps, network_libs], platform_deps, network_libs],
c_args : gio_c_args, c_args : gio_c_args,
# intl.lib is not compatible with SAFESEH # 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') giomodulesdir = get_option('gio_module_dir')

View File

@ -234,7 +234,7 @@ libglib = library('glib-2.0',
soversion : soversion, soversion : soversion,
install : true, install : true,
# intl.lib is not compatible with SAFESEH # intl.lib is not compatible with SAFESEH
link_args : noseh_link_args, link_args : [noseh_link_args, glib_link_flags],
include_directories : configinc, include_directories : configinc,
link_with : [charset_lib, gnulib_lib], link_with : [charset_lib, gnulib_lib],
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps, dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,

View File

@ -102,7 +102,9 @@ libgmodule = library('gmodule-2.0',
install : true, install : true,
include_directories : [configinc, gmoduleinc], include_directories : [configinc, gmoduleinc],
dependencies : [libdl_dep, libglib_dep], 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') supported_var = 'gmodule_supported=@0@'.format(g_module_impl != '0')

View File

@ -69,7 +69,9 @@ libgobject = library('gobject-2.0',
install : true, install : true,
include_directories : [configinc], include_directories : [configinc],
dependencies : [libintl, libffi_dep, libglib_dep], 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, pkg.generate(libraries : libgobject,
requires : ['glib-2.0'], requires : ['glib-2.0'],

View File

@ -18,7 +18,9 @@ libgthread = library('gthread-2.0',
soversion : soversion, soversion : soversion,
install : true, install : true,
dependencies : [libglib_dep], 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], pkg.generate(libraries : [libgthread, thread_dep],
requires : ['glib-2.0'], requires : ['glib-2.0'],

View File

@ -349,7 +349,14 @@ else
endif endif
add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c') 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+) # Windows Support (Vista+)
if host_system == 'windows' if host_system == 'windows'