Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: pydir/szbuild.py

Issue 2068593003: Implemented linking to a dummy ASan runtime (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes in szbuild.py Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pydir/szbuild.py
diff --git a/pydir/szbuild.py b/pydir/szbuild.py
index 558db48db863f6324c491d87845efdcc74a0bd1c..a40a7899f8ee2e9c0cd3aa17bb2d13ed2de3657e 100755
--- a/pydir/szbuild.py
+++ b/pydir/szbuild.py
@@ -103,6 +103,9 @@ def AddOptionalArgs(argparser):
default=[], help='Extra arguments for llc')
argparser.add_argument('--no-sz', dest='nosz', action='store_true',
help='Run only post-Subzero build steps')
+ argparser.add_argument('--fsanitize-address', dest='asan',
+ action='store_true',
+ help='Instrument with AddressSanitizer')
def LinkSandbox(objs, exe, target, verbose=True):
assert target in ('x8632', 'x8664', 'arm32'), \
@@ -263,6 +266,10 @@ def main():
args = argparser.parse_args()
pexe = args.pexe
exe = args.output
+ if args.asan:
+ if args.sandbox or args.nonsfi:
+ print 'Can only use AddressSanitizer with a native build'
+ exit(1)
ProcessPexe(args, pexe, exe)
def ProcessPexe(args, pexe, exe):
@@ -446,7 +453,13 @@ def ProcessPexe(args, pexe, exe):
elif args.nonsfi:
LinkNonsfi([obj_partial], exe, args.target, args.verbose)
else:
- LinkNative([obj_partial], exe, args.target, args.verbose)
+ objs = [obj_partial]
+ if args.asan:
+ objs.append(
+ ('{root}/toolchain_build/src/subzero/build/runtime/' +
+ 'szrt_asan_{target}.o').format(root=nacl_root,
+ target=args.target))
+ LinkNative(objs, exe, args.target, args.verbose)
# Put the extra verbose printing at the end.
if args.verbose and hybrid:

Powered by Google App Engine
This is Rietveld 408576698