aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-06-22 06:19:29 -0400
committerGitHub <noreply@github.com>2017-06-22 06:19:29 -0400
commit080307dd71d9b41a103369863137ed5b73eb131a (patch)
tree6bdfb397d15e176cb4db7eba7aba14355eb2e277
parent65d5ec5f18f645a7b4d10de10b63a329718a7939 (diff)
parentccb253189ad970354d46f0a8e3bf381774c404af (diff)
downloadmeson-080307dd71d9b41a103369863137ed5b73eb131a.zip
meson-080307dd71d9b41a103369863137ed5b73eb131a.tar.gz
meson-080307dd71d9b41a103369863137ed5b73eb131a.tar.bz2
Merge pull request #1948 from mesonbuild/tingping/gnome-sanitize-fixes
Fix gnome.generate_gir() with address sanitizer
-rw-r--r--mesonbuild/modules/gnome.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index fe85aa0..06a1fad 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -446,6 +446,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'):
@@ -458,9 +459,14 @@ class GnomeModule(ExtensionModule):
cflags += state.global_args[lang]
if state.project_args.get(lang):
cflags += state.project_args[lang]
- sanitize = compiler.get_options().get('b_sanitize')
- if sanitize:
+ 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):
@@ -523,9 +529,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']