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.4/demos/tools/Dollyfile-tools-build 81e1c1bc8b06c83b1daead6c8f09bc8b1382e8fe165f896a98109396b58bb3051112REQUIRES HEADER libc13REQUIRES HEADER cpp14REQUIRES LIB    c++15REQUIRES LIB    c++abi16REQUIRES TOOL   c++17REQUIRES TOOL   cc18REQUIRES TOOL   cmake19REQUIRES TOOL   cp20REQUIRES TOOL   grep21REQUIRES TOOL   make22REQUIRES TOOL   tar2324SOURCE /v0.1.4/dist/static/tools/binaryen.tar ce5873bc7df45ebf45b5b3230c79c359d34c7269cac9a6c3395641329f7fa98d /tmp/binaryen.tar25SLOP tar -xf /tmp/binaryen.tar -C /26SLOP cmake -S /tmp/binaryen -B /tmp/binaryen/build \27  -DCMAKE_SYSTEM_NAME=Dolly -DCMAKE_SYSTEM_PROCESSOR=wasm64 -DCMAKE_BUILD_TYPE=Release \28  -DBUILD_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DENABLE_WERROR=OFF -DBYN_ENABLE_LTO=OFF \29  -DBUILD_EMSCRIPTEN_TOOLS_ONLY=ON -DINSTALL_LIBS=OFF30SLOP cmake --build /tmp/binaryen/build -j4 --target wasm-opt31SLOP cp /tmp/binaryen/build/bin/wasm-opt /usr/bin/wasm-opt32EXPORTS ENV BINARYEN_CORES 13334# A call through a pointer cast to a type of more parameters traps in35# WebAssembly; the same program passed through the pass makes it.36FILE /tmp/binaryen/cast.c37    #include <stdio.h>38    static int one(int value) { return value + 1; }39    int main(void) {40      int (*two)(int, int) = (int (*)(int, int))one;41      return two(41, 0) == 42 && puts("CAST-EMULATED") >= 0 ? 0 : 1;42    }43SLOP cc -O0 /tmp/binaryen/cast.c -o /tmp/binaryen/cast && ! /tmp/binaryen/cast 2> /dev/null44SLOP wasm-opt --fpcast-emu /tmp/binaryen/cast -o /tmp/binaryen/emulated && /tmp/binaryen/emulated | grep -qx CAST-EMULATED4546EXPORTS TOOL wasm-opt47FILE /usr/share/licenses/binaryen/LICENSE48FILE /usr/share/licenses/binaryen/FP16-LICENSE49FILE /usr/share/man/cat1/wasm-opt.150    wasm-opt: Binaryen's optimizer of WebAssembly modules, built inside Dolly51    from upstream's release. Dolly's programs are such modules.52    53      wasm-opt --fpcast-emu IN -o OUT   calls through casts to other types work54      wasm-opt -O2 IN -o OUT            optimizes55      wasm-opt --help                   every pass and option56    57    It runs on one thread (BINARYEN_CORES=1).58    Upstream's documentation: https://github.com/WebAssembly/binaryen59