From 242b74cae7c4f43c739e95fcc467566d3e7cf045 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Sat, 14 Mar 2026 22:08:09 -0500 Subject: [PATCH] fix: specify full build path with patched_object_files --- meson.build | 1 + scripts/patch_relocations.py | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 319ffe2..4aacd30 100644 --- a/meson.build +++ b/meson.build @@ -110,6 +110,7 @@ patched_relocations = custom_target( output: patched_object_files, command: [ python, meson.project_source_root() / 'scripts/patch_relocations.py', + meson.current_build_dir(), '@INPUT@', ], ) diff --git a/scripts/patch_relocations.py b/scripts/patch_relocations.py index 869211e..1854d82 100644 --- a/scripts/patch_relocations.py +++ b/scripts/patch_relocations.py @@ -1,9 +1,9 @@ -import sys, struct, shutil +import sys, struct, shutil, os -def patch_relocs(object_files): +def patch_relocs(build_dir, object_files): patched = 0 for f in object_files: - outfile = f.replace('.obj', '.o') + outfile = os.path.join(build_dir, os.path.basename(f).replace('.obj', '.o')) shutil.copy(f, outfile) with open(outfile, 'rb+') as file: @@ -35,4 +35,7 @@ def patch_relocs(object_files): print(f"Patched {patched} 'type 40' relocations to standard GOTPCREL (9).") if __name__ == '__main__': - patch_relocs(sys.argv[1:]) \ No newline at end of file + build_dir = sys.argv[1] + object_files = sys.argv[2:] + + patch_relocs(build_dir, object_files)