Fix linker interceptor
This commit is contained in:
parent
26c850174f
commit
2467486841
@ -18,18 +18,19 @@ else:
|
|||||||
out_args = []
|
out_args = []
|
||||||
shareds = []
|
shareds = []
|
||||||
search = []
|
search = []
|
||||||
islinking = False
|
is_linking_qemu = False
|
||||||
|
|
||||||
def process_args(args):
|
def process_args(args):
|
||||||
global out_args, shareds, search, islinking
|
global out_args, shareds, search, is_linking_qemu
|
||||||
prev_o = False
|
prev_o = False
|
||||||
|
|
||||||
for i in range(len(args)):
|
for i in range(len(args)):
|
||||||
if prev_o:
|
if prev_o:
|
||||||
prev_o = False
|
prev_o = False
|
||||||
|
if args[i].endswith('.so') and args[i].startswith('libqemu'):
|
||||||
|
is_linking_qemu = True
|
||||||
continue
|
continue
|
||||||
elif args[i] in FILTER:
|
elif args[i] in FILTER:
|
||||||
islinking = True
|
|
||||||
continue
|
continue
|
||||||
elif args[i].endswith('.so') and not args[i].startswith('-'):
|
elif args[i].endswith('.so') and not args[i].startswith('-'):
|
||||||
name = os.path.basename(args[i])[3:-3] # remove prefix and suffix
|
name = os.path.basename(args[i])[3:-3] # remove prefix and suffix
|
||||||
@ -53,7 +54,7 @@ def process_args(args):
|
|||||||
|
|
||||||
process_args(args)
|
process_args(args)
|
||||||
|
|
||||||
if islinking:
|
if is_linking_qemu:
|
||||||
with open(OUT, 'w') as f:
|
with open(OUT, 'w') as f:
|
||||||
json.dump({
|
json.dump({
|
||||||
'cmd': out_args,
|
'cmd': out_args,
|
||||||
@ -61,4 +62,5 @@ if islinking:
|
|||||||
'search': search,
|
'search': search,
|
||||||
}, f, indent=2)
|
}, f, indent=2)
|
||||||
|
|
||||||
subprocess.run([cc] + args)
|
r = subprocess.run([cc] + args)
|
||||||
|
sys.exit(r.returncode)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user