1DOLLY 72PACKAGE binaryen3REQUIRES HOST runtime@045# Binaryen's wasm-opt from upstream's release, unchanged, configured by its6# own CMake. Dolly uses one pass of it, --fpcast-emu: every indirect call of7# the program goes through one signature, so a call through a pointer cast to8# a function type of other parameters works (GObject programs make them). It9# runs on one thread, as BINARYEN_CORES says: the package is not threaded.10FROM /v0.1.5/demos/tools/Dollyfile-tools-build 9f9cfa93f7bc4ddd5fc5cbd9ced4d2100cd41349f9f2b6f75ab9d8e26a57da621112REQUIRES HEADER libc13REQUIRES HEADER cpp14REQUIRES LIB    c++15REQUIRES LIB    c++abi16REQUIRES TOOL   c++17REQUIRES TOOL   cc18REQUIRES TOOL   cmake19REQUIRES TOOL   cp20REQUIRES TOOL   grep21REQUIRES TOOL   gzip22REQUIRES TOOL   make23REQUIRES TOOL   mkdir24REQUIRES TOOL   mv25REQUIRES TOOL   tar2627SOURCE /v0.1.5/dist/static/tools/binaryen-version_133.tar.gz 2f3e3d9edc56751499571da073a8a81943ca3fcbc08a945d2c619a7a1d4eb88b /tmp/binaryen.tar.gz28SLOP gzip -dc /tmp/binaryen.tar.gz | tar -xf - -C /tmp && mv /tmp/binaryen-version_133 /tmp/binaryen29SLOP cmake -S /tmp/binaryen -B /tmp/binaryen/build \30  -DCMAKE_SYSTEM_NAME=Dolly -DCMAKE_SYSTEM_PROCESSOR=wasm64 -DCMAKE_BUILD_TYPE=Release \31  -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_WERROR=OFF -DBYN_ENABLE_LTO=OFF \32  -DBUILD_EMSCRIPTEN_TOOLS_ONLY=ON -DINSTALL_LIBS=OFF33SLOP cmake --build /tmp/binaryen/build -j4 --target wasm-opt34SLOP cp /tmp/binaryen/build/bin/wasm-opt /usr/bin/wasm-opt35SLOP mkdir -p /usr/share/licenses/binaryen && cp /tmp/binaryen/LICENSE /usr/share/licenses/binaryen/LICENSE && cp /tmp/binaryen/third_party/FP16/LICENSE /usr/share/licenses/binaryen/FP16-LICENSE36EXPORTS ENV BINARYEN_CORES 13738# A call through a pointer cast to a type of more parameters traps in39# WebAssembly; the same program passed through the pass makes it.40FILE /tmp/binaryen/cast.c41    #include <stdio.h>42    static int one(int value) { return value + 1; }43    int main(void) {44      int (*two)(int, int) = (int (*)(int, int))one;45      return two(41, 0) == 42 && puts("CAST-EMULATED") >= 0 ? 0 : 1;46    }47SLOP cc -O0 /tmp/binaryen/cast.c -o /tmp/binaryen/cast && ! /tmp/binaryen/cast 2> /dev/null48SLOP wasm-opt --fpcast-emu /tmp/binaryen/cast -o /tmp/binaryen/emulated && /tmp/binaryen/emulated | grep -qx CAST-EMULATED4950EXPORTS TOOL wasm-opt51FILE /usr/share/licenses/binaryen/LICENSE52FILE /usr/share/licenses/binaryen/FP16-LICENSE53FILE /usr/share/man/cat1/wasm-opt.154    wasm-opt: Binaryen's optimizer of WebAssembly modules, built inside Dolly55    from upstream's release. Dolly's programs are such modules.56    57      wasm-opt --fpcast-emu IN -o OUT   calls through casts to other types work58      wasm-opt -O2 IN -o OUT            optimizes59      wasm-opt --help                   every pass and option60    61    It runs on one thread (BINARYEN_CORES=1).62    Upstream's documentation: https://github.com/WebAssembly/binaryen63