From cc9d08dad2fd382b44f4b8e81cb6986adbc79044 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 14 Nov 2024 17:16:47 -0800 Subject: [PATCH] test: update location of builtins library `wasi-sdk` now packages the Clang builtins in a different directory than it used to. --- .github/workflows/main.yml | 6 +++--- test/Makefile | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index afdff5f0..b7e5c910 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/test/Makefile b/test/Makefile index 39074a67..bcbdce1e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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 @@ -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) @@ -61,7 +62,7 @@ $(ADAPTER): | $(DOWNDIR) wget --no-clobber --directory-prefix=$(DOWNDIR) $(ADAPTER_URL) clean:: - rm -rf download + rm -rf $(DOWNDIR) ##### BUILD #################################################################### @@ -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)