Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Switch to upstream wasi-sdk (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored Apr 28, 2023
1 parent 436d446 commit e828d17
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions buildtools/bdwgc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Copyright The OWASP Coraza contributors
# SPDX-License-Identifier: Apache-2.0
# Copyright wasilibs authors
# SPDX-License-Identifier: MIT

FROM ghcr.io/corazawaf/coraza-proxy-wasm/buildtools-wasi-sdk:main
FROM ghcr.io/webassembly/wasi-sdk:wasi-sdk-20

RUN apt-get install -y autogen autoconf automake libtool
RUN apt-get -y update && apt-get -y install curl

RUN mkdir -p /bdwgc && curl -L https://github.com/ivmai/bdwgc/archive/0a1667bee7f2c004abda6ecd173cd80bfef8412c.tar.gz | tar -xz --strip-components 1 -C /bdwgc
WORKDIR /bdwgc
RUN ./autogen.sh

# While signals aren't actually used the header file is included unconditionally. We can enable the header file
# without linking the actual signals library because the functions aren't called.
ENV CFLAGS -D_WASI_EMULATED_SIGNAL ${CFLAGS}
ENV CFLAGS -O3 -D_WASI_EMULATED_SIGNAL ${CFLAGS}

# host is required by configure but not used so set it arbitrarily
RUN ./configure --disable-threads --disable-shared --disable-gcj-support --disable-java-finalization --disable-atomic-uncollectible --host=i686-pc-linux-gnu
RUN make

CMD ["sh", "-c", "cp /bdwgc/.libs/libgc.a /usr/lib/llvm-15/lib/clang/15.*/lib/wasi/libclang_rt.builtins-wasm32.a /out/"]
CMD ["sh", "-c", "cp /bdwgc/.libs/libgc.a /usr/lib/llvm-${LLVM_VERSION}/lib/clang/${LLVM_VERSION}/lib/wasi/libclang_rt.builtins-wasm32.a /out/"]
10 changes: 5 additions & 5 deletions buildtools/mimalloc/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright The OWASP Coraza contributors
# SPDX-License-Identifier: Apache-2.0
# Copyright wasilibs authors
# SPDX-License-Identifier: MIT

FROM ghcr.io/corazawaf/coraza-proxy-wasm/buildtools-wasi-sdk:main
FROM ghcr.io/webassembly/wasi-sdk:wasi-sdk-20

RUN apt-get install -y cmake
RUN apt-get -y update && apt-get -y install curl

# Enables export of aligned_alloc
# TODO(anuraaga): It seems like this should be set automatically, consider debugging further.
ENV CFLAGS -D__USE_ISOC11 ${CFLAGS}
ENV CFLAGS -O3 -D__USE_ISOC11 ${CFLAGS}

RUN mkdir -p /mimalloc && curl -L https://github.com/microsoft/mimalloc/archive/d1fff1119a52e15c1c3807efe1077024c39fe70e.tar.gz | tar -xz --strip-components 1 -C /mimalloc
WORKDIR /mimalloc
Expand Down
Binary file modified wasm/libclang_rt.builtins-wasm32.a
Binary file not shown.
Binary file modified wasm/libgc.a
Binary file not shown.
Binary file modified wasm/libmimalloc.a
Binary file not shown.

0 comments on commit e828d17

Please sign in to comment.