Skip to content

[WIP] Update Binaryen to 1.38.24#275

Draft
axic wants to merge 16 commits into
masterfrom
binaryen-update
Draft

[WIP] Update Binaryen to 1.38.24#275
axic wants to merge 16 commits into
masterfrom
binaryen-update

Conversation

@axic

@axic axic commented Jul 30, 2018

Copy link
Copy Markdown
Member

Depends on ethereum/aleth#5343.

@axic
axic requested a review from chfast July 30, 2018 12:12
@axic

axic commented Jul 30, 2018

Copy link
Copy Markdown
Member Author

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

@chfast

chfast commented Jul 30, 2018

Copy link
Copy Markdown
Collaborator

The cpp-build-env has Python 3 installed. Try symlinking it to python.

@chfast

chfast commented Jul 30, 2018

Copy link
Copy Markdown
Collaborator

Why do you update it anyway?

@axic

axic commented Jul 30, 2018

Copy link
Copy Markdown
Member Author

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

@axic
axic force-pushed the binaryen-update branch 2 times, most recently from ce926d7 to fcfc446 Compare July 31, 2018 21:45
@axic
axic force-pushed the binaryen-update branch from fcfc446 to e839daf Compare August 9, 2018 18:21
@axic

axic commented Aug 10, 2018

Copy link
Copy Markdown
Member Author

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

@chfast

chfast commented Aug 10, 2018

Copy link
Copy Markdown
Collaborator

binaryen is probably not built with C++11 and std::string ABI does not match. Using toolchain file as in #293 might help.

@axic
axic force-pushed the binaryen-update branch from 1d19d57 to 19061f6 Compare August 10, 2018 11:07
@axic

axic commented Aug 10, 2018

Copy link
Copy Markdown
Member Author

Rebased on top the toolchain file, but still failing.

@axic
axic force-pushed the binaryen-update branch from 19061f6 to 866eb40 Compare August 10, 2018 21:24
@chfast

chfast commented Aug 13, 2018

Copy link
Copy Markdown
Collaborator

Maybe it conflicts with the binaryen in Aleth.

@axic
axic force-pushed the binaryen-update branch 2 times, most recently from 2559347 to 635003f Compare August 21, 2018 17:16
@axic
axic force-pushed the binaryen-update branch from 635003f to 644c06b Compare August 26, 2018 21:21
@axic

axic commented Aug 27, 2018

Copy link
Copy Markdown
Member Author

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

@chfast

chfast commented Sep 7, 2018

Copy link
Copy Markdown
Collaborator

Maybe wait for: WebAssembly/binaryen#1672.

@axic

axic commented Dec 13, 2018

Copy link
Copy Markdown
Member Author

This produces a crash on macos:

Executing message in Hera
Received 'segmentation fault' signal

@chfast chfast changed the title Update to binaryen 1.38.9 Update Binaryen Jan 11, 2019
@codecov-io

codecov-io commented Jan 21, 2019

Copy link
Copy Markdown

Codecov Report

Merging #275 into master will decrease coverage by 1.56%.
The diff coverage is 38.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

@axic

axic commented Feb 25, 2019

Copy link
Copy Markdown
Member Author

There's a new release 1.38.28, maybe that will work on mac.

@chfast

chfast commented Feb 25, 2019

Copy link
Copy Markdown
Collaborator

I will check. There is one promising changelog entry: https://github.com/WebAssembly/binaryen/releases/tag/1.38.25.

@axic

axic commented Apr 12, 2019

Copy link
Copy Markdown
Member Author

Binaryen is at 1.38.30, should try it.

@axic

axic commented Apr 12, 2019

Copy link
Copy Markdown
Member Author

Need to also rebase.

@axic
axic force-pushed the binaryen-update branch 2 times, most recently from 2a92063 to 838e770 Compare April 30, 2019 07:55
@axic axic changed the title Update Binaryen to 1.38.24 [WIP] Update Binaryen to 1.38.24 Apr 30, 2019
@axic
axic force-pushed the binaryen-update branch from 838e770 to 3d7d704 Compare May 22, 2019 23:31
@axic
axic marked this pull request as draft June 9, 2020 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants