Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

update WAVM to be compatible with LLVM 7 through 9 #7774

Merged
merged 17 commits into from
Sep 9, 2019

Conversation

spoonincode
Copy link
Contributor

@spoonincode spoonincode commented Aug 19, 2019

Change Description

WAVM as used in EOSIO requires LLVM 4.0 -- nothing higher nor lower. This requirement is starting to become a little cumbersome: most distros don't provide an llvm4 package (Ubuntu's last was in 18.10) and building llvm4 from source with recent gcc versions requires patching llvm's source code. Plus, requiring LLVM 4 will conflict with potential new wasm runtimes.

This PR updates WAVM to use LLVM APIs compatible from version 7 to 9.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

Documentation Additions

  • Documentation Additions

this is standard operating procedure on macos
LLVM 7.0 & 7.0.1 suffer from an ABI incompatibility between GCC & Clang. If LLVM is built with GCC (as is the case for system-provided LLVMs in RHEL, Ubuntu, etc) using LLVM with a GCC compiled binary will result in a runtime fault. For more information see LLVM bug 39427

This workaround detects when Clang is being used to compile EOSIO with LLVM < 7.1 and compiles a “shim” with g++ to call the troublesome function that suffers from the ABI incompatibility. This workaround is operating under the assumption that LLVM 7.0 or 7.0.1 was compiled with g++ which it will be for any of EOSIO’s supported distros.
at the moment just build llvm8 from source, pending scl getting llvm-toolset-7.0 still
@spoonincode spoonincode marked this pull request as ready for review September 3, 2019 18:47
@blockone-devops
Copy link

[Delta Test] v1.8.0-rc1-1169-g26a199017 vs v1.8.2
See result

CMakeLists.txt Show resolved Hide resolved
libraries/wasm-jit/Source/Runtime/LLVMJIT.cpp Outdated Show resolved Hide resolved
libraries/wasm-jit/Source/Runtime/LLVMJIT.cpp Outdated Show resolved Hide resolved
libraries/wasm-jit/Source/Runtime/LLVMJIT.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@swatanabe-b1 swatanabe-b1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided the tests pass, whenever they finish, this looks good.

@spoonincode spoonincode merged commit c04876e into develop Sep 9, 2019
@spoonincode spoonincode deleted the wavm_llvm_uplift branch September 9, 2019 23:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants