OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 | |
6 """ Utilities for ASAN,TSAN,etc. build steps. """ | |
7 | |
8 from default_build_step_utils import DefaultBuildStepUtils | |
9 from py.utils import shell_utils | |
10 | |
11 import os | |
12 | |
13 class XsanBuildStepUtils(DefaultBuildStepUtils): | |
14 def Compile(self, target): | |
15 # Run the xsan_build script. | |
16 os.environ['GYP_DEFINES'] = self._step.args['gyp_defines'] | |
17 print 'GYP_DEFINES="%s"' % os.environ['GYP_DEFINES'] | |
18 cmd = [ | |
19 os.path.join('tools', 'xsan_build'), | |
20 self._step.args['sanitizer'], | |
21 target, | |
22 'BUILDTYPE=%s' % self._step.configuration, | |
23 ] | |
24 | |
25 cmd.extend(self._step.default_make_flags) | |
26 cmd.extend(self._step.make_flags) | |
27 shell_utils.run(cmd) | |
28 | |
29 def RunFlavoredCmd(self, app, args): | |
30 os.environ['ASAN_SYMBOLIZER_PATH'] = '/usr/bin/llvm-symbolizer-3.5' | |
31 os.environ['ASAN_OPTIONS'] = 'symbolize=1 detect_leaks=1' | |
32 os.environ['LSAN_OPTIONS'] = \ | |
33 'symbolize=1 suppressions=tools/lsan.supp print_suppressions=1' | |
34 os.environ['TSAN_OPTIONS'] = 'suppressions=tools/tsan.supp' | |
35 return shell_utils.run([self._PathToBinary(app)] + args) | |
OLD | NEW |