-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CMake: Add option to build with WAVM #266
Conversation
I think I should test the build with WAVM on any CI servers. |
I think there is an existing option in the abstraction layer PR called |
src/CMakeLists.txt
Outdated
|
||
if(HERA_WAVM) | ||
target_compile_definitions(hera PRIVATE HERA_WAVM=1) | ||
target_link_libraries(hera PRIVATE wavm::runtime) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to the Runtime
lib (and the dependencies pulled in implicitly) we also need the WASM
library to convert the bytecode into WAVM's internal IR.
Ready to merge? |
If the WAVM include root is added to Hera's include search list then yeah, I think it is ready. |
Added a sample code to pull in all the required bits for loading & running (in dc50760) and it seems to compile. |
My bad, used the wrong ifdef, however now it does complain:
Resolution: manually added |
@chfast So it seems the sample code compiles and links, but there is some kind of runtime linking error:
which resolves to |
Lastly it fails to build if not built as shared library. |
This seems to be working on dynamic loading now (tests fail because the code will throw intentionally). Static linking however doesn't work because the flag |
It should build with GCC 8 now. |
The new sed doesn't work on mac:
|
It still fails on mac:
|
Moving them back to |
sed is still failing now? |
Yes, changing your last commit to |
But I removed regex from sed. |
|
On Mac, though
|
I will replace it with CMake script not to have problems with it on Windows. |
I think I will merge this broken |
This adds -DHERA_WAVM option what for now will build WAVM and link hera with it. Because Hera does not uses WAVM it will not do anything useful, but we can check if the build works. Also the `HERA_WAVM=1` macro is predefined for build with WAVM. This depends on LLVM 6.0 so you have to install libllvm-6.0-dev. See http://apt.llvm.org.
This adds -DHERA_WAVM option what for now will build WAVM and link hera with it. Because Hera does not uses WAVM it will not do anything useful, but we can check if the build works.
Also the
HERA_WAVM=1
macro is predefined for build with WAVM.This depends on LLVM 6.0 so you have to install libllvm-6.0-dev. See http://apt.llvm.org.
The WAVM produces a number of libraries. In this PR only the libruntime is used, probably more is going to be needed when we start using WAVM.
Part of #158.