From c1216736d5221c78ffa8c3481d741147e23a8752 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 21 Jun 2023 23:18:48 -0400 Subject: [PATCH] web-wasi: bump to wasi-sdk 20 --- web-wasi/Dockerfile.in | 24 ++++++++++-------------- web-wasi/Toolchain.cmake | 5 +++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/web-wasi/Dockerfile.in b/web-wasi/Dockerfile.in index 8f06626..7e247c4 100644 --- a/web-wasi/Dockerfile.in +++ b/web-wasi/Dockerfile.in @@ -3,16 +3,7 @@ FROM ${ORG}/base:latest LABEL maintainer="Matt McCormick matt.mccormick@kitware.com" -ENV WASI_VERSION 19 -ENV WASI_VERSION_FULL ${WASI_VERSION}.0 -RUN cd /usr/ && \ - curl -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \ - tar xvzf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \ - rm wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz -ENV WASI_SYSROOT /usr/wasi-sdk-${WASI_VERSION_FULL}/share/wasi-sysroot -ENV WASI_SDK_PATH /usr/wasi-sdk-${WASI_VERSION_FULL} - -ENV LLVM_VERSION 15 +ENV LLVM_VERSION 16 # Build LLVM / Clang that supports our glibc RUN apt-get update && \ @@ -27,14 +18,19 @@ RUN apt-get update && \ apt-get install -y clang-${LLVM_VERSION} lld-${LLVM_VERSION} && \ rm -rf /var/lib/apt/lists/* -# The path to the rt directory contains the LLVM patch version which is not reflected in the LLVM apt repository -# or package. To make adding the RT robust to changing patch versions without needing to duplicate the folder -# content, we copy after extracting using a bash glob to resolve the patch version +ENV WASI_VERSION 20 +ENV WASI_VERSION_FULL ${WASI_VERSION}.0 +RUN cd /usr/ && \ + curl -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \ + tar xvzf wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz && \ + rm wasi-sdk-${WASI_VERSION_FULL}-linux.tar.gz RUN cd /usr/ && \ curl -L -O https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/libclang_rt.builtins-wasm32-wasi-${WASI_VERSION_FULL}.tar.gz && \ tar xvzf libclang_rt.builtins-wasm32-wasi-${WASI_VERSION_FULL}.tar.gz && \ rm libclang_rt.builtins-wasm32-wasi-${WASI_VERSION_FULL}.tar.gz && \ - ln -s /usr/lib/wasi/ $(echo /usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}.*)/lib/wasi + cp -r lib/wasi /usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}/lib/ +ENV WASI_SYSROOT /usr/wasi-sdk-${WASI_VERSION_FULL}/share/wasi-sysroot +ENV WASI_SDK_PATH /usr/wasi-sdk-${WASI_VERSION_FULL} COPY clang-wasi-sysroot.sh clang++-wasi-sysroot.sh /usr/local/bin/ diff --git a/web-wasi/Toolchain.cmake b/web-wasi/Toolchain.cmake index 9b6d845..4aa9fd8 100644 --- a/web-wasi/Toolchain.cmake +++ b/web-wasi/Toolchain.cmake @@ -8,5 +8,10 @@ set(CMAKE_C_COMPILER /usr/local/bin/clang-wasi-sysroot.sh) set(CMAKE_CXX_COMPILER /usr/local/bin/clang++-wasi-sysroot.sh) set(CMAKE_AR llvm-ar-$ENV{LLVM_VERSION}) set(CMAKE_RANLIB llvm-ranlib-$ENV{LLVM_VERSION}) +set(CMAKE_ASM_COMPILER clang-$ENV{LLVM_VERSION}) + +set(CMAKE_C_COMPILER_TARGET $ENV{CROSS_TRIPLE}) +set(CMAKE_CXX_COMPILER_TARGET $ENV{CROSS_TRIPLE}) +set(CMAKE_ASM_COMPILER_TARGET $ENV{CROSS_TRIPLE}) set(CMAKE_CROSSCOMPILING_EMULATOR /wasi-runtimes/wasmtime/bin/wasmtime-pwd.sh)