@@ -6,6 +6,7 @@ from ipdb import set_trace as bp
66
77def main ():
88 ap = argparse .ArgumentParser ()
9+ ap .add_argument ('-b' , '--build' , default = '/tmp/Debug' , help = 'build directory' )
910 ap .add_argument ('-d' , '--debug' , type = int , default = - 1 , help = 'rr record the specified command' )
1011 ap .add_argument ('-r' , '--run' , type = int , default = - 1 , help = 'run the specified command' )
1112 ap .add_argument ('--release' , action = 'store_true' , help = 'use /tmp/Rel as the build directory' )
@@ -17,7 +18,7 @@ def main():
1718 args .run = args .debug
1819
1920 home = os .path .expanduser ('~' )
20- build_dir = '/tmp/Rel' if args .release else '/tmp/Debug'
21+ build_dir = '/tmp/Rel' if args .release else args . build
2122 os .environ ["PATH" ] = os .path .expanduser (build_dir + '/bin' ) + os .pathsep + os .environ ['PATH' ]
2223
2324 # GNU binutils
@@ -37,11 +38,13 @@ def main():
3738 print ('not exist' , file = sys .stderr )
3839 return
3940 substs = sorted ([
41+ ('/p' , lambda : os .path .relpath (dirname , cwd )),
4042 ('/t' , lambda : os .path .relpath (tmp , cwd )),
4143 # See llvm/utils/lit/lit/llvm/config.py
4244 ('clang' , lambda : 'clang' ),
4345 ('clang_cc1' , lambda : f'clang -cc1 -internal-isystem { build_dir } /lib/clang/17/include -nostdsysteminc' ),
4446 ('errc_EACCES' , lambda : '"Permission denied"' ),
47+ ('itanium_abi_triple' , lambda : 'x86_64' ),
4548 ('llc_dwarf' , lambda : 'llc' ),
4649 # See lld/test/MachO/lit.local.cfg
4750 ('lld' , lambda : os .path .expanduser ('ld64.lld -arch x86_64 -platform_version macos 10.0 11.0 -syslibroot ~/llvm/lld/test/MachO/Inputs/MacOSX.sdk' )),
@@ -56,6 +59,7 @@ def main():
5659 with fh as f :
5760 for line in f .readlines ():
5861 line = line .strip ()
62+ if 'END.' in line : break
5963 match = re .search (r'RUN:[ \t]' , line )
6064 if not match :
6165 last = ''
0 commit comments