-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: enable WAMR and WAVM runtimes. (#162)
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io> Co-authored-by: Piotr Sikora <piotrsikora@google.com>
- Loading branch information
1 parent
e4042ae
commit 21af4d7
Showing
14 changed files
with
259 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
cmake( | ||
name = "llvm_lib", | ||
cache_entries = { | ||
# Disable both: BUILD and INCLUDE, since some of the INCLUDE | ||
# targets build code instead of only generating build files. | ||
"LLVM_BUILD_BENCHMARKS": "off", | ||
"LLVM_INCLUDE_BENCHMARKS": "off", | ||
"LLVM_BUILD_DOCS": "off", | ||
"LLVM_INCLUDE_DOCS": "off", | ||
"LLVM_BUILD_EXAMPLES": "off", | ||
"LLVM_INCLUDE_EXAMPLES": "off", | ||
"LLVM_BUILD_RUNTIME": "off", | ||
"LLVM_BUILD_RUNTIMES": "off", | ||
"LLVM_INCLUDE_RUNTIMES": "off", | ||
"LLVM_BUILD_TESTS": "off", | ||
"LLVM_INCLUDE_TESTS": "off", | ||
"LLVM_BUILD_TOOLS": "off", | ||
"LLVM_INCLUDE_TOOLS": "off", | ||
"LLVM_BUILD_UTILS": "off", | ||
"LLVM_INCLUDE_UTILS": "off", | ||
"LLVM_ENABLE_LIBEDIT": "off", | ||
"LLVM_ENABLE_LIBXML2": "off", | ||
"LLVM_ENABLE_TERMINFO": "off", | ||
"LLVM_ENABLE_ZLIB": "off", | ||
"LLVM_TARGETS_TO_BUILD": "X86", | ||
# Workaround for the issue with statically linked libstdc++ | ||
# using -l:libstdc++.a. | ||
"CMAKE_CXX_FLAGS": "-lstdc++", | ||
}, | ||
env_vars = { | ||
# Workaround for the -DDEBUG flag added in fastbuild on macOS, | ||
# which conflicts with DEBUG macro used in LLVM. | ||
"CFLAGS": "-UDEBUG", | ||
"CXXFLAGS": "-UDEBUG", | ||
"ASMFLAGS": "-UDEBUG", | ||
}, | ||
generate_args = ["-GNinja"], | ||
lib_source = ":srcs", | ||
out_static_libs = [ | ||
"libLLVMInterpreter.a", | ||
"libLLVMWindowsManifest.a", | ||
"libLLVMLibDriver.a", | ||
"libLLVMObjectYAML.a", | ||
"libLLVMCoverage.a", | ||
"libLLVMLineEditor.a", | ||
"libLLVMDlltoolDriver.a", | ||
"libLLVMOption.a", | ||
"libLLVMTableGen.a", | ||
"libLLVMFuzzMutate.a", | ||
"libLLVMSymbolize.a", | ||
"libLLVMCoroutines.a", | ||
"libLLVMDebugInfoPDB.a", | ||
"libLLVMLTO.a", | ||
"libLLVMObjCARCOpts.a", | ||
"libLLVMMIRParser.a", | ||
"libLLVMOrcJIT.a", | ||
"libLLVMOrcError.a", | ||
"libLLVMJITLink.a", | ||
"libLLVMPasses.a", | ||
"libLLVMipo.a", | ||
"libLLVMInstrumentation.a", | ||
"libLLVMVectorize.a", | ||
"libLLVMLinker.a", | ||
"libLLVMIRReader.a", | ||
"libLLVMAsmParser.a", | ||
"libLLVMX86Disassembler.a", | ||
"libLLVMX86AsmParser.a", | ||
"libLLVMX86CodeGen.a", | ||
"libLLVMCFGuard.a", | ||
"libLLVMGlobalISel.a", | ||
"libLLVMSelectionDAG.a", | ||
"libLLVMAsmPrinter.a", | ||
"libLLVMDebugInfoDWARF.a", | ||
"libLLVMCodeGen.a", | ||
"libLLVMScalarOpts.a", | ||
"libLLVMInstCombine.a", | ||
"libLLVMAggressiveInstCombine.a", | ||
"libLLVMTransformUtils.a", | ||
"libLLVMBitWriter.a", | ||
"libLLVMX86Desc.a", | ||
"libLLVMMCDisassembler.a", | ||
"libLLVMX86Utils.a", | ||
"libLLVMX86Info.a", | ||
"libLLVMMCJIT.a", | ||
"libLLVMExecutionEngine.a", | ||
"libLLVMTarget.a", | ||
"libLLVMAnalysis.a", | ||
"libLLVMProfileData.a", | ||
"libLLVMRuntimeDyld.a", | ||
"libLLVMObject.a", | ||
"libLLVMTextAPI.a", | ||
"libLLVMMCParser.a", | ||
"libLLVMBitReader.a", | ||
"libLLVMMC.a", | ||
"libLLVMDebugInfoCodeView.a", | ||
"libLLVMDebugInfoMSF.a", | ||
"libLLVMCore.a", | ||
"libLLVMRemarks.a", | ||
"libLLVMBitstreamReader.a", | ||
"libLLVMBinaryFormat.a", | ||
"libLLVMSupport.a", | ||
"libLLVMDemangle.a", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cmake( | ||
name = "libiwasm", | ||
name = "wamr_lib", | ||
cache_entries = { | ||
"LLVM_DIR": "$EXT_BUILD_DEPS/copy_llvm/llvm/lib/cmake/llvm", | ||
"WAMR_BUILD_INTERP": "1", | ||
"WAMR_BUILD_JIT": "0", | ||
"WAMR_BUILD_AOT": "0", | ||
"WAMR_BUILD_SIMD": "0", | ||
"WAMR_BUILD_MULTI_MODULE": "1", | ||
"WAMR_BUILD_LIBC_WASI": "0", | ||
"WAMR_BUILD_TAIL_CALL": "1", | ||
}, | ||
defines = ["WASM_WAMR"], | ||
generate_args = ["-GNinja"], | ||
lib_source = ":srcs", | ||
out_shared_libs = ["libiwasm.so"], | ||
out_static_libs = ["libvmlib.a"], | ||
deps = [ | ||
"@llvm//:llvm_lib", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
cmake( | ||
name = "wavm_lib", | ||
cache_entries = { | ||
"LLVM_DIR": "$EXT_BUILD_DEPS/copy_llvm/llvm/lib/cmake/llvm", | ||
"WAVM_ENABLE_STATIC_LINKING": "on", | ||
"WAVM_ENABLE_RELEASE_ASSERTS": "on", | ||
"WAVM_ENABLE_UNWIND": "on", | ||
# Workaround for the issue with statically linked libstdc++ | ||
# using -l:libstdc++.a. | ||
"CMAKE_CXX_FLAGS": "-lstdc++ -Wno-unused-command-line-argument", | ||
}, | ||
defines = ["WASM_WAVM"], | ||
env_vars = { | ||
# Workaround for the -DDEBUG flag added in fastbuild on macOS, | ||
# which conflicts with DEBUG macro used in LLVM. | ||
"CFLAGS": "-UDEBUG", | ||
"CXXFLAGS": "-UDEBUG", | ||
"ASMFLAGS": "-UDEBUG", | ||
}, | ||
generate_args = ["-GNinja"], | ||
lib_source = ":srcs", | ||
out_static_libs = [ | ||
"libWAVM.a", | ||
"libWAVMUnwind.a", | ||
], | ||
deps = ["@llvm//:llvm_lib"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
|
||
#include <string.h> | ||
|
||
#include <limits> | ||
#include <memory> | ||
#include <unordered_map> | ||
#include <utility> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.