Skip to content

Commit 0d6b8eb

Browse files
authored
Merge pull request #921 from swiftwasm/swiftwasm-release/upstream-dispatch
[release] Copy Dispatch and Clang from upstream toolchain
2 parents 8750a0e + 38228d1 commit 0d6b8eb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

utils/webassembly/build-toolchain.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,15 @@ BUNDLE_IDENTIFIER="swiftwasm.5.3-${YEAR}${MONTH}${DAY}"
3535
DISPLAY_NAME_SHORT="Swift for WebAssembly 5.3 Snapshot"
3636
DISPLAY_NAME="${DISPLAY_NAME_SHORT} ${YEAR}-${MONTH}-${DAY}"
3737

38+
# Just a hack, spent enough time investigating this,
39+
# but somehow `master` is able to work without this `mkdir`.
40+
mkdir -p $SOURCE_PATH/install/$TOOLCHAIN_NAME/usr/lib/clang/10.0.0
3841
$BUILD_SCRIPT \
3942
--install_destdir="$SOURCE_PATH/install" \
4043
--installable_package="$INSTALLABLE_PACKAGE" \
4144
--install-prefix=/$TOOLCHAIN_NAME/usr \
45+
--swift-install-components "autolink-driver;compiler;clang-builtin-headers;stdlib;sdk-overlay;parser-lib;editor-integration;tools;testsuite-tools;toolchain-tools;license;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers;clang-resource-dir-symlink" \
46+
--llvm-install-components "clang" \
4247
--install-swift \
4348
--darwin-toolchain-bundle-identifier="${BUNDLE_IDENTIFIER}" \
4449
--darwin-toolchain-display-name="${DISPLAY_NAME}" \
@@ -61,7 +66,7 @@ cd $TMP_DIR/$TOOLCHAIN_NAME
6166

6267
# Merge wasi-sdk and toolchain
6368
cp -r $WASI_SDK_PATH/lib/clang usr/lib
64-
cp $WASI_SDK_PATH/bin/* usr/bin
69+
cp -a $WASI_SDK_PATH/bin/*ld usr/bin
6570
cp -r $WASI_SDK_PATH/share/wasi-sysroot usr/share
6671

6772
# Build SwiftPM and install it into toolchain
@@ -73,7 +78,9 @@ sed -i -e "s@\".*/include@\"../../../../share/wasi-sysroot/include@g" $TMP_DIR/$
7378
# Copy nightly-toolchain's host environment stdlib into toolchain
7479

7580
if [[ "$(uname)" == "Linux" ]]; then
76-
cp -r $NIGHTLY_TOOLCHAIN/usr/lib/swift/linux $TMP_DIR/$TOOLCHAIN_NAME/usr/lib/swift
81+
# Avoid to copy usr/lib/swift/clang because our toolchain's one is a directory
82+
# but nightly's one is symbolic link, so fail to merge them.
83+
rsync -a $NIGHTLY_TOOLCHAIN/usr/lib/ $TMP_DIR/$TOOLCHAIN_NAME/usr/lib/ --exclude 'swift/clang'
7784
else
7885
cp -r $NIGHTLY_TOOLCHAIN/usr/lib/swift/macosx $TMP_DIR/$TOOLCHAIN_NAME/usr/lib/swift
7986
fi

0 commit comments

Comments
 (0)