Skip to content

Commit

Permalink
Use upstream wasi-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Oct 31, 2023
1 parent 2ffd167 commit 300de06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
BUILD := build
ICU_DATA_FILTER_FILE := $(CURDIR)/data-filters/swift-minimal.json
WASI_LIBC_EMULATION_FLAGS := -D_WASI_EMULATED_SIGNAL

$(BUILD)/icu4c-src.tgz:
mkdir -p $(@D)
Expand Down Expand Up @@ -45,8 +46,8 @@ endif
--with-data-packaging=static \
CC="$(WASI_SDK_PATH)/bin/clang" CXX="$(WASI_SDK_PATH)/bin/clang++" \
AR="$(WASI_SDK_PATH)/bin/llvm-ar" RANLIB="$(WASI_SDK_PATH)/bin/llvm-ranlib" \
CFLAGS="--sysroot $(WASI_SDK_PATH)/share/wasi-sysroot" \
CXXFLAGS="-fno-exceptions --sysroot $(WASI_SDK_PATH)/share/wasi-sysroot" && \
CFLAGS="--sysroot $(WASI_SDK_PATH)/share/wasi-sysroot $(WASI_LIBC_EMULATION_FLAGS)" \
CXXFLAGS="-fno-exceptions --sysroot $(WASI_SDK_PATH)/share/wasi-sysroot $(WASI_LIBC_EMULATION_FLAGS)"
$(MAKE) && \
$(MAKE) install DESTDIR=$(CURDIR)/$(BUILD)/icu4c-out/cross/install/icu
touch $@
Expand Down
15 changes: 3 additions & 12 deletions ci/install-build-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ set -xe

: ${BUILD_DIR:?"BUILD_DIR is missing"}

mkdir -p $BUILD_DIR/ci
mkdir -p $BUILD_DIR/ci/wasi-sdk

# install the Wasi SDK
wget -O $BUILD_DIR/ci/dist-wasi-sdk.tgz.zip "https://github.com/swiftwasm/wasi-sdk/releases/download/0.2.0-swiftwasm/dist-ubuntu-latest.tgz.zip"
unzip $BUILD_DIR/ci/dist-wasi-sdk.tgz.zip -d $BUILD_DIR/ci
WASI_SDK_TAR_PATH=$(find $BUILD_DIR/ci -type f -name "wasi-sdk-*")
WASI_SDK_FULL_NAME=$(basename $WASI_SDK_TAR_PATH -linux.tar.gz)
tar xfz $WASI_SDK_TAR_PATH -C $BUILD_DIR/ci
mv $BUILD_DIR/ci/$WASI_SDK_FULL_NAME $BUILD_DIR/ci/wasi-sdk

# Link wasm32-wasi-unknown to wasm32-wasi because clang finds crt1.o from sysroot
# with os and environment name `getMultiarchTriple`.
ln -s wasm32-wasi $BUILD_DIR/ci/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasi-unknown
curl -L -o $BUILD_DIR/ci/dist-wasi-sdk.tar.gz "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-linux.tar.gz"
tar -xzf $BUILD_DIR/ci/dist-wasi-sdk.tar.gz --strip-components=1 -C $BUILD_DIR/ci/wasi-sdk

0 comments on commit 300de06

Please sign in to comment.