Strip via wasm-opt

This commit is contained in:
Surma
2021-05-04 19:05:33 +01:00
parent aa0ba8509e
commit 416e865adf
3 changed files with 5 additions and 5 deletions

View File

@@ -30,8 +30,7 @@ $(OUT_WASM): $(CODEC_OUT)
-o $@ \
enc/mozjpeg_enc.cpp \
$(CODEC_OUT)
$(BINARYEN_PREFIX)/bin/wasm-opt -O4 -o $(OUT_WASM) $(OUT_WASM)
$(WABT_PREFIX)/bin/wasm-strip $(OUT_WASM)
$(BINARYEN_PREFIX)/bin/wasm-opt --strip-debug --strip-dwarf --strip-producers --strip-target-features -O4 -o $(OUT_WASM) $(OUT_WASM)
# This one is a bit special: there is no rule for .libs/libjpeg.a
# so we use libjpeg.la which implicitly builds that one instead.

Binary file not shown.

View File

@@ -7,8 +7,9 @@ RUN mkdir -p ${WASI_SDK_PREFIX} && \
ENV BINARYEN_PREFIX "/opt/binaryen"
RUN mkdir -p ${BINARYEN_PREFIX} && \
curl -L https://github.com/WebAssembly/binaryen/releases/download/version_101/binaryen-version_101-x86_64-linux.tar.gz | tar -xz --strip 1 -C ${BINARYEN_PREFIX}
ENV WABT_PREFIX "/opt/wabt"
RUN mkdir -p ${WABT_PREFIX} && \
curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz | tar -xz --strip 1 -C ${WABT_PREFIX}
# Maybe we need it later. Leaving it here for now.
# ENV WABT_PREFIX "/opt/wabt"
# RUN mkdir -p ${WABT_PREFIX} && \
# curl -L https://github.com/WebAssembly/wabt/releases/download/1.0.23/wabt-1.0.23-ubuntu.tar.gz | tar -xz --strip 1 -C ${WABT_PREFIX}
WORKDIR /src
CMD ["sh", "-c", "make -j`nproc`"]