1
- From 724d3056fae124c059a15563a0ed1e55799cdf81 Mon Sep 17 00:00:00 2001
1
+ From 061b9339c6c76064e3930ee81811be058ca853fc Mon Sep 17 00:00:00 2001
2
2
From: Yuta Saito <
[email protected] >
3
3
Date: Thu, 19 Sep 2024 04:45:51 +0000
4
4
Subject: [PATCH 2/2] [wasm] Configure LLVM for WebAssembly target
@@ -11,11 +11,11 @@ we fixed the stdlib build to use `WASI` as the system name properly in
11
11
the previous commit. This exposed the issue that the host LLVM build
12
12
directory is not suitable for configuring the stdlib build.
13
13
---
14
- .../products/wasmstdlib.py | 50 ++++++++++++++++---
15
- 1 file changed, 44 insertions(+), 6 deletions(-)
14
+ .../products/wasmstdlib.py | 51 ++++++++++++++++---
15
+ 1 file changed, 45 insertions(+), 6 deletions(-)
16
16
17
17
diff --git a/utils/swift_build_support/swift_build_support/products/wasmstdlib.py b/utils/swift_build_support/swift_build_support/products/wasmstdlib.py
18
- index d042fc38038..03a24a85fae 100644
18
+ index d042fc38038..053756139d5 100644
19
19
--- a/utils/swift_build_support/swift_build_support/products/wasmstdlib.py
20
20
+++ b/utils/swift_build_support/swift_build_support/products/wasmstdlib.py
21
21
@@ -17,6 +17,8 @@ from . import llvm
@@ -27,7 +27,7 @@ index d042fc38038..03a24a85fae 100644
27
27
28
28
29
29
class WasmStdlib(cmake_product.CMakeProduct):
30
- @@ -39,13 +41,49 @@ class WasmStdlib(cmake_product.CMakeProduct):
30
+ @@ -39,13 +41,50 @@ class WasmStdlib(cmake_product.CMakeProduct):
31
31
return self.args.test_wasmstdlib
32
32
33
33
def build(self, host_target):
@@ -49,6 +49,7 @@ index d042fc38038..03a24a85fae 100644
49
49
+ llvm_source_dir = os.path.join(
50
50
+ os.path.dirname(self.source_dir), 'llvm-project', 'llvm')
51
51
+ cmake_options = cmake.CMakeOptions()
52
+ + cmake_options.define('CMAKE_BUILD_TYPE:STRING', self._build_variant)
52
53
+ # compiler-rt for WebAssembly target is not installed in the host toolchain
53
54
+ # so skip compiler health checks here.
54
55
+ cmake_options.define('CMAKE_C_COMPILER_WORKS:BOOL', 'TRUE')
@@ -79,7 +80,7 @@ index d042fc38038..03a24a85fae 100644
79
80
self.cmake_options.define(
80
81
'SWIFT_STDLIB_BUILD_TYPE:STRING', self._build_variant)
81
82
82
- @@ -71,9 +109 ,6 @@ class WasmStdlib(cmake_product.CMakeProduct):
83
+ @@ -71,9 +110 ,6 @@ class WasmStdlib(cmake_product.CMakeProduct):
83
84
self.cmake_options.define('SWIFT_WASI_SYSROOT_PATH:STRING',
84
85
self._wasi_sysroot_path(target_triple))
85
86
@@ -89,7 +90,7 @@ index d042fc38038..03a24a85fae 100644
89
90
self.cmake_options.define('LLVM_DIR:PATH', llvm_cmake_dir)
90
91
91
92
# Standalone stdlib configuration
92
- @@ -90,6 +125 ,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
93
+ @@ -90,6 +126 ,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
93
94
self.cmake_options.define('SWIFT_BUILD_STATIC_STDLIB:BOOL', 'TRUE')
94
95
self.cmake_options.define('SWIFT_BUILD_DYNAMIC_STDLIB:BOOL', 'FALSE')
95
96
self.cmake_options.define('SWIFT_BUILD_STATIC_SDK_OVERLAY:BOOL', 'TRUE')
@@ -99,7 +100,7 @@ index d042fc38038..03a24a85fae 100644
99
100
self.cmake_options.define('SWIFT_STDLIB_TRACING:BOOL', 'FALSE')
100
101
self.cmake_options.define('SWIFT_STDLIB_HAS_ASLR:BOOL', 'FALSE')
101
102
self.cmake_options.define('SWIFT_STDLIB_CONCURRENCY_TRACING:BOOL', 'FALSE')
102
- @@ -200,7 +238 ,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
103
+ @@ -200,7 +239 ,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
103
104
104
105
class WasmThreadsStdlib(WasmStdlib):
105
106
def build(self, host_target):
0 commit comments