aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules/gnome.py
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2017-06-15 22:52:34 -0400
committerPatrick Griffis <tingping@tingping.se>2017-06-17 07:08:31 -0400
commitccb253189ad970354d46f0a8e3bf381774c404af (patch)
tree7929ce17719752cb164e58c025bd9ce67d1b2c0d /mesonbuild/modules/gnome.py
parent604adce33f89762f05e5385266d7b1a7d2f344db (diff)
downloadmeson-ccb253189ad970354d46f0a8e3bf381774c404af.zip
meson-ccb253189ad970354d46f0a8e3bf381774c404af.tar.gz
meson-ccb253189ad970354d46f0a8e3bf381774c404af.tar.bz2
gnome.generate_gir(): Fix linking to libasan if sanitizer enabled
This is a bit of a workaround linking directly to it but it is at least functional unlike before. Fixes #1910
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r--mesonbuild/modules/gnome.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 7a7ad67..6f38661 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -444,6 +444,7 @@ class GnomeModule(ExtensionModule):
'Gir includes must be str, GirTarget, or list of them')
cflags = []
+ ldflags = []
for lang, compiler in girtarget.compilers.items():
# XXX: Can you use g-i with any other language?
if lang in ('c', 'cpp', 'objc', 'objcpp', 'd'):
@@ -459,6 +460,11 @@ class GnomeModule(ExtensionModule):
if 'b_sanitize' in compiler.base_options:
sanitize = state.environment.coredata.base_options['b_sanitize'].value
cflags += compilers.sanitizer_compile_args(sanitize)
+ if sanitize == 'address':
+ ldflags += ['-lasan']
+ # FIXME: Linking directly to libasan is not recommended but g-ir-scanner
+ # does not understand -f LDFLAGS. https://bugzilla.gnome.org/show_bug.cgi?id=783892
+ # ldflags += compilers.sanitizer_link_args(sanitize)
if kwargs.get('symbol_prefix'):
sym_prefix = kwargs.pop('symbol_prefix')
if not isinstance(sym_prefix, str):
@@ -521,9 +527,10 @@ class GnomeModule(ExtensionModule):
# ldflags will be misinterpreted by gir scanner (showing
# spurious dependencies) but building GStreamer fails if they
# are not used here.
- dep_cflags, ldflags, gi_includes = self._get_dependencies_flags(deps, state, depends,
- use_gir_args=True)
+ dep_cflags, dep_ldflags, gi_includes = self._get_dependencies_flags(deps, state, depends,
+ use_gir_args=True)
cflags += list(dep_cflags)
+ ldflags += list(dep_ldflags)
scan_command += ['--cflags-begin']
scan_command += cflags
scan_command += ['--cflags-end']