Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
set (IWASM_AOT_DIR ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
|
|
|
|
add_definitions (-DWASM_ENABLE_AOT=1)
|
|
|
|
|
|
|
|
include_directories (${IWASM_AOT_DIR})
|
|
|
|
|
2025-02-05 07:21:49 +00:00
|
|
|
list (APPEND c_source_all
|
|
|
|
${IWASM_AOT_DIR}/aot_intrinsic.c
|
|
|
|
${IWASM_AOT_DIR}/aot_loader.c
|
|
|
|
${IWASM_AOT_DIR}/aot_runtime.c
|
|
|
|
)
|
|
|
|
|
|
|
|
if (WAMR_BUILD_LINUX_PERF EQUAL 1)
|
|
|
|
list (APPEND c_source_all ${IWASM_AOT_DIR}/aot_perf_map.c)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (WAMR_BUILD_AOT_VALIDATOR EQUAL 1)
|
|
|
|
list (APPEND c_source_all ${IWASM_AOT_DIR}/aot_validator.c)
|
|
|
|
endif ()
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
2020-04-07 03:04:46 +00:00
|
|
|
if (WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_x86_64.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET STREQUAL "X86_32")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_x86_32.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET MATCHES "AARCH64.*")
|
2020-03-24 11:04:29 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_aarch64.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET MATCHES "ARM.*")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_arm.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET MATCHES "THUMB.*")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_thumb.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET STREQUAL "MIPS")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_mips.c)
|
2020-04-07 03:04:46 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET STREQUAL "XTENSA")
|
2020-02-27 08:38:44 +00:00
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_xtensa.c)
|
2021-07-22 03:16:47 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET MATCHES "RISCV*")
|
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_riscv.c)
|
2021-08-12 09:44:39 +00:00
|
|
|
elseif (WAMR_BUILD_TARGET STREQUAL "ARC")
|
|
|
|
set (arch_source ${IWASM_AOT_DIR}/arch/aot_reloc_arc.c)
|
2020-02-27 08:38:44 +00:00
|
|
|
else ()
|
|
|
|
message (FATAL_ERROR "Build target isn't set")
|
|
|
|
endif ()
|
|
|
|
|
2021-09-29 05:36:46 +00:00
|
|
|
if (WAMR_BUILD_DEBUG_AOT EQUAL 1)
|
|
|
|
add_definitions(-DWASM_ENABLE_DEBUG_AOT=1)
|
|
|
|
file(GLOB debug_source ${IWASM_AOT_DIR}/debug/*.c)
|
|
|
|
endif()
|
|
|
|
|
2023-08-18 02:16:03 +00:00
|
|
|
if ((WAMR_BUILD_TARGET STREQUAL "X86_64" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")
|
|
|
|
AND (WAMR_BUILD_PLATFORM STREQUAL "windows")
|
|
|
|
AND (NOT WAMR_DISABLE_HW_BOUND_CHECK EQUAL 1))
|
|
|
|
include(FetchContent)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
2023-08-18 02:16:03 +00:00
|
|
|
FetchContent_Declare(
|
|
|
|
zycore
|
|
|
|
GIT_REPOSITORY https://github.com/zyantific/zycore-c.git
|
|
|
|
)
|
|
|
|
FetchContent_GetProperties(zycore)
|
|
|
|
if (NOT zycore_POPULATED)
|
|
|
|
message ("-- Fetching zycore ..")
|
|
|
|
FetchContent_Populate(zycore)
|
|
|
|
include_directories("${zycore_SOURCE_DIR}/include")
|
|
|
|
include_directories("${zycore_BINARY_DIR}")
|
|
|
|
add_definitions(-DZYCORE_STATIC_BUILD=1)
|
|
|
|
add_subdirectory(${zycore_SOURCE_DIR} ${zycore_BINARY_DIR} EXCLUDE_FROM_ALL)
|
|
|
|
file (GLOB_RECURSE c_source_zycore ${zycore_SOURCE_DIR}/src/*.c)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
FetchContent_Declare(
|
|
|
|
zydis
|
|
|
|
GIT_REPOSITORY https://github.com/zyantific/zydis.git
|
|
|
|
GIT_TAG e14a07895136182a5b53e181eec3b1c6e0b434de
|
|
|
|
)
|
|
|
|
FetchContent_GetProperties(zydis)
|
|
|
|
if (NOT zydis_POPULATED)
|
|
|
|
message ("-- Fetching zydis ..")
|
|
|
|
FetchContent_Populate(zydis)
|
|
|
|
option(ZYDIS_FEATURE_ENCODER "" OFF)
|
|
|
|
option(ZYDIS_BUILD_TOOLS "" OFF)
|
|
|
|
option(ZYDIS_BUILD_EXAMPLES "" OFF)
|
|
|
|
option(ZYDIS_BUILD_MAN "" OFF)
|
|
|
|
option(ZYDIS_BUILD_DOXYGEN "" OFF)
|
|
|
|
include_directories("${zydis_BINARY_DIR}")
|
|
|
|
include_directories("${zydis_SOURCE_DIR}/include")
|
|
|
|
include_directories("${zydis_SOURCE_DIR}/src")
|
|
|
|
add_definitions(-DZYDIS_STATIC_BUILD=1)
|
|
|
|
add_subdirectory(${zydis_SOURCE_DIR} ${zydis_BINARY_DIR} EXCLUDE_FROM_ALL)
|
|
|
|
file (GLOB_RECURSE c_source_zydis ${zydis_SOURCE_DIR}/src/*.c)
|
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
set (IWASM_AOT_SOURCE ${c_source_all} ${arch_source} ${debug_source}
|
|
|
|
${c_source_zycore} ${c_source_zydis})
|