hera
hera copied to clipboard
[WIP] Update Binaryen to 1.38.24
Depends on https://github.com/ethereum/aleth/pull/5343.
Bummer, this needs python in the build env:
[10/106] Generating WasmIntrinsics.cpp
FAILED: src/passes/WasmIntrinsics.cpp
cd /home/builder/build/deps/src/binaryen-build/src/passes && python /home/builder/build/deps/src/binaryen/scripts/embedwast.py /home/builder/build/deps/src/binaryen/src/passes/wasm-intrinsics.wast /home/builder/build/deps/src/binaryen-build/src/passes/WasmIntrinsics.cpp
/bin/sh: 1: python: not found
The cpp-build-env has Python 3 installed. Try symlinking it to python.
Why do you update it anyway?
Our immediate benefit is the arguments to callExport are const so we can simplify that code, however two actual reasons:
- wanted to pull in fixes from the last 3 months
- wanted to use the same version of evm2wasm and hera
After supplying python, this still has some weird build issue:
100%] Linking CXX executable bin/wasm-emscripten-finalize
CMakeFiles/wasm-emscripten-finalize.dir/src/tools/wasm-emscripten-finalize.cpp.o: In function `main':
wasm-emscripten-finalize.cpp:(.text+0x111b): undefined reference to `wasm::ModuleReader::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, wasm::Module&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/wasm-emscripten-finalize.dir/build.make:100: recipe for target 'bin/wasm-emscripten-finalize' failed
make[5]: *** [bin/wasm-emscripten-finalize] Error 1
binaryen is probably not built with C++11 and std::string ABI does not match. Using toolchain file as in #293 might help.
Rebased on top the toolchain file, but still failing.
Maybe it conflicts with the binaryen in Aleth.
This builds statically and shared, except shared with coverage for some reason:
[23/23] Linking CXX shared library src/libhera.so
FAILED: src/libhera.so
: && /usr/bin/g++ -fPIC -g --coverage -Wl,--no-undefined -shared -Wl,-soname,libhera.so -o src/libhera.so src/CMakeFiles/hera.dir/binaryen.cpp.o src/CMakeFiles/hera.dir/eei.cpp.o src/CMakeFiles/hera.dir/hera.cpp.o hera/libbuildinfo.a evmc/lib/instructions/libevmc-instructions.a evm2wasm/libs/evm2wasm/libevm2wasm.a deps/lib/libbinaryen.a deps/src/binaryen-build/lib/libwasm.a deps/src/binaryen-build/lib/libasmjs.a deps/src/binaryen-build/lib/libpasses.a deps/src/binaryen-build/lib/libcfg.a deps/src/binaryen-build/lib/libir.a deps/src/binaryen-build/lib/libemscripten-optimizer.a deps/src/binaryen-build/lib/libsupport.a -lpthread /home/builder/.hunter/_Base/5ead1e0/0fe0970/ead1bc1/Install/lib/libfmt.a && :
src/CMakeFiles/hera.dir/hera.cpp.o: In function `(anonymous namespace)::mktemp_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
/home/builder/project/src/hera.cpp:155: warning: the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
deps/src/binaryen-build/lib/libpasses.a(pass.cpp.o): In function `wasm::dumpWast(wasm::Name, wasm::Module*)':
pass.cpp:(.text+0x9f1): undefined reference to `wasm::ModuleWriter::write(wasm::Module&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
deps/src/binaryen-build/lib/libpasses.a(FuncCastEmulation.cpp.o): In function `wasm::FuncCastEmulation::run(wasm::PassRunner*, wasm::Module*)':
FuncCastEmulation.cpp:(.text._ZN4wasm17FuncCastEmulation3runEPNS_10PassRunnerEPNS_6ModuleE[_ZN4wasm17FuncCastEmulation3runEPNS_10PassRunnerEPNS_6ModuleE]+0x16e): undefined reference to `wasm::EmscriptenGlueGenerator::generateDynCallThunks()'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Exited with code 1
Maybe wait for: https://github.com/WebAssembly/binaryen/pull/1672.
This produces a crash on macos:
Executing message in Hera
Received 'segmentation fault' signal
Codecov Report
Merging #275 into master will decrease coverage by
1.56%. The diff coverage is38.09%.
@@ Coverage Diff @@
## master #275 +/- ##
==========================================
- Coverage 71.04% 69.47% -1.57%
==========================================
Files 9 7 -2
Lines 1554 973 -581
Branches 137 129 -8
==========================================
- Hits 1104 676 -428
+ Misses 422 270 -152
+ Partials 28 27 -1
Git history cleaned up.
I think Binaryen: Skip redundant wasm:: namespace should be squashed into Simplify callExport() since the arguments parameter is const now as its commit log doesn't make sense anymore.
@axic it crashes on macos so you have to check it yourself.
Assertion failed: (*currp), function pushTask, file /Users/distiller/build/deps/src/binaryen/src/wasm-traversal.h, line 372.
unknown location:0: fatal error: in "GeneralStateTests/stEWASMTests": signal: SIGABRT (application abort requested)
/Users/distiller/project/test/tools/libtesteth/TestHelper.cpp:614: last checkpoint
This is for a line if (curr->imported()) { so it must be for EEI. How didn't this fail yesterday?
How didn't this fail yesterday?
It did.
There's a new release 1.38.28, maybe that will work on mac.
I will check. There is one promising changelog entry: https://github.com/WebAssembly/binaryen/releases/tag/1.38.25.
Binaryen is at 1.38.30, should try it.
Need to also rebase.