Skip to content

Commit 893de78

Browse files
Configure LLVM for host target for now
1 parent 13a200a commit 893de78

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

schemes/main/swift/0002-wasm-Configure-LLVM-for-WebAssembly-target-independe.patch

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 8b7f1aaa735d1d0b994fc9ac9009f4bc9805a142 Mon Sep 17 00:00:00 2001
1+
From 724d3056fae124c059a15563a0ed1e55799cdf81 Mon Sep 17 00:00:00 2001
22
From: Yuta Saito <[email protected]>
33
Date: Thu, 19 Sep 2024 04:45:51 +0000
44
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
1111
the previous commit. This exposed the issue that the host LLVM build
1212
directory is not suitable for configuring the stdlib build.
1313
---
14-
.../products/wasmstdlib.py | 54 ++++++++++++++++---
15-
1 file changed, 48 insertions(+), 6 deletions(-)
14+
.../products/wasmstdlib.py | 50 ++++++++++++++++---
15+
1 file changed, 44 insertions(+), 6 deletions(-)
1616

1717
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..09d90be7fe9 100644
18+
index d042fc38038..03a24a85fae 100644
1919
--- a/utils/swift_build_support/swift_build_support/products/wasmstdlib.py
2020
+++ b/utils/swift_build_support/swift_build_support/products/wasmstdlib.py
2121
@@ -17,6 +17,8 @@ from . import llvm
@@ -27,7 +27,7 @@ index d042fc38038..09d90be7fe9 100644
2727

2828

2929
class WasmStdlib(cmake_product.CMakeProduct):
30-
@@ -39,13 +41,53 @@ class WasmStdlib(cmake_product.CMakeProduct):
30+
@@ -39,13 +41,49 @@ class WasmStdlib(cmake_product.CMakeProduct):
3131
return self.args.test_wasmstdlib
3232

3333
def build(self, host_target):
@@ -49,10 +49,6 @@ index d042fc38038..09d90be7fe9 100644
4949
+ llvm_source_dir = os.path.join(
5050
+ os.path.dirname(self.source_dir), 'llvm-project', 'llvm')
5151
+ cmake_options = cmake.CMakeOptions()
52-
+ cmake_options.define('CMAKE_BUILD_TYPE:STRING', self._build_variant)
53-
+ cmake_options.define('CMAKE_SYSTEM_NAME:STRING', 'WASI')
54-
+ cmake_options.define('CMAKE_SYSTEM_PROCESSOR:STRING', 'wasm32')
55-
+ cmake_options.define('UNIX:BOOL', 'TRUE')
5652
+ # compiler-rt for WebAssembly target is not installed in the host toolchain
5753
+ # so skip compiler health checks here.
5854
+ cmake_options.define('CMAKE_C_COMPILER_WORKS:BOOL', 'TRUE')
@@ -83,7 +79,7 @@ index d042fc38038..09d90be7fe9 100644
8379
self.cmake_options.define(
8480
'SWIFT_STDLIB_BUILD_TYPE:STRING', self._build_variant)
8581

86-
@@ -71,9 +113,6 @@ class WasmStdlib(cmake_product.CMakeProduct):
82+
@@ -71,9 +109,6 @@ class WasmStdlib(cmake_product.CMakeProduct):
8783
self.cmake_options.define('SWIFT_WASI_SYSROOT_PATH:STRING',
8884
self._wasi_sysroot_path(target_triple))
8985

@@ -93,7 +89,7 @@ index d042fc38038..09d90be7fe9 100644
9389
self.cmake_options.define('LLVM_DIR:PATH', llvm_cmake_dir)
9490

9591
# Standalone stdlib configuration
96-
@@ -90,6 +129,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
92+
@@ -90,6 +125,9 @@ class WasmStdlib(cmake_product.CMakeProduct):
9793
self.cmake_options.define('SWIFT_BUILD_STATIC_STDLIB:BOOL', 'TRUE')
9894
self.cmake_options.define('SWIFT_BUILD_DYNAMIC_STDLIB:BOOL', 'FALSE')
9995
self.cmake_options.define('SWIFT_BUILD_STATIC_SDK_OVERLAY:BOOL', 'TRUE')
@@ -103,7 +99,7 @@ index d042fc38038..09d90be7fe9 100644
10399
self.cmake_options.define('SWIFT_STDLIB_TRACING:BOOL', 'FALSE')
104100
self.cmake_options.define('SWIFT_STDLIB_HAS_ASLR:BOOL', 'FALSE')
105101
self.cmake_options.define('SWIFT_STDLIB_CONCURRENCY_TRACING:BOOL', 'FALSE')
106-
@@ -200,7 +242,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
102+
@@ -200,7 +238,7 @@ class WasmStdlib(cmake_product.CMakeProduct):
107103

108104
class WasmThreadsStdlib(WasmStdlib):
109105
def build(self, host_target):

0 commit comments

Comments
 (0)