holzschu / holzschu/a-shell

Building wasi-sdk on Linux

Open
#800 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
3.9k
Forks
213
Avg merge
1m
Merged PRs (30d)
1

Description

> If you are on OSX, I now provide a ready-so-use SDK here: https://github.com/holzschu/wasi-sdk/releases/download/wasi-sdk-aShell-19/wasi-sdk.tar.gz
> It contains the binaries (clang, ar, wasm-ld...) and the sysroot, with a bunch of auxiliary libraries.
> _Originally posted by @holzschu in https://github.com/holzschu/a-shell/issues/666#issuecomment-2238807045_

I've been trying to get the `wasi-sdk` to build and work on Linux, simply because that way I can do automated builds and use my existing sandboxes. However, I can't really figure out the right steps to get it to build _and_ support `setjmp`.

So far, I have this `Dockerfile`:

```docker file
FROM debian:bookworm

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
build-essential \
clang \
python3 \
git \
ninja-build \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sSLO https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1-linux-x86_64.tar.gz \
&& tar xf cmake-3.20.1-linux-x86_64.tar.gz \
&& rm cmake-3.20.1-linux-x86_64.tar.gz \
&& mkdir -p /opt \
&& mv cmake-3.20.1-linux-x86_64 /opt/cmake
ENV PATH=/opt/cmake/bin:$PATH

RUN mkdir /build \
&& cd /build \
&& git clone --recurse-submodules https://github.com/holzschu/wasi-sdk.git \
&& cd wasi-sdk \
&& git fetch --all --tags \
&& git checkout tags/wasi-sdk-aShell-19

ENV PREFIX=/opt/
RUN cd /build/wasi-sdk \
&& sed '296,316{s/^/#/}' src/llvm-project/clang/CMakeLists.txt > /tmp/clean \
&& mv /tmp/clean src/llvm-project/clang/CMakeLists.txt \
&& make
```

This builds and seems to work, but lacks a lot of the extra libraries and headers in the OSX tarball above.

What else do I need to do? I'd like to have a reproducible SDK build...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.