File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1- # FIXME(katei): Platform/WASI is not recognized as a platform in LLVM, so it reports
2- # "Unable to determine platform" while handling LLVM options.
3- # Set WASI as a UNIX platform to spoof LLVM
4- set (UNIX 1 )
5-
61set (SWIFT_PRIMARY_VARIANT_SDK WASI CACHE STRING "" )
72set (SWIFT_PRIMARY_VARIANT_ARCH wasm32 CACHE STRING "" )
83set (SWIFT_HOST_VARIANT_SDK NONE CACHE STRING "" )
Original file line number Diff line number Diff line change @@ -105,6 +105,12 @@ build_target_toolchain() {
105105 -S " $SOURCE_PATH /llvm-project/llvm"
106106
107107 local SWIFT_STDLIB_BUILD_DIR=" $TARGET_BUILD_ROOT /swift-stdlib-wasi-wasm32"
108+
109+ # FIXME(katei): Platform/WASI is not recognized as a platform in LLVM, so it reports
110+ # "Unable to determine platform" while handling LLVM options.
111+ # Set WASI as a UNIX platform to spoof LLVM
112+ # FIXME(katei): host-build clang's libcxx is capable with LLVM, but it somehow
113+ # fails libcxx version check. So activate LLVM_COMPILER_CHECKED to spoof the checker
108114 cmake -B " $SWIFT_STDLIB_BUILD_DIR " \
109115 -C " $SOURCE_PATH /swift/cmake/caches/Runtime-WASI-wasm32.cmake" \
110116 -D CMAKE_TOOLCHAIN_FILE=" $SOURCE_PATH /swift/utils/webassembly/toolchain-wasi.cmake" \
@@ -114,6 +120,8 @@ build_target_toolchain() {
114120 -D CMAKE_INSTALL_PREFIX=" $DIST_TOOLCHAIN_SDK /usr" \
115121 -D LLVM_BIN=" $HOST_BUILD_DIR /llvm-$HOST_SUFFIX /bin" \
116122 -D LLVM_DIR=" $LLVM_TARGET_BUILD_DIR /lib/cmake/llvm/" \
123+ -D LLVM_COMPILER_CHECKED=YES \
124+ -D UNIX=1 \
117125 -D SWIFT_NATIVE_SWIFT_TOOLS_PATH=" $HOST_BUILD_DIR /swift-$HOST_SUFFIX /bin" \
118126 -D SWIFT_WASI_SYSROOT_PATH=" $WASI_SYSROOT_PATH " \
119127 -D SWIFT_WASI_wasm32_ICU_UC_INCLUDE=" $BUILD_SDK_PATH /icu/include" \
You can’t perform that action at this time.
0 commit comments