@@ -40,48 +40,16 @@ build_target_toolchain() {
4040 env DESTDIR=" $TRIPLE_DESTDIR " \
4141 cmake --install " $TARGET_BUILD_ROOT /$STDLIB_PRODUCT -$HOST_SUFFIX " --prefix /usr
4242
43- local swift_testing_build_dir =" $TARGET_BUILD_ROOT /wasmswiftsdk- $HOST_SUFFIX /swift-testing/ $TRIPLE "
44- # TODO: Remove this check once we build swift-testing for +threads target
45- if [[ -d " $swift_testing_build_dir " ]] ; then
46- env DESTDIR= " $TRIPLE_DESTDIR " \
47- cmake --install " $swift_testing_build_dir " --prefix /usr
48- fi
43+ env DESTDIR =" $TRIPLE_DESTDIR " \
44+ cmake --install " $TARGET_BUILD_ROOT /wasmswiftsdk- $HOST_SUFFIX / swift-testing/ $TRIPLE " --prefix /usr
45+ env DESTDIR= " $TRIPLE_DESTDIR " \
46+ cmake --install " $TARGET_BUILD_ROOT /wasmswiftsdk- $HOST_SUFFIX /foundation/ $TRIPLE " --prefix /usr
47+ env DESTDIR= " $TRIPLE_DESTDIR " \
48+ cmake --install " $TARGET_BUILD_ROOT /wasmswiftsdk- $HOST_SUFFIX /xctest/ $TRIPLE " --prefix /usr
4949
5050 rm -rf " $TRIPLE_DESTDIR /usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR "
5151 # XXX: Is this the right way to install compiler-rt?
5252 cp -R " $TARGET_BUILD_ROOT /wasi-sysroot/$CLANG_MULTIARCH_TRIPLE /lib/$COMPILER_RT_OS_DIR " " $TRIPLE_DESTDIR /usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR "
53-
54- # FIXME: Clang resource directory installation is not the best way currently.
55- # We currently have two copies of compiler headers copied from the base toolchain in
56- # lib/swift/clang and lib/swift_static/clang. This is because the Swift CMake build
57- # system installs the compiler headers from the native tools path when not building
58- # tools including clang compiler. This is not ideal but then where should we bring
59- # the compiler headers from? If we use the headers beside the base toolchain, clang
60- # driver will not be able to find libclang_rt.builtins-wasm32.a because it is not
61- # a part of the base toolchain. We need to find a better way to handle this.
62- local CLANG_VERSION
63- CLANG_VERSION=" $( basename " $( $CLANG_BIN_DIR /clang -print-resource-dir) " ) "
64- mkdir -p " $TRIPLE_DESTDIR /usr/lib/clang/$CLANG_VERSION /lib"
65- ln -sf " ../../../swift_static/clang/lib/$COMPILER_RT_OS_DIR " " $TRIPLE_DESTDIR /usr/lib/clang/$CLANG_VERSION /lib/$COMPILER_RT_OS_DIR "
66- }
67-
68- build_target_corelibs () {
69- local LLVM_BIN_DIR=" $1 "
70- local CLANG_BIN_DIR=" $2 "
71- local SWIFT_BIN_DIR=" $3 "
72- local TRIPLE=" $4 "
73- local SHORT_TRIPLE=" $5 "
74-
75- local TRIPLE_DESTDIR=" $TARGET_TOOLCHAIN_DESTDIR /$TRIPLE "
76- local CORELIBS_ARGS=(
77- " $TRIPLE_DESTDIR "
78- " $LLVM_BIN_DIR "
79- " $CLANG_BIN_DIR "
80- " $SWIFT_BIN_DIR "
81- " $WASI_SYSROOT_PATH /$SHORT_TRIPLE "
82- )
83- " $SCHEMES_BUILD_PATH /build-foundation.sh" " ${CORELIBS_ARGS[@]} " " $TRIPLE "
84- " $SCHEMES_BUILD_PATH /build-xctest.sh" " ${CORELIBS_ARGS[@]} " " $TRIPLE "
8553}
8654
8755main () {
@@ -171,13 +139,10 @@ main() {
171139 " $OPTIONS_SWIFT_BIN "
172140 )
173141
174- build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasi " " wasi -wasm32" " wasm32-wasi " " wasmstdlib" " wasi "
142+ build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasip1 " " wasip1 -wasm32" " wasm32-wasip1 " " wasmstdlib" " wasip1 "
175143 build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasip1-threads" " wasip1-threads-wasm32" " wasm32-wasip1-threads" " wasmthreadsstdlib" " wasip1"
176144
177145 rsync -av " $WASI_SYSROOT_PATH /" " $PACKAGING_DIR /wasi-sysroot/"
178-
179- build_target_corelibs " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasi" " wasm32-wasi"
180- build_target_corelibs " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasip1-threads" " wasm32-wasip1-threads"
181146}
182147
183148main " $@ "
0 commit comments