Skip to content

Commit c4e4bfc

Browse files
Repair lit.cfg in release/5.9
1 parent 8ef0cec commit c4e4bfc

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From b42bf448f82ff197b742f7d85a4e15dba72037e7 Mon Sep 17 00:00:00 2001
2+
From: Yuta Saito <kateinoigakukun@gmail.com>
3+
Date: Sun, 29 Oct 2023 23:27:31 +0000
4+
Subject: [PATCH] [lit] Repair tests for stdlib-only build
5+
6+
`config.host_triple` can be None when no host tools are built
7+
8+
This is based on 21d57e887ad1f2d319b8e89af90d2732d50ecf55 in main branch
9+
---
10+
test/lit.cfg | 8 +++++---
11+
1 file changed, 5 insertions(+), 3 deletions(-)
12+
13+
diff --git a/test/lit.cfg b/test/lit.cfg
14+
index 8a955f0da88..c989777dfd5 100644
15+
--- a/test/lit.cfg
16+
+++ b/test/lit.cfg
17+
@@ -566,8 +566,10 @@ else:
18+
)
19+
)
20+
# Parse the host triple.
21+
- (host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
22+
- toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
23+
+ toolchain_lib_dir = None
24+
+ if config.host_triple:
25+
+ (host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
26+
+ toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
27+
config.host_build_swift = (
28+
"%s -target %s -g %s -I %s -L %s %s" % (
29+
config.swiftc_driver,
30+
@@ -575,7 +577,7 @@ else:
31+
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
32+
config.swift_build_lib_dir,
33+
config.swift_build_lib_dir,
34+
- '' if kIsWindows else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
35+
+ '' if kIsWindows or toolchain_lib_dir is None else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
36+
)
37+
)
38+
39+
--
40+
2.40.0
41+

0 commit comments

Comments
 (0)