summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-06-20 23:46:48 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-06-20 23:46:48 +0300
commitfd37052973a5c6ea5df5e39e0028836c0472530f (patch)
treee9cb572a165f001ef16e974439aca91d07502c4e
parent57b3f9858625b1c0204320dddec8b6b84f6289c2 (diff)
downloadmeson-warnprint.tar.gz
Warn if using Clang+asan+b_lundef. Closes #764.warnprint
-rw-r--r--mesonbuild/interpreter.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 605eecbd8..8e1933443 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -3631,6 +3631,25 @@ different subdirectory.
mlog.log('Build targets in project:', mlog.bold(str(len(self.build.targets))))
FeatureNew.called_features_report()
FeatureDeprecated.called_features_report()
+ if self.subproject == '':
+ self.print_extra_warnings()
+
+ def print_extra_warnings(self):
+ for c in self.build.compilers.values():
+ if c.get_id() == 'clang':
+ self.check_clang_asan_lundef()
+ break
+
+ def check_clang_asan_lundef(self):
+ if 'b_lundef' not in self.coredata.base_options:
+ return
+ if 'b_sanitize' not in self.coredata.base_options:
+ return
+ if 'address' in self.coredata.base_options['b_sanitize'].value:
+ if self.coredata.base_options['b_lundef'].value:
+ mlog.warning('''Trying to use address sanitizer on Clang with b_lundef.
+This will probably not work.
+Try setting b_lundef to false instead.''')
def evaluate_subproject_info(self, path_from_source_root, subproject_dirname):
depth = 0