Skip to content

Commit

Permalink
test: update location of builtins library
Browse files Browse the repository at this point in the history
`wasi-sdk` now packages the Clang builtins in a different directory than
it used to.
  • Loading branch information
abrown committed Nov 15, 2024
1 parent 851880c commit cc9d08d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ jobs:
export WASIP1_DIR=$(realpath $($CLANG_DIR/clang -print-resource-dir)/lib/wasip1/)
export WASIP2_DIR=$(realpath $($CLANG_DIR/clang -print-resource-dir)/lib/wasip2/)
mkdir -p $WASI_DIR $WASIP1_DIR $WASIP2_DIR
cp download/lib/wasi/libclang_rt.builtins-wasm32.a $WASI_DIR
cp download/lib/wasi/libclang_rt.builtins-wasm32.a $WASIP1_DIR
cp download/lib/wasi/libclang_rt.builtins-wasm32.a $WASIP2_DIR
cp download/libclang_rt.builtins-wasm32.a $WASI_DIR
cp download/libclang_rt.builtins-wasm32.a $WASIP1_DIR
cp download/libclang_rt.builtins-wasm32.a $WASIP2_DIR
TARGET_TRIPLE=wasm32-wasi make test
rm -r build
TARGET_TRIPLE=wasm32-wasip1 make test
Expand Down
11 changes: 6 additions & 5 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ TARGET_TRIPLE ?= wasm32-wasi
LIBC_TEST_URL ?= https://github.com/bytecodealliance/libc-test
LIBC_TEST = $(DOWNDIR)/libc-test
LIBRT_URL ?= https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-24/libclang_rt.builtins-wasm32-wasi-24.0.tar.gz
LIBRT = $(DOWNDIR)/lib/wasi/libclang_rt.builtins-wasm32.a
LIBRT = $(DOWNDIR)/libclang_rt.builtins-wasm32.a
WASMTIME_URL ?= https://github.com/bytecodealliance/wasmtime/releases/download/v26.0.1/wasmtime-v26.0.1-x86_64-linux.tar.xz
WASMTIME = $(DOWNDIR)/$(shell basename $(WASMTIME_URL) .tar.xz)/wasmtime
WASM_TOOLS_URL ?= https://github.com/bytecodealliance/wasm-tools/releases/download/wasm-tools-1.220.0/wasm-tools-1.220.0-x86_64-linux.tar.gz
Expand All @@ -44,10 +44,11 @@ $(DOWNDIR):
$(LIBC_TEST): | $(DOWNDIR)
git clone --depth 1 $(LIBC_TEST_URL) $@

# TODO install target to place into...
# TODO: add install target to copy builtins library directly into a Clang
# installation.
$(LIBRT): | $(DOWNDIR)
wget --no-clobber --directory-prefix=$(DOWNDIR) $(LIBRT_URL)
tar --extract --file=$(DOWNDIR)/$(shell basename $(LIBRT_URL)) --directory=$(DOWNDIR)/
tar --extract --file=$(DOWNDIR)/$(shell basename $(LIBRT_URL)) --strip-components=1 --directory=$(DOWNDIR)/

$(WASMTIME): | $(DOWNDIR)
wget --no-clobber --directory-prefix=$(DOWNDIR) $(WASMTIME_URL)
Expand All @@ -61,7 +62,7 @@ $(ADAPTER): | $(DOWNDIR)
wget --no-clobber --directory-prefix=$(DOWNDIR) $(ADAPTER_URL)

clean::
rm -rf download
rm -rf $(DOWNDIR)

##### BUILD ####################################################################

Expand Down Expand Up @@ -145,7 +146,7 @@ endif
# due to a missing `libclang_rt.builtins-wasm32.a` in the Clang lib directory.
# This location is system-dependent, but could be fixed by something like:
# $ sudo mkdir /usr/lib64/clang/14.0.5/lib/wasi
# $ sudo cp download/lib/wasi/libclang_rt.builtins-wasm32.a /usr/lib64/clang/14.0.5/lib/wasi/
# $ sudo cp download/libclang_rt.builtins-wasm32.a /usr/lib64/clang/14.0.5/lib/wasi/
build: download $(WASMS)

$(WASMS): | $(OBJDIRS)
Expand Down

0 comments on commit cc9d08d

Please sign in to comment.