Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update Binaryen to 1.38.24 #275

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

[WIP] Update Binaryen to 1.38.24 #275

wants to merge 16 commits into from

Conversation

axic
Copy link
Member

@axic axic commented Jul 30, 2018

Depends on ethereum/aleth#5343.

@axic axic requested a review from chfast July 30, 2018 12:12
@axic
Copy link
Member Author

axic commented Jul 30, 2018

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
Copy link
Collaborator

chfast commented Jul 30, 2018

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

@chfast
Copy link
Collaborator

chfast commented Jul 30, 2018

Why do you update it anyway?

@axic
Copy link
Member Author

axic commented Jul 30, 2018

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
Copy link
Member Author

axic commented Aug 10, 2018

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
Copy link
Collaborator

chfast commented Aug 10, 2018

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

@axic
Copy link
Member Author

axic commented Aug 10, 2018

Rebased on top the toolchain file, but still failing.

@chfast
Copy link
Collaborator

chfast commented Aug 13, 2018

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
Copy link
Member Author

axic commented Aug 27, 2018

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
Copy link
Collaborator

chfast commented Sep 7, 2018

Maybe wait for: WebAssembly/binaryen#1672.

@axic axic added this to In progress in 0.2.0 via automation Sep 17, 2018
@axic axic added this to In progress in 0.2.1 via automation Nov 6, 2018
@axic axic removed this from In progress in 0.2.0 Nov 6, 2018
@axic axic removed this from In progress in 0.2.1 Dec 4, 2018
@axic axic added this to In progress in 0.2.2 via automation Dec 4, 2018
@axic
Copy link
Member Author

axic commented Apr 12, 2019

Binaryen is at 1.38.30, should try it.

@axic
Copy link
Member Author

axic commented Apr 12, 2019

Need to also rebase.

@axic axic added this to In progress in 0.2.4 via automation Apr 26, 2019
@axic axic removed this from Needs review in 0.2.3 Apr 26, 2019
@axic axic changed the title Update Binaryen to 1.38.24 [WIP] Update Binaryen to 1.38.24 Apr 30, 2019
@axic axic added this to In progress in 0.2.5 via automation May 22, 2019
@axic axic removed this from In progress in 0.2.4 May 22, 2019
@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
No open projects
0.2.5
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

3 participants