Skip to content

Commit

Permalink
Fix #1059: Linking for mingw/x86_64 on MSYS2 fails, w/ ar execution s…
Browse files Browse the repository at this point in the history
…peed up
  • Loading branch information
feiyunw committed Mar 31, 2023
1 parent 88e135d commit 189f56c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/my_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def mySubProcess(cmdline, env):
return rv

def mySpawn(sh, escape, cmd, args, env):
if len(args) > 3 and cmd.endswith("ar"):
rv = 0
if len(args) > 4 and cmd.endswith("ar"):
# print("Long ar command is split.\nargc=", len(args))
lead = len(" ".join(args[0:3]))
begin = 3
length = lead + 1 + len(args[begin])
rv = 0
for i in range(4, len(args)):
length += 1 + len(args[i])
if length >= 8 * 1024 - 32:
Expand All @@ -37,7 +37,7 @@ def mySpawn(sh, escape, cmd, args, env):
if rv:
break
begin = i
length = lead + 1 + len(args[i])
length = lead + 1 + len(args[begin])
if not rv:
cmdline = " ".join(args[0:3] + args[begin:])
# print("objs=", len(args) - begin, ", length=", len(cmdline))
Expand Down

0 comments on commit 189f56c

Please sign in to comment.