summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalev Lember <klember@redhat.com>2019-01-09 10:47:45 +0100
committerKalev Lember <klember@redhat.com>2019-01-09 11:29:06 +0100
commita3721f14d240150b5a53392c5bd9ecad84ca5258 (patch)
treed55ff4e6a431a8008651cbbd1a9e73633617cf95
parent3ee00f9e850c37ce9d50e07c1728890fad96d498 (diff)
downloadappstream-glib-wip/kalev/Bsymbolic.tar.gz
Link with -Bsymbolic if it's supported by the linkerwip/kalev/Bsymbolic
This should fix crashes when libappstream-glib and libappstream are both linked into the same process by avoiding intra-library PLT jumps. Flatpak master recently started linking with libappstream-glib, and this caused issues in other apps that link with both libappstream and flatpak (e.g. KDE Discover), now pulling in both libappstream-glib and libappstream into the same process space. Also bump required meson version to 0.46.0 for has_link_argument support. https://bugs.archlinux.org/task/61198
-rw-r--r--meson.build15
1 files changed, 13 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index a8649d5..192395f 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@ project('appstream-glib', 'c',
version : '0.7.15',
license : 'LGPL-2.1+',
default_options : ['warning_level=1', 'c_std=c99'],
- meson_version : '>=0.37.0'
+ meson_version : '>=0.46.0'
)
as_version = meson.project_version()
@@ -84,8 +84,8 @@ if get_option('dep11')
endif
# support stemming of search tokens
+cc = meson.get_compiler('c')
if get_option('stemmer')
- cc = meson.get_compiler('c')
stemmer = cc.find_library('stemmer')
conf.set('HAVE_LIBSTEMMER', 1)
endif
@@ -93,6 +93,17 @@ endif
# use gperf for faster string -> enum matching
gperf = find_program('gperf', required : true)
+global_link_args = []
+foreach arg: [ '-Wl,-Bsymbolic' ]
+ if cc.has_link_argument(arg)
+ global_link_args += arg
+ endif
+endforeach
+add_global_link_arguments(
+ global_link_args,
+ language: 'c'
+)
+
gnome = import('gnome')
i18n = import('i18n')