Implement libc-WASI for Linux SGX platform and update documents (#343)
This commit is contained in:
@ -48,8 +48,23 @@ if (NOT DEFINED WAMR_BUILD_LIBC_BUILTIN)
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED WAMR_BUILD_LIBC_WASI)
|
||||
# Disable libc wasi support by default
|
||||
set (WAMR_BUILD_LIBC_WASI 0)
|
||||
# Enable libc wasi support by default
|
||||
set (WAMR_BUILD_LIBC_WASI 1)
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED WAMR_BUILD_FAST_INTERP)
|
||||
# Enable fast interpreter
|
||||
set (WAMR_BUILD_FAST_INTERP 1)
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED WAMR_BUILD_MULTI_MODULE)
|
||||
# Enable multiple modules
|
||||
set (WAMR_BUILD_MULTI_MODULE 0)
|
||||
endif ()
|
||||
|
||||
if (NOT DEFINED WAMR_BUILD_LIB_PTHREAD)
|
||||
# Enable pthread library by default
|
||||
set (WAMR_BUILD_LIB_PTHREAD 1)
|
||||
endif ()
|
||||
|
||||
if (COLLECT_CODE_COVERAGE EQUAL 1)
|
||||
@ -62,49 +77,14 @@ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -ffunction-sections -fdata-secti
|
||||
-nostdinc -fvisibility=hidden -fpie" )
|
||||
|
||||
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
|
||||
set (SHARED_DIR ${WAMR_ROOT_DIR}/core/shared)
|
||||
set (IWASM_DIR ${WAMR_ROOT_DIR}/core/iwasm)
|
||||
set (APP_FRAMEWORK_DIR ${WAMR_ROOT_DIR}/core/app-framework)
|
||||
|
||||
# include the build config template file
|
||||
include (${WAMR_ROOT_DIR}/build-scripts/config_common.cmake)
|
||||
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
||||
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
||||
|
||||
include_directories (${SHARED_DIR}/include
|
||||
${IWASM_DIR}/include)
|
||||
|
||||
enable_language (ASM)
|
||||
|
||||
include (${SHARED_DIR}/platform/${WAMR_BUILD_PLATFORM}/shared_platform.cmake)
|
||||
include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
|
||||
include (${SHARED_DIR}/utils/shared_utils.cmake)
|
||||
if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1)
|
||||
include (${IWASM_DIR}/libraries/libc-builtin/libc_builtin.cmake)
|
||||
endif ()
|
||||
if (WAMR_BUILD_LIBC_WASI EQUAL 1)
|
||||
include (${IWASM_DIR}/libraries/libc-wasi/libc_wasi.cmake)
|
||||
endif ()
|
||||
|
||||
include (${IWASM_DIR}/common/iwasm_common.cmake)
|
||||
|
||||
if (WAMR_BUILD_INTERP EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1)
|
||||
include (${IWASM_DIR}/interpreter/iwasm_interp.cmake)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_AOT EQUAL 1)
|
||||
include (${IWASM_DIR}/aot/iwasm_aot.cmake)
|
||||
if (WAMR_BUILD_JIT EQUAL 1)
|
||||
include (${IWASM_DIR}/compilation/iwasm_compl.cmake)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
add_library (vmlib
|
||||
${PLATFORM_SHARED_SOURCE}
|
||||
${MEM_ALLOC_SHARED_SOURCE}
|
||||
${UTILS_SHARED_SOURCE}
|
||||
${LIBC_BUILTIN_SOURCE}
|
||||
${LIBC_WASI_SOURCE}
|
||||
${IWASM_COMMON_SOURCE}
|
||||
${IWASM_INTERP_SOURCE}
|
||||
${IWASM_AOT_SOURCE}
|
||||
${IWASM_COMPL_SOURCE})
|
||||
add_custom_command (
|
||||
OUTPUT libvmlib_untrusted.a
|
||||
COMMAND mkdir -p untrusted && cd untrusted &&
|
||||
${CMAKE_C_COMPILER} -c ${PLATFORM_SHARED_SOURCE_UNTRUSTED}
|
||||
COMMAND ${CMAKE_AR} rc libvmlib_untrusted.a untrusted/*.o)
|
||||
|
||||
add_custom_target (vmlib_untrusted ALL DEPENDS libvmlib_untrusted.a)
|
||||
|
||||
Reference in New Issue
Block a user