diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b39e65..b8a56b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -157,6 +157,7 @@ jobs: build-only-sysroot: name: Build only sysroot - ${{ matrix.name }} runs-on: ubuntu-24.04 + needs: build # Add dependency strategy: matrix: include: @@ -170,10 +171,16 @@ jobs: - uses: ./.github/actions/checkout - uses: ./.github/actions/install-deps - run: cargo install wasm-component-ld@0.5.21 - - run: sudo apt-get update -y && sudo apt-get install -y clang-20 lld-20 + - uses: actions/download-artifact@v4 + with: + name: dist-x86_64-linux + path: dist-x86_64-linux + - run: ./ci/merge-artifacts.sh + - run: tar xf dist/wasi-sdk-*.tar.gz - run: | + WASI_SDK_DIR=$(ls -d ./wasi-sdk-* | head -1) cmake -G Ninja -B build -S . \ - -DCMAKE_C_COMPILER=/usr/lib/llvm-20/bin/clang \ + -DCMAKE_C_COMPILER=$WASI_SDK_DIR/bin/clang \ -DCMAKE_SYSTEM_NAME=WASI \ -DWASI_SDK_INCLUDE_TESTS=ON \ -DWASI_SDK_CPU_CFLAGS="" \ diff --git a/cmake/wasi-sdk-sysroot.cmake b/cmake/wasi-sdk-sysroot.cmake index a55e4f3..5476980 100644 --- a/cmake/wasi-sdk-sysroot.cmake +++ b/cmake/wasi-sdk-sysroot.cmake @@ -133,8 +133,12 @@ function(define_wasi_libc_sub target target_suffix lto) get_property(directory_cflags DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS) set(extra_cflags_list "${WASI_SDK_CPU_CFLAGS} ${CMAKE_C_FLAGS} ${directory_cflags}") - if(${target} MATCHES p2 OR ${target} MATCHES p3) - # Always enable `-fPIC` for the `wasm32-wasip2` and `wasm32-wasip3` targets. This makes `libc.a` + if(${target} MATCHES p3) + list(APPEND extra_cmake_args -DBUILD_SHARED=OFF) + endif() + + if(${target} MATCHES p2) + # Always enable `-fPIC` for the `wasm32-wasip2` targets. This makes `libc.a` # more flexible and usable in dynamic linking situations. list(APPEND extra_cflags_list -fPIC) endif() @@ -205,7 +209,7 @@ execute_process( OUTPUT_STRIP_TRAILING_WHITESPACE) function(define_libcxx_sub target target_suffix extra_target_flags extra_libdir_suffix) - if(${target} MATCHES threads) + if(${target} MATCHES threads OR ${target} MATCHES p3) set(pic OFF) set(target_flags -pthread) else() diff --git a/src/llvm-project b/src/llvm-project index 36ea1df..c8d5420 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 36ea1dfb7e24cdbcc4d8fb5bacd1d22dd0f470c3 +Subproject commit c8d54204f931757599092965975da00eb218a9fd diff --git a/src/wasi-libc b/src/wasi-libc index 5b95b09..36d2c17 160000 --- a/src/wasi-libc +++ b/src/wasi-libc @@ -1 +1 @@ -Subproject commit 5b95b096c157ad5a201150f146bc1d1ea2817650 +Subproject commit 36d2c170d7d71daf2cae71727d446a1fc5211b18 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a007f81..852983b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -83,7 +83,7 @@ function(add_testcase runwasi test) endif() # Apply target-specific options. - if(target MATCHES threads) + if(target MATCHES threads OR target MATCHES p3) target_compile_options(${target_name} PRIVATE -pthread) target_link_options(${target_name} PRIVATE -pthread) endif() @@ -102,7 +102,7 @@ function(add_testcase runwasi test) if(WASI_SDK_EXCEPTIONS) set(runner "${runner} -Wexceptions") endif() - if(target MATCHES "wasip3") + if(target MATCHES p3) set(runner "${runner} -Wcomponent-model-async -Wcomponent-model-threading -Sp3") endif() endif() diff --git a/tests/general/abort.c.stderr.expected b/tests/general/abort.c.stderr.expected index d533e58..4d3b46b 100644 --- a/tests/general/abort.c.stderr.expected +++ b/tests/general/abort.c.stderr.expected @@ -1,7 +1,7 @@ Error: failed to run main module `abort.c.---.wasm` Caused by: - 0: failed to invoke --- - 1: error while executing at wasm backtrace: - note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information - 2: wasm trap: wasm `unreachable` instruction executed + 0: error while executing at wasm backtrace: +note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information + 1: wasm trap: wasm `unreachable` instruction executed + diff --git a/tests/general/assert-fail.c.stderr.expected b/tests/general/assert-fail.c.stderr.expected index fcf1f75..09450ad 100644 --- a/tests/general/assert-fail.c.stderr.expected +++ b/tests/general/assert-fail.c.stderr.expected @@ -2,7 +2,7 @@ Assertion failed: false (assert-fail.c: main: 9) Error: failed to run main module `assert-fail.c.---.wasm` Caused by: - 0: failed to invoke --- - 1: error while executing at wasm backtrace: - note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information - 2: wasm trap: wasm `unreachable` instruction executed + 0: error while executing at wasm backtrace: +note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable may show more debugging information + 1: wasm trap: wasm `unreachable` instruction executed + diff --git a/tests/general/sigabrt.c.stderr.expected b/tests/general/sigabrt.c.stderr.expected index d702a88..1d35d16 100644 --- a/tests/general/sigabrt.c.stderr.expected +++ b/tests/general/sigabrt.c.stderr.expected @@ -3,4 +3,4 @@ Program received fatal signal: Aborted Error: failed to run main module `sigabrt.c.---.wasm` Caused by: - 0: failed to invoke --- + 0: error while executing at wasm backtrace: