Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade wasi sdk to v20 with threads #69

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions scripts/update-proposal-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ REPOS=(
"wasi-threads"
)

WASI_VERSION=16
WASI_VERSION=20
WASI_SDK_DIR=$(pwd)/wasi-sdk
BASE_BRANCH="prod/testsuite-base"
PROPOSALS_DIR="tests/proposals"
Expand All @@ -18,20 +18,14 @@ fi

function install_wasi_sdk()
{
curl -L -f https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION}.0-linux.tar.gz --output wasi-sdk.tar.gz
curl -L -f https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}%2Bthreads/wasi-sdk-${WASI_VERSION}.0.threads-linux.tar.gz --output wasi-sdk.tar.gz
loganek marked this conversation as resolved.
Show resolved Hide resolved
tar xvf wasi-sdk.tar.gz
mv wasi-sdk-${WASI_VERSION}.0 $WASI_SDK_DIR
mv wasi-sdk-${WASI_VERSION}.0+threads $WASI_SDK_DIR
}

function build_wasi-threads()
{
# Compile wasi-libc with thread support as it's not available yet in wasi-sdk
git clone https://github.com/WebAssembly/wasi-libc.git
pushd wasi-libc
CC=$WASI_SDK_DIR/bin/clang make -j 15 THREAD_MODEL=posix
SYSROOT=$(pwd)/sysroot
popd
CC="$WASI_SDK_DIR/bin/clang -D_REENTRANT -matomics -Wl,--import-memory -Wl,--shared-memory --sysroot=$SYSROOT --target=wasm32-wasi-threads -Wno-error=implicit-function-declaration" ./build.sh
CC="$WASI_SDK_DIR/bin/clang -pthread -Wl,--import-memory --target=wasm32-wasi-threads" ./build.sh
}

function update_repo()
Expand Down