From 189f56c34e8f77c30fedcbe68bc946f2a75b93f0 Mon Sep 17 00:00:00 2001 From: Feiyun Wang Date: Sat, 1 Apr 2023 01:20:41 +0800 Subject: [PATCH] Fix #1059: Linking for mingw/x86_64 on MSYS2 fails, w/ ar execution speed up --- tools/my_spawn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/my_spawn.py b/tools/my_spawn.py index 8ddda05e..95b87fa8 100644 --- a/tools/my_spawn.py +++ b/tools/my_spawn.py @@ -22,12 +22,12 @@ def configure(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: @@ -37,7 +37,7 @@ def configure(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))