Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/iwasm/compilation/aot_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4065,6 +4065,7 @@ aot_compile_wasm(AOTCompContext *comp_ctx)
os_printf("\n");
#endif

#if WAMR_BUILD_JIT != 0
if (comp_ctx->is_jit_mode) {
LLVMErrorRef err;
LLVMOrcJITDylibRef orc_main_dylib;
Expand Down Expand Up @@ -4104,7 +4105,7 @@ aot_compile_wasm(AOTCompContext *comp_ctx)
comp_ctx->jit_stack_sizes = (uint32 *)addr;
}
}

#endif /* WAMR_BUILD_JIT != 0*/
return true;
}

Expand Down
9 changes: 8 additions & 1 deletion core/iwasm/compilation/aot_llvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,7 @@ aot_handle_llvm_errmsg(const char *string, LLVMErrorRef err)
LLVMDisposeErrorMessage(err_msg);
}

#if WAMR_BUILD_JIT != 0
static bool
create_target_machine_detect_host(AOTCompContext *comp_ctx)
{
Expand Down Expand Up @@ -2599,6 +2600,7 @@ orc_jit_create(AOTCompContext *comp_ctx)
LLVMOrcDisposeLLLazyJIT(orc_jit);
return ret;
}
#endif /* WAMR_BUILD_JIT != 0*/

bool
aot_compiler_init(void)
Expand Down Expand Up @@ -2809,6 +2811,7 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
comp_ctx->custom_sections_wp = option->custom_sections;
comp_ctx->custom_sections_count = option->custom_sections_count;

#if WASM_ENABLE_JIT != 0
if (option->is_jit_mode) {
comp_ctx->is_jit_mode = true;

Expand Down Expand Up @@ -2840,7 +2843,9 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
if (!orc_jit_create(comp_ctx))
goto fail;
}
else {
else
#endif /*WASM_ENABLE_JIT != 0*/
{
/* Create LLVM target machine */
if (!option->target_arch || !strstr(option->target_arch, "-")) {
/* Retrieve the target triple based on user input */
Expand Down Expand Up @@ -3484,9 +3489,11 @@ aot_destroy_comp_context(AOTCompContext *comp_ctx)
/* Note: don't dispose comp_ctx->context and comp_ctx->module as
they are disposed when disposing the thread safe context */

#if WAMR_BUILD_JIT != 0
/* Has to be the last one */
if (comp_ctx->orc_jit)
LLVMOrcDisposeLLLazyJIT(comp_ctx->orc_jit);
#endif

if (comp_ctx->func_ctxes)
aot_destroy_func_contexts(comp_ctx, comp_ctx->func_ctxes,
Expand Down
39 changes: 29 additions & 10 deletions core/iwasm/compilation/iwasm_compl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,36 @@ set (IWASM_COMPL_DIR ${CMAKE_CURRENT_LIST_DIR})
include_directories(${IWASM_COMPL_DIR})
enable_language(CXX)

file (GLOB source_all
${IWASM_COMPL_DIR}/aot.c
${IWASM_COMPL_DIR}/aot_compiler.c
${IWASM_COMPL_DIR}/aot_llvm.c
${IWASM_COMPL_DIR}/aot_llvm_extra*.cpp
${IWASM_COMPL_DIR}/aot_stack_frame*.c
${IWASM_COMPL_DIR}/aot_emit_*.c
)

if (WAMR_BUILD_DEBUG_AOT EQUAL 1)
file (GLOB_RECURSE source_all
${IWASM_COMPL_DIR}/*.c
${IWASM_COMPL_DIR}/*.cpp)
else()
file (GLOB source_all
${IWASM_COMPL_DIR}/simd/*.c
${IWASM_COMPL_DIR}/simd/*.cpp
${IWASM_COMPL_DIR}/*.c
${IWASM_COMPL_DIR}/*.cpp)
endif()
file(GLOB debug_sources
${IWASM_COMPL_DIR}/debug/*.c
)
list(APPEND source_all ${debug_sources})
endif ()

if (WAMR_BUILD_SIMD EQUAL 1)
file(GLOB simd_sources
${IWASM_COMPL_DIR}/simd/*.c
)
list(APPEND source_all ${simd_sources})
endif ()

if (WAMR_BUILD_LLVM EQUAL 1)
message("Build with LLVM ORC JIT support")
file(GLOB orc_jit_sources
${IWASM_COMPL_DIR}/aot_orc_extra*.cpp
)
list(APPEND source_all ${orc_jit_sources})
endif ()

set (IWASM_COMPL_SOURCE ${source_all})

Expand Down
6 changes: 6 additions & 0 deletions wamr-compiler/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")

# Turn on SIMD by default, can be turned off by setting WAMR_BUILD_SIMD to 0
if (NOT WAMR_BUILD_SIMD)
set (WAMR_BUILD_SIMD 1)
endif ()

if (WAMR_BUILD_SIMD EQUAL 0)
add_definitions(-DWASM_ENABLE_SIMD=0)
else()
add_definitions(-DWASM_ENABLE_SIMD=1)
endif()

set(WAMR_BUILD_JIT 0)

add_definitions(-DWASM_ENABLE_INTERP=1)
add_definitions(-DWASM_ENABLE_WAMR_COMPILER=1)
add_definitions(-DWASM_ENABLE_BULK_MEMORY=1)
Expand Down
Loading