Intercept source files in linker_interceptor.py (#68)
This commit is contained in:
parent
7c3c7877d8
commit
c6d56fc94c
@ -17,6 +17,7 @@ else:
|
|||||||
|
|
||||||
out_args = []
|
out_args = []
|
||||||
shareds = []
|
shareds = []
|
||||||
|
sources = []
|
||||||
search = []
|
search = []
|
||||||
rpath = []
|
rpath = []
|
||||||
|
|
||||||
@ -69,12 +70,18 @@ def process_args(args):
|
|||||||
process_args(args)
|
process_args(args)
|
||||||
|
|
||||||
if is_linking_qemu:
|
if is_linking_qemu:
|
||||||
|
with open("compile_commands.json", 'r') as f:
|
||||||
|
compile_commands = json.load(f)
|
||||||
|
for entry in compile_commands:
|
||||||
|
sources.append(entry["file"])
|
||||||
|
|
||||||
with open(OUT, 'w') as f:
|
with open(OUT, 'w') as f:
|
||||||
json.dump({
|
json.dump({
|
||||||
'cmd': out_args,
|
'cmd': out_args,
|
||||||
'libs': shareds,
|
'libs': shareds,
|
||||||
'search': search,
|
'search': search,
|
||||||
'rpath': rpath,
|
'rpath': rpath,
|
||||||
|
'sources': sources,
|
||||||
}, f, indent=2)
|
}, f, indent=2)
|
||||||
|
|
||||||
r = subprocess.run([cc] + args)
|
r = subprocess.run([cc] + args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user