Skip to content

Commit fc1eb64

Browse files
ci: enable LLVM_COMPILER_CHECKED to spoof llvm compiler version check
1 parent e6972b0 commit fc1eb64

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

cmake/caches/Runtime-WASI-wasm32.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
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-
61
set(SWIFT_PRIMARY_VARIANT_SDK WASI CACHE STRING "")
72
set(SWIFT_PRIMARY_VARIANT_ARCH wasm32 CACHE STRING "")
83
set(SWIFT_HOST_VARIANT_SDK NONE CACHE STRING "")

utils/webassembly/build-toolchain.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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" \

0 commit comments

Comments
 (0)