Skip to content

Commit

Permalink
Intercept source files in linker_interceptor.py (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmalmain authored Apr 26, 2024
1 parent a15c29e commit 0a3195e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions linker_interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

out_args = []
shareds = []
sources = []
search = []
rpath = []

Expand Down Expand Up @@ -69,12 +70,18 @@ def process_args(args):
process_args(args)

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:
json.dump({
'cmd': out_args,
'libs': shareds,
'search': search,
'rpath': rpath,
'sources': sources,
}, f, indent=2)

r = subprocess.run([cc] + args)
Expand Down

0 comments on commit 0a3195e

Please sign in to comment.