Skip to content

Commit

Permalink
Upgrade wavm to newer version
Browse files Browse the repository at this point in the history
c1d2ba94 from 7th Feb 2019
  • Loading branch information
axic committed Feb 8, 2019
1 parent 059ec03 commit f81d443
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 22 deletions.
28 changes: 15 additions & 13 deletions cmake/ProjectWAVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ llvm_map_components_to_libnames(llvm_libs support core passes mcjit native Debug

set(prefix ${CMAKE_BINARY_DIR}/deps)
set(source_dir ${prefix}/src/wavm)
set(binary_dir ${prefix}/src/wavm-build)
set(include_dir ${source_dir}/Include)
set(binary_dir ${prefix}/lib/WAVM)
set(include_dir ${prefix}/include)

set(runtime_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Runtime${CMAKE_STATIC_LIBRARY_SUFFIX})
set(platform_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Platform${CMAKE_STATIC_LIBRARY_SUFFIX})
set(wasm_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}WASM${CMAKE_STATIC_LIBRARY_SUFFIX})
set(ir_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}IR${CMAKE_STATIC_LIBRARY_SUFFIX})
set(logging_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Logging${CMAKE_STATIC_LIBRARY_SUFFIX})
set(unwind_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}WAVMUnwind${CMAKE_STATIC_LIBRARY_SUFFIX})
set(llvmjit_library ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}LLVMJIT${CMAKE_STATIC_LIBRARY_SUFFIX})
set(runtime_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}Runtime${CMAKE_STATIC_LIBRARY_SUFFIX})
set(platform_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}Platform${CMAKE_STATIC_LIBRARY_SUFFIX})
set(wasm_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}WASM${CMAKE_STATIC_LIBRARY_SUFFIX})
set(ir_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}IR${CMAKE_STATIC_LIBRARY_SUFFIX})
set(logging_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}Logging${CMAKE_STATIC_LIBRARY_SUFFIX})
set(unwind_library ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}WAVMUnwind${CMAKE_STATIC_LIBRARY_SUFFIX})
set(llvmjit_library ${binary_dir}/Release/${CMAKE_STATIC_LIBRARY_PREFIX}LLVMJIT${CMAKE_STATIC_LIBRARY_SUFFIX})

set(other_libraries ${platform_library} ${wasm_library} ${ir_library} ${logging_library} ${unwind_library} ${llvmjit_library})


ExternalProject_Add(wavm
PREFIX ${prefix}
DOWNLOAD_NAME wavm-a0baaec170b55cc60cfe6bcc6b36add953a065d8.tar.gz
DOWNLOAD_NAME wavm-c1d2ba945edcc9d87e9fc0044777ab1850a1c2a6.tar.gz
DOWNLOAD_DIR ${prefix}/downloads
SOURCE_DIR ${source_dir}
BINARY_DIR ${binary_dir}
URL https://github.com/AndrewScheidecker/WAVM/archive/fa5434e03efbc2154ecf4aafede169da76a4da40.tar.gz
URL_HASH SHA256=1a380461ca6570b39d548dcedfacb3c105769d5d5957e85674253250f585c07d
URL https://github.com/WAVM/WAVM/archive/c1d2ba945edcc9d87e9fc0044777ab1850a1c2a6.tar.gz
URL_HASH SHA256=ff1ecb896e6bc5a4e0835ff5b7a490c46cb7032e03f8cbdb26803f3ab6e5db00
PATCH_COMMAND sh ${CMAKE_CURRENT_LIST_DIR}/patch_wavm.sh
CMAKE_ARGS
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
Expand All @@ -41,8 +41,10 @@ ExternalProject_Add(wavm
-DCMAKE_BUILD_TYPE=Release
-DLLVM_DIR=${LLVM_DIR}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DWAVM_ENABLE_RUNTIME=ON
-DWAVM_ENABLE_STATIC_LINKING=ON
-DCMAKE_CXX_FLAGS=-Wno-error
INSTALL_COMMAND ""
INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install
BUILD_BYPRODUCTS ${runtime_library} ${other_libraries}
)

Expand Down
1 change: 0 additions & 1 deletion cmake/patch_wavm.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh

sed -iE 's/SHARED//' CMakeLists.txt
sed -iE 's/-Werror//' CMakeLists.txt
23 changes: 15 additions & 8 deletions src/wavm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,21 @@

#include "wavm.h"

#define DLL_IMPORT // Needed by wavm on some platforms
#include "Inline/Serialization.h"
#include "IR/Module.h"
#include "IR/Validate.h"
#include "Runtime/Intrinsics.h"
#include "Runtime/Linker.h"
#include "Runtime/Runtime.h"
#include "WASM/WASM.h"
// Needed by wavm on some platforms
#define IR_API
#define RUNTIME_API
#define LOGGING_API
#define WASM_API
#define PLATFORM_API
#define DLL_IMPORT

#include <WAVM/Inline/Serialization.h>
#include <WAVM/IR/Module.h>
#include <WAVM/IR/Validate.h>
#include <WAVM/Runtime/Intrinsics.h>
#include <WAVM/Runtime/Linker.h>
#include <WAVM/Runtime/Runtime.h>
#include <WAVM/WASM/WASM.h>

#include "debugging.h"
#include "eei.h"
Expand Down

0 comments on commit f81d443

Please sign in to comment.