Skip to content

Commit 99ece01

Browse files
committed
[lldb/win] Fix TestIRMemoryMapWindows.test when running tests in git bash
lit.util.which('link') picks up the wrong link.exe in git bash, leading to this error: # command stderr: /usr/bin/link: extra operand '/LIBPATH:C:\\Progra....' Try '/usr/bin/link --help' for more information. Instead, assume that link.exe is next to cl.exe. Differential Revision: https://reviews.llvm.org/D109832
1 parent 17f1ccc commit 99ece01

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lldb/test/Shell/helper/toolchain.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ def _use_msvc_substitutions(config):
9090
# detect the include and lib paths, and find cl.exe and link.exe and create
9191
# substitutions for each of them that explicitly specify /I and /L paths
9292
cl = lit.util.which('cl')
93-
link = lit.util.which('link')
9493

95-
if not cl or not link:
94+
if not cl:
9695
return
9796

97+
# Don't use lit.util.which() for link.exe: In `git bash`, it will pick
98+
# up /usr/bin/link (another name for ln).
99+
link = os.path.join(os.path.dirname(cl), 'link.exe')
100+
98101
cl = '"' + cl + '"'
99102
link = '"' + link + '"'
100103
includes = os.getenv('INCLUDE', '').split(';')

0 commit comments

Comments
 (0)