Skip to content

Commit 422d982

Browse files
committed
Prevent crash when library has multiple identically named object files.
1 parent 90a212b commit 422d982

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/__np__/windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def rename_symbols_in_file(target_lib, prefix, protected_symbols=None):
151151
__np__.packaging.install_build_tool("7zip")
152152
target_lib_abs = os.path.abspath(target_lib)
153153
with tempfile.TemporaryDirectory() as tmpdir:
154-
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-o" + tmpdir, cwd=tmpdir)
154+
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-aou", "-o" + tmpdir, cwd=tmpdir)
155155
obj_list = []
156156
known_symbols = set()
157157
unmatched_symbols = set()
@@ -204,7 +204,7 @@ def rename_init_symbol_in_file(target_lib):
204204
hasher.update(chunk)
205205
file_hash = hasher.hexdigest()
206206

207-
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-o" + tmpdir, cwd=os.getcwd())
207+
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-aou", "-o" + tmpdir, cwd=os.getcwd())
208208

209209
obj_paths_in_tmpdir = []
210210
modified_any_obj = False
@@ -268,7 +268,7 @@ def remove_symbols_in_file(target_lib, object_file, symbols):
268268
__np__.packaging.install_build_tool("clang")
269269
__np__.packaging.install_build_tool("7zip")
270270
with tempfile.TemporaryDirectory() as tmpdir:
271-
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-o" + tmpdir, cwd=tmpdir)
271+
run_build_tool_exe("7zip", "7z.exe", "e", target_lib_abs, "-aou", "-o" + tmpdir, cwd=tmpdir)
272272

273273
obj_list = [os.path.join(tmpdir, x) for x in os.listdir(tmpdir) if x.endswith(".obj")]
274274

0 commit comments

Comments
 (0)