@@ -28,8 +28,9 @@ build_target_toolchain() {
28
28
local SWIFT_BIN_DIR=" $3 "
29
29
local TRIPLE=" $4 "
30
30
local SHORT_TRIPLE=" $5 "
31
- local STDLIB_PRODUCT=" $6 "
32
- local COMPILER_RT_OS_DIR=" $7 "
31
+ local CLANG_MULTIARCH_TRIPLE=" $6 "
32
+ local STDLIB_PRODUCT=" $7 "
33
+ local COMPILER_RT_OS_DIR=" $8 "
33
34
34
35
local HOST_SUFFIX
35
36
HOST_SUFFIX=$( find " $TARGET_BUILD_ROOT " -name " wasmstdlib-*" -exec basename {} \; | sed ' s/wasmstdlib-//' )
@@ -39,9 +40,16 @@ build_target_toolchain() {
39
40
env DESTDIR=" $TRIPLE_DESTDIR " \
40
41
cmake --install " $TARGET_BUILD_ROOT /$STDLIB_PRODUCT -$HOST_SUFFIX " --prefix /usr
41
42
43
+ local swift_testing_build_dir=" $TARGET_BUILD_ROOT /swift-testing-$SHORT_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
49
+
42
50
rm -rf " $TRIPLE_DESTDIR /usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR "
43
51
# XXX: Is this the right way to install compiler-rt?
44
- cp -R " $TARGET_BUILD_ROOT /wasi-sysroot/$SHORT_TRIPLE /lib/$COMPILER_RT_OS_DIR " " $TRIPLE_DESTDIR /usr/lib/swift_static/clang/lib/$COMPILER_RT_OS_DIR "
52
+ 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 "
45
53
46
54
# FIXME: Clang resource directory installation is not the best way currently.
47
55
# We currently have two copies of compiler headers copied from the base toolchain in
@@ -160,8 +168,8 @@ main() {
160
168
" $OPTIONS_SWIFT_BIN "
161
169
)
162
170
163
- build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasi" " wasm32-wasi" " wasmstdlib" " wasi"
164
- build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasip1-threads" " wasm32-wasip1-threads" " wasmthreadsstdlib" " wasip1"
171
+ build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasi" " wasi-wasm32 " " wasm32-wasi" " wasmstdlib" " wasi"
172
+ build_target_toolchain " ${BUILD_TOOLS_ARGS[@]} " " wasm32-unknown-wasip1-threads" " wasip1-threads-wasm32 " " wasm32-wasip1-threads" " wasmthreadsstdlib" " wasip1"
165
173
166
174
rsync -av " $WASI_SYSROOT_PATH /" " $PACKAGING_DIR /wasi-sysroot/"
167
175
0 commit comments