4
4
SOURCE_PATH=" $( cd " $( dirname " $0 " ) /../../.." && pwd) "
5
5
UTILS_PATH=" $( cd " $( dirname " $0 " ) " && pwd) "
6
6
7
- WASI_SDK_PATH=$SOURCE_PATH /wasi-sdk
7
+ WASI_SDK_PATH=" $SOURCE_PATH /wasi-sdk"
8
+ WASI_SYSROOT_PATH=" $WASI_SDK_PATH /share/wasi-sysroot"
8
9
9
10
case $( uname -s) in
10
11
Darwin)
@@ -74,7 +75,7 @@ build_target_toolchain() {
74
75
-D CMAKE_C_COMPILER_LAUNCHER=" $( which sccache) " \
75
76
-D CMAKE_CXX_COMPILER_LAUNCHER=" $( which sccache) " \
76
77
-D CMAKE_INSTALL_PREFIX=" $DIST_TOOLCHAIN_SDK /usr/lib/clang/10.0.0/" \
77
- -D COMPILER_RT_SWIFT_WASI_SDK_PATH =" $WASI_SDK_PATH " \
78
+ -D CMAKE_SYSROOT =" ${WASI_SYSROOT_PATH} " \
78
79
-G Ninja \
79
80
-S " $SOURCE_PATH /llvm-project/compiler-rt"
80
81
@@ -93,7 +94,7 @@ build_target_toolchain() {
93
94
-D CMAKE_INSTALL_PREFIX=" $DIST_TOOLCHAIN_SDK /usr" \
94
95
-D LLVM_DIR=" $HOST_BUILD_DIR /llvm-$HOST_SUFFIX /lib/cmake/llvm/" \
95
96
-D SWIFT_NATIVE_SWIFT_TOOLS_PATH=" $HOST_BUILD_DIR /swift-$HOST_SUFFIX /bin" \
96
- -D SWIFT_WASI_SDK_PATH =" $WASI_SDK_PATH " \
97
+ -D SWIFT_WASI_SYSROOT_PATH =" $WASI_SYSROOT_PATH " \
97
98
-G Ninja \
98
99
-S " $SOURCE_PATH /swift"
99
100
@@ -110,8 +111,8 @@ build_target_toolchain() {
110
111
# Remove host CoreFoundation module directory to avoid module conflict
111
112
# while building Foundation
112
113
rm -rf " $DIST_TOOLCHAIN_SDK /usr/lib/swift_static/CoreFoundation"
113
- " $UTILS_PATH /build-foundation.sh" " $DIST_TOOLCHAIN_SDK "
114
- " $UTILS_PATH /build-xctest.sh" " $DIST_TOOLCHAIN_SDK "
114
+ " $UTILS_PATH /build-foundation.sh" " $DIST_TOOLCHAIN_SDK " " $WASI_SYSROOT_PATH "
115
+ " $UTILS_PATH /build-xctest.sh" " $DIST_TOOLCHAIN_SDK " " $WASI_SYSROOT_PATH "
115
116
116
117
}
117
118
0 commit comments