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

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: Fixed szbuild.py and improved test 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
« no previous file with comments | « pydir/build-runtime.py ('k') | runtime/szrt_asan.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pydir/szbuild.py
diff --git a/pydir/szbuild.py b/pydir/szbuild.py
index 558db48db863f6324c491d87845efdcc74a0bd1c..73337294c607e3592db39035851ceff9437dfb2a 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,11 @@ 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)
+ args.sz_args.append('-fsanitize-address')
ProcessPexe(args, pexe, exe)
def ProcessPexe(args, pexe, exe):
@@ -446,7 +454,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:
« no previous file with comments | « pydir/build-runtime.py ('k') | runtime/szrt_asan.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698