mirror of
https://github.com/portable-lce/shiggy.git
synced 2026-09-21 23:43:10 +00:00
fix: specify full build path with patched_object_files
This commit is contained in:
@@ -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@',
|
||||
],
|
||||
)
|
||||
|
||||
@@ -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:])
|
||||
build_dir = sys.argv[1]
|
||||
object_files = sys.argv[2:]
|
||||
|
||||
patch_relocs(build_dir, object_files)
|
||||
|
||||
Reference in New Issue
Block a user