From c6d56fc94c932da05229587fccf8c99838c956ff Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Fri, 26 Apr 2024 15:43:28 +0200 Subject: [PATCH] Intercept source files in linker_interceptor.py (#68) --- linker_interceptor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/linker_interceptor.py b/linker_interceptor.py index 4caebaffc0..df1c17e7da 100755 --- a/linker_interceptor.py +++ b/linker_interceptor.py @@ -17,6 +17,7 @@ else: out_args = [] shareds = [] +sources = [] search = [] rpath = [] @@ -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)