9 blacklist=['rtld', '/dl-', 'elf/', 'string/mem', 'time/time',
10 'time/gettimeofday', 'time/timegm', 'time/timespec_get',
11 'nptl/libc_pthread_init', 'nptl/register-atfork',
12 #In Tizen, ASan tries to write error log to procfs, in case procfs is not mounted,
13 #this action will generate a kernel panic. So, just disble errors which happens because
14 #of dword-aligned reading by glibc.
18 def AllowAsan(out_file):
19 match = re.match(r'/.*build/(.*).os$', out_file)
21 #print >>sys.stderr, 'FALLBACK_NO_MATCH: %s' % out_file
27 #print >>sys.stderr, 'FALLBACK_BLACKLIST: %s' % obj
33 i = sys.argv.index('-o')
34 return sys.argv[i + 1]
38 if __name__ == '__main__':
40 args = [arg for arg in args if arg != '-Wl,-z,defs']
43 print >> sys.stderr, 'ASAN:', o()
44 args.append('-fsanitize-recover=address')
45 args.append('-fsanitize=address')
46 args.append('--param')
47 args.append('asan-use-after-return=0')
49 args.append('-fno-omit-frame-pointer')
50 args.append('-Wno-error')
51 args.append('-DSKIP_IFUNC');
53 os.execvp(GCC, [GCC] + args)