1
- From 173de308e35d9cb7dcd65b0726ccd86bc2e0eb9b Mon Sep 17 00:00:00 2001
1
+ From 24bd384f841df8f357fe35c6cc890cd7b15a4114 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 | 58 +++++++++++++++++--
15
- 1 file changed, 52 insertions(+), 6 deletions(-)
14
+ .../products/wasmstdlib.py | 60 +++++++++++++++++--
15
+ 1 file changed, 54 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..3c93a7a679f 100644
18
+ index d042fc38038..70299e37885 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..3c93a7a679f 100644
27
27
28
28
29
29
class WasmStdlib(cmake_product.CMakeProduct):
30
- @@ -39,13 +41,50 @@ class WasmStdlib(cmake_product.CMakeProduct):
30
+ @@ -39,13 +41,52 @@ class WasmStdlib(cmake_product.CMakeProduct):
31
31
return self.args.test_wasmstdlib
32
32
33
33
def build(self, host_target):
@@ -57,6 +57,8 @@ index d042fc38038..3c93a7a679f 100644
57
57
+ cmake_options.define('LLVM_COMPILER_CHECKED:BOOL', 'TRUE')
58
58
+ cmake_options.define('LLVM_ENABLE_ZLIB:BOOL', 'FALSE')
59
59
+ cmake_options.define('LLVM_ENABLE_LIBXML2:BOOL', 'FALSE')
60
+ + cmake_options.define('LLVM_ENABLE_LIBEDIT:BOOL', 'FALSE')
61
+ + cmake_options.define('LLVM_ENABLE_TERMINFO:BOOL', 'FALSE')
60
62
+
61
63
+ llvm_cmake = cmake.CMake(
62
64
+ self.args, self.toolchain, prefer_native_toolchain=True)
@@ -80,7 +82,7 @@ index d042fc38038..3c93a7a679f 100644
80
82
self.cmake_options.define(
81
83
'SWIFT_STDLIB_BUILD_TYPE:STRING', self._build_variant)
82
84
83
- @@ -71,9 +110 ,13 @@ class WasmStdlib(cmake_product.CMakeProduct):
85
+ @@ -71,9 +112 ,13 @@ class WasmStdlib(cmake_product.CMakeProduct):
84
86
self.cmake_options.define('SWIFT_WASI_SYSROOT_PATH:STRING',
85
87
self._wasi_sysroot_path(target_triple))
86
88
@@ -97,7 +99,7 @@ index d042fc38038..3c93a7a679f 100644
97
99
self.cmake_options.define('LLVM_DIR:PATH', llvm_cmake_dir)
98
100
99
101
# Standalone stdlib configuration
100
- @@ -90,6 +133 ,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
102
+ @@ -90,6 +135 ,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
101
103
self.cmake_options.define('SWIFT_BUILD_STATIC_STDLIB:BOOL', 'TRUE')
102
104
self.cmake_options.define('SWIFT_BUILD_DYNAMIC_STDLIB:BOOL', 'FALSE')
103
105
self.cmake_options.define('SWIFT_BUILD_STATIC_SDK_OVERLAY:BOOL', 'TRUE')
@@ -107,7 +109,7 @@ index d042fc38038..3c93a7a679f 100644
107
109
self.cmake_options.define('SWIFT_STDLIB_TRACING:BOOL', 'FALSE')
108
110
self.cmake_options.define('SWIFT_STDLIB_HAS_ASLR:BOOL', 'FALSE')
109
111
self.cmake_options.define('SWIFT_STDLIB_CONCURRENCY_TRACING:BOOL', 'FALSE')
110
- @@ -200,7 +246 ,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
112
+ @@ -200,7 +248 ,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
111
113
112
114
class WasmThreadsStdlib(WasmStdlib):
113
115
def build(self, host_target):
0 commit comments