2019-05-07 02:18:18 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
2019-11-11 23:45:21 +00:00
|
|
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-05-07 02:18:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CONFIG_H_
|
2019-12-18 03:53:43 +00:00
|
|
|
#define _CONFIG_H_
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
/* clang-format off */
|
2019-11-01 05:38:45 +00:00
|
|
|
#if !defined(BUILD_TARGET_X86_64) \
|
|
|
|
&& !defined(BUILD_TARGET_AMD_64) \
|
2020-03-24 11:04:29 +00:00
|
|
|
&& !defined(BUILD_TARGET_AARCH64) \
|
2019-11-01 05:38:45 +00:00
|
|
|
&& !defined(BUILD_TARGET_X86_32) \
|
2019-12-24 03:09:54 +00:00
|
|
|
&& !defined(BUILD_TARGET_ARM) \
|
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
|
|
|
&& !defined(BUILD_TARGET_ARM_VFP) \
|
2019-12-24 03:09:54 +00:00
|
|
|
&& !defined(BUILD_TARGET_THUMB) \
|
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
|
|
|
&& !defined(BUILD_TARGET_THUMB_VFP) \
|
2019-12-24 03:09:54 +00:00
|
|
|
&& !defined(BUILD_TARGET_MIPS) \
|
2021-01-25 10:41:48 +00:00
|
|
|
&& !defined(BUILD_TARGET_XTENSA) \
|
|
|
|
&& !defined(BUILD_TARGET_RISCV64_LP64D) \
|
|
|
|
&& !defined(BUILD_TARGET_RISCV64_LP64) \
|
|
|
|
&& !defined(BUILD_TARGET_RISCV32_ILP32D) \
|
2021-08-12 09:44:39 +00:00
|
|
|
&& !defined(BUILD_TARGET_RISCV32_ILP32) \
|
|
|
|
&& !defined(BUILD_TARGET_ARC)
|
2021-10-13 07:13:00 +00:00
|
|
|
/* clang-format on */
|
2019-11-01 05:38:45 +00:00
|
|
|
#if defined(__x86_64__) || defined(__x86_64)
|
|
|
|
#define BUILD_TARGET_X86_64
|
|
|
|
#elif defined(__amd64__) || defined(__amd64)
|
|
|
|
#define BUILD_TARGET_AMD_64
|
2020-03-24 11:04:29 +00:00
|
|
|
#elif defined(__aarch64__)
|
|
|
|
#define BUILD_TARGET_AARCH64
|
2019-11-01 05:38:45 +00:00
|
|
|
#elif defined(__i386__) || defined(__i386) || defined(i386)
|
|
|
|
#define BUILD_TARGET_X86_32
|
2019-12-24 03:09:54 +00:00
|
|
|
#elif defined(__thumb__)
|
|
|
|
#define BUILD_TARGET_THUMB
|
|
|
|
#define BUILD_TARGET "THUMBV4T"
|
2019-11-01 05:38:45 +00:00
|
|
|
#elif defined(__arm__)
|
2019-12-24 03:09:54 +00:00
|
|
|
#define BUILD_TARGET_ARM
|
|
|
|
#define BUILD_TARGET "ARMV4T"
|
2019-11-01 05:38:45 +00:00
|
|
|
#elif defined(__mips__) || defined(__mips) || defined(mips)
|
2019-12-24 03:09:54 +00:00
|
|
|
#define BUILD_TARGET_MIPS
|
2019-11-01 05:38:45 +00:00
|
|
|
#elif defined(__XTENSA__)
|
|
|
|
#define BUILD_TARGET_XTENSA
|
2021-01-25 10:41:48 +00:00
|
|
|
#elif defined(__riscv) && (__riscv_xlen == 64)
|
|
|
|
#define BUILD_TARGET_RISCV64_LP64D
|
|
|
|
#elif defined(__riscv) && (__riscv_xlen == 32)
|
|
|
|
#define BUILD_TARGET_RISCV32_ILP32D
|
2021-08-12 09:44:39 +00:00
|
|
|
#elif defined(__arc__)
|
|
|
|
#define BUILD_TARGET_ARC
|
2019-11-01 05:38:45 +00:00
|
|
|
#else
|
|
|
|
#error "Build target isn't set"
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2020-03-16 08:43:57 +00:00
|
|
|
#ifndef BH_DEBUG
|
|
|
|
#define BH_DEBUG 0
|
|
|
|
#endif
|
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
#define MEM_ALLOCATOR_EMS 0
|
2020-09-24 02:48:34 +00:00
|
|
|
#define MEM_ALLOCATOR_TLSF 1
|
2019-05-07 02:18:18 +00:00
|
|
|
|
|
|
|
/* Default memory allocator */
|
|
|
|
#define DEFAULT_MEM_ALLOCATOR MEM_ALLOCATOR_EMS
|
|
|
|
|
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
|
|
|
#ifndef WASM_ENABLE_INTERP
|
|
|
|
#define WASM_ENABLE_INTERP 0
|
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
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
|
|
|
#ifndef WASM_ENABLE_AOT
|
|
|
|
#define WASM_ENABLE_AOT 0
|
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2022-10-31 09:25:24 +00:00
|
|
|
#ifndef WASM_ENABLE_WORD_ALIGN_READ
|
|
|
|
#define WASM_ENABLE_WORD_ALIGN_READ 0
|
|
|
|
#endif
|
|
|
|
|
2020-04-13 02:49:40 +00:00
|
|
|
#define AOT_MAGIC_NUMBER 0x746f6100
|
2021-04-15 03:29:20 +00:00
|
|
|
#define AOT_CURRENT_VERSION 3
|
2020-04-13 02:49:40 +00:00
|
|
|
|
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
|
|
|
#ifndef WASM_ENABLE_JIT
|
|
|
|
#define WASM_ENABLE_JIT 0
|
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2021-09-07 03:39:57 +00:00
|
|
|
#ifndef WASM_ENABLE_LAZY_JIT
|
|
|
|
#define WASM_ENABLE_LAZY_JIT 0
|
|
|
|
#endif
|
|
|
|
|
2022-10-18 12:17:34 +00:00
|
|
|
#ifndef WASM_ORC_JIT_BACKEND_THREAD_NUM
|
|
|
|
/* The number of backend threads created by runtime */
|
|
|
|
#define WASM_ORC_JIT_BACKEND_THREAD_NUM 4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if WASM_ORC_JIT_BACKEND_THREAD_NUM < 1
|
|
|
|
#error "WASM_ORC_JIT_BACKEND_THREAD_NUM must be greater than 0"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ORC_JIT_COMPILE_THREAD_NUM
|
|
|
|
/* The number of compilation threads created by LLVM JIT */
|
|
|
|
#define WASM_ORC_JIT_COMPILE_THREAD_NUM 4
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if WASM_ORC_JIT_COMPILE_THREAD_NUM < 1
|
|
|
|
#error "WASM_ORC_JIT_COMPILE_THREAD_NUM must be greater than 0"
|
2022-01-20 10:40:13 +00:00
|
|
|
#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
|
|
|
#if (WASM_ENABLE_AOT == 0) && (WASM_ENABLE_JIT != 0)
|
2022-10-18 12:17:34 +00:00
|
|
|
/* LLVM JIT can only be enabled when AOT is enabled */
|
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
|
|
|
#undef WASM_ENABLE_JIT
|
|
|
|
#define WASM_ENABLE_JIT 0
|
2021-09-07 03:39:57 +00:00
|
|
|
|
|
|
|
#undef WASM_ENABLE_LAZY_JIT
|
|
|
|
#define WASM_ENABLE_LAZY_JIT 0
|
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
|
|
|
#endif
|
|
|
|
|
2022-08-02 08:03:50 +00:00
|
|
|
#ifndef WASM_ENABLE_FAST_JIT
|
|
|
|
#define WASM_ENABLE_FAST_JIT 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ENABLE_FAST_JIT_DUMP
|
|
|
|
#define WASM_ENABLE_FAST_JIT_DUMP 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FAST_JIT_DEFAULT_CODE_CACHE_SIZE
|
|
|
|
#define FAST_JIT_DEFAULT_CODE_CACHE_SIZE 10 * 1024 * 1024
|
|
|
|
#endif
|
|
|
|
|
2020-02-18 07:15:24 +00:00
|
|
|
#ifndef WASM_ENABLE_WAMR_COMPILER
|
|
|
|
#define WASM_ENABLE_WAMR_COMPILER 0
|
|
|
|
#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
|
|
|
#ifndef WASM_ENABLE_LIBC_BUILTIN
|
|
|
|
#define WASM_ENABLE_LIBC_BUILTIN 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ENABLE_LIBC_WASI
|
|
|
|
#define WASM_ENABLE_LIBC_WASI 0
|
|
|
|
#endif
|
|
|
|
|
2021-02-22 06:17:46 +00:00
|
|
|
#ifndef WASM_ENABLE_UVWASI
|
|
|
|
#define WASM_ENABLE_UVWASI 0
|
|
|
|
#endif
|
|
|
|
|
2022-10-19 08:46:26 +00:00
|
|
|
#ifndef WASM_ENABLE_WASI_NN
|
|
|
|
#define WASM_ENABLE_WASI_NN 0
|
|
|
|
#endif
|
|
|
|
|
2023-08-14 12:03:56 +00:00
|
|
|
#ifndef WASM_ENABLE_WASI_NN_GPU
|
|
|
|
#define WASM_ENABLE_WASI_NN_GPU 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ENABLE_WASI_NN_EXTERNAL_DELEGATE
|
|
|
|
#define WASM_ENABLE_WASI_NN_EXTERNAL_DELEGATE 0
|
|
|
|
#endif
|
|
|
|
|
2024-03-21 13:05:34 +00:00
|
|
|
#ifndef WASM_ENABLE_WASI_EPHEMERAL_NN
|
|
|
|
#define WASM_ENABLE_WASI_EPHEMERAL_NN 0
|
|
|
|
#endif
|
|
|
|
|
2020-10-22 08:18:37 +00:00
|
|
|
/* Default disable libc emcc */
|
|
|
|
#ifndef WASM_ENABLE_LIBC_EMCC
|
|
|
|
#define WASM_ENABLE_LIBC_EMCC 0
|
|
|
|
#endif
|
|
|
|
|
2022-09-06 06:29:58 +00:00
|
|
|
#ifndef WASM_ENABLE_LIB_RATS
|
|
|
|
#define WASM_ENABLE_LIB_RATS 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-15 11:04:04 +00:00
|
|
|
#ifndef WASM_ENABLE_LIB_PTHREAD
|
|
|
|
#define WASM_ENABLE_LIB_PTHREAD 0
|
|
|
|
#endif
|
|
|
|
|
2022-08-08 11:59:46 +00:00
|
|
|
#ifndef WASM_ENABLE_LIB_PTHREAD_SEMAPHORE
|
|
|
|
#define WASM_ENABLE_LIB_PTHREAD_SEMAPHORE 0
|
|
|
|
#endif
|
|
|
|
|
2022-12-06 13:11:27 +00:00
|
|
|
#ifndef WASM_ENABLE_LIB_WASI_THREADS
|
|
|
|
#define WASM_ENABLE_LIB_WASI_THREADS 0
|
|
|
|
#endif
|
|
|
|
|
2022-12-19 02:58:12 +00:00
|
|
|
#ifndef WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION
|
|
|
|
#define WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION WASM_ENABLE_LIB_WASI_THREADS
|
|
|
|
#elif WASM_ENABLE_HEAP_AUX_STACK_ALLOCATION == 0 \
|
|
|
|
&& WASM_ENABLE_LIB_WASI_THREADS == 1
|
|
|
|
#error "Heap aux stack allocation must be enabled for WASI threads"
|
|
|
|
#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
|
|
|
#ifndef WASM_ENABLE_BASE_LIB
|
|
|
|
#define WASM_ENABLE_BASE_LIB 0
|
2019-05-07 02:18:18 +00:00
|
|
|
#endif
|
|
|
|
|
2020-03-04 12:12:38 +00:00
|
|
|
#ifndef WASM_ENABLE_APP_FRAMEWORK
|
|
|
|
#define WASM_ENABLE_APP_FRAMEWORK 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-02 14:17:44 +00:00
|
|
|
#ifndef WASM_HAVE_MREMAP
|
|
|
|
#define WASM_HAVE_MREMAP 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-02 06:53:06 +00:00
|
|
|
/* Bulk memory operation */
|
|
|
|
#ifndef WASM_ENABLE_BULK_MEMORY
|
|
|
|
#define WASM_ENABLE_BULK_MEMORY 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-15 11:04:04 +00:00
|
|
|
/* Shared memory */
|
|
|
|
#ifndef WASM_ENABLE_SHARED_MEMORY
|
|
|
|
#define WASM_ENABLE_SHARED_MEMORY 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Thread manager */
|
|
|
|
#ifndef WASM_ENABLE_THREAD_MGR
|
|
|
|
#define WASM_ENABLE_THREAD_MGR 0
|
|
|
|
#endif
|
|
|
|
|
2021-10-26 10:52:30 +00:00
|
|
|
/* Source debugging */
|
|
|
|
#ifndef WASM_ENABLE_DEBUG_INTERP
|
|
|
|
#define WASM_ENABLE_DEBUG_INTERP 0
|
|
|
|
#endif
|
|
|
|
|
2022-04-04 00:23:55 +00:00
|
|
|
#if WASM_ENABLE_DEBUG_INTERP != 0
|
|
|
|
#ifndef DEBUG_EXECUTION_MEMORY_SIZE
|
|
|
|
/* 0x85000 is the size required by lldb, if this is changed to a smaller value,
|
|
|
|
* then the debugger will not be able to evaluate user expressions, other
|
|
|
|
* functionality such as breakpoint and stepping are not influenced by this */
|
|
|
|
#define DEBUG_EXECUTION_MEMORY_SIZE 0x85000
|
|
|
|
#endif
|
|
|
|
#endif /* end of WASM_ENABLE_DEBUG_INTERP != 0 */
|
|
|
|
|
2021-10-26 10:52:30 +00:00
|
|
|
#ifndef WASM_ENABLE_DEBUG_AOT
|
|
|
|
#define WASM_ENABLE_DEBUG_AOT 0
|
|
|
|
#endif
|
|
|
|
|
2022-06-10 13:51:13 +00:00
|
|
|
/* Custom sections */
|
|
|
|
#ifndef WASM_ENABLE_LOAD_CUSTOM_SECTION
|
|
|
|
#define WASM_ENABLE_LOAD_CUSTOM_SECTION 0
|
|
|
|
#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
|
|
|
/* WASM log system */
|
2019-08-28 07:08:52 +00:00
|
|
|
#ifndef WASM_ENABLE_LOG
|
2019-05-07 02:18:18 +00:00
|
|
|
#define WASM_ENABLE_LOG 1
|
2019-08-28 07:08:52 +00:00
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2024-01-21 23:33:26 +00:00
|
|
|
/* When this flag is set, WAMR will not automatically
|
|
|
|
* initialize sockets on Windows platforms. The host
|
|
|
|
* application is responsible for calling WSAStartup()
|
|
|
|
* before executing WAMR code that uses sockets, and
|
|
|
|
* calling WSACleanup() after.
|
|
|
|
* This flag passes control of socket initialization from
|
|
|
|
* WAMR to the host application. */
|
|
|
|
#ifndef WASM_ENABLE_HOST_SOCKET_INIT
|
|
|
|
#define WASM_ENABLE_HOST_SOCKET_INIT 0
|
|
|
|
#endif
|
|
|
|
|
2021-04-01 08:50:46 +00:00
|
|
|
#ifndef WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS
|
|
|
|
#if defined(BUILD_TARGET_X86_32) || defined(BUILD_TARGET_X86_64) \
|
|
|
|
|| defined(BUILD_TARGET_AARCH64)
|
|
|
|
#define WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS 1
|
2019-12-13 07:30:30 +00:00
|
|
|
#else
|
2021-04-01 08:50:46 +00:00
|
|
|
#define WASM_CPU_SUPPORTS_UNALIGNED_ADDR_ACCESS 0
|
|
|
|
#endif
|
2019-12-13 07:30:30 +00:00
|
|
|
#endif
|
|
|
|
|
2019-05-07 02:18:18 +00:00
|
|
|
/* WASM Interpreter labels-as-values feature */
|
2021-04-01 08:50:46 +00:00
|
|
|
#ifndef WASM_ENABLE_LABELS_AS_VALUES
|
2020-08-11 03:30:51 +00:00
|
|
|
#ifdef __GNUC__
|
2019-05-07 02:18:18 +00:00
|
|
|
#define WASM_ENABLE_LABELS_AS_VALUES 1
|
2020-08-11 03:30:51 +00:00
|
|
|
#else
|
|
|
|
#define WASM_ENABLE_LABELS_AS_VALUES 0
|
|
|
|
#endif
|
2021-04-01 08:50:46 +00:00
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2020-07-23 08:54:13 +00:00
|
|
|
/* Enable fast interpreter or not */
|
|
|
|
#ifndef WASM_ENABLE_FAST_INTERP
|
|
|
|
#define WASM_ENABLE_FAST_INTERP 0
|
|
|
|
#endif
|
|
|
|
|
2020-03-07 14:20:38 +00:00
|
|
|
#if WASM_ENABLE_FAST_INTERP != 0
|
|
|
|
#define WASM_DEBUG_PREPROCESSOR 0
|
|
|
|
#endif
|
|
|
|
|
2020-03-18 09:49:23 +00:00
|
|
|
/* Enable opcode counter or not */
|
|
|
|
#ifndef WASM_ENABLE_OPCODE_COUNTER
|
|
|
|
#define WASM_ENABLE_OPCODE_COUNTER 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-02 06:53:06 +00:00
|
|
|
/* Support a module with dependency, other modules */
|
|
|
|
#ifndef WASM_ENABLE_MULTI_MODULE
|
|
|
|
#define WASM_ENABLE_MULTI_MODULE 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-08 03:19:09 +00:00
|
|
|
/* Enable wasm mini loader or not */
|
|
|
|
#ifndef WASM_ENABLE_MINI_LOADER
|
|
|
|
#define WASM_ENABLE_MINI_LOADER 0
|
|
|
|
#endif
|
|
|
|
|
2020-06-28 07:41:25 +00:00
|
|
|
/* Disable boundary check with hardware trap or not,
|
|
|
|
* enable it by default if it is supported */
|
|
|
|
#ifndef WASM_DISABLE_HW_BOUND_CHECK
|
|
|
|
#define WASM_DISABLE_HW_BOUND_CHECK 0
|
|
|
|
#endif
|
|
|
|
|
2022-11-07 10:26:33 +00:00
|
|
|
/* Disable native stack access boundary check with hardware
|
|
|
|
* trap or not, enable it by default if it is supported */
|
|
|
|
#ifndef WASM_DISABLE_STACK_HW_BOUND_CHECK
|
|
|
|
#define WASM_DISABLE_STACK_HW_BOUND_CHECK 0
|
|
|
|
#endif
|
|
|
|
|
2024-05-05 23:56:48 +00:00
|
|
|
/* Disable SIMD unless it is manually enabled somewhere */
|
2020-11-05 10:15:15 +00:00
|
|
|
#ifndef WASM_ENABLE_SIMD
|
|
|
|
#define WASM_ENABLE_SIMD 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
/* GC performance profiling */
|
|
|
|
#ifndef WASM_ENABLE_GC_PERF_PROFILING
|
|
|
|
#define WASM_ENABLE_GC_PERF_PROFILING 0
|
|
|
|
#endif
|
|
|
|
|
2020-09-18 10:04:56 +00:00
|
|
|
/* Memory profiling */
|
|
|
|
#ifndef WASM_ENABLE_MEMORY_PROFILING
|
|
|
|
#define WASM_ENABLE_MEMORY_PROFILING 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Memory tracing */
|
|
|
|
#ifndef WASM_ENABLE_MEMORY_TRACING
|
|
|
|
#define WASM_ENABLE_MEMORY_TRACING 0
|
|
|
|
#endif
|
2020-03-30 03:06:39 +00:00
|
|
|
|
2021-01-18 05:23:10 +00:00
|
|
|
/* Performance profiling */
|
|
|
|
#ifndef WASM_ENABLE_PERF_PROFILING
|
|
|
|
#define WASM_ENABLE_PERF_PROFILING 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Dump call stack */
|
|
|
|
#ifndef WASM_ENABLE_DUMP_CALL_STACK
|
|
|
|
#define WASM_ENABLE_DUMP_CALL_STACK 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
/* AOT stack frame */
|
|
|
|
#ifndef WASM_ENABLE_AOT_STACK_FRAME
|
|
|
|
#define WASM_ENABLE_AOT_STACK_FRAME 0
|
|
|
|
#endif
|
|
|
|
|
2020-03-30 03:06:39 +00:00
|
|
|
/* Heap verification */
|
2020-09-18 10:04:56 +00:00
|
|
|
#ifndef BH_ENABLE_GC_VERIFY
|
2020-03-30 03:06:39 +00:00
|
|
|
#define BH_ENABLE_GC_VERIFY 0
|
2020-09-18 10:04:56 +00:00
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2023-11-15 09:20:50 +00:00
|
|
|
/* Heap corruption check, enabled by default */
|
|
|
|
#ifndef BH_ENABLE_GC_CORRUPTION_CHECK
|
|
|
|
#define BH_ENABLE_GC_CORRUPTION_CHECK 1
|
|
|
|
#endif
|
|
|
|
|
2022-09-01 08:15:00 +00:00
|
|
|
/* Enable global heap pool if heap verification is enabled */
|
|
|
|
#if BH_ENABLE_GC_VERIFY != 0
|
|
|
|
#define WASM_ENABLE_GLOBAL_HEAP_POOL 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Global heap pool */
|
|
|
|
#ifndef WASM_ENABLE_GLOBAL_HEAP_POOL
|
|
|
|
#define WASM_ENABLE_GLOBAL_HEAP_POOL 0
|
|
|
|
#endif
|
|
|
|
|
2022-09-03 00:18:45 +00:00
|
|
|
#ifndef WASM_ENABLE_SPEC_TEST
|
|
|
|
#define WASM_ENABLE_SPEC_TEST 0
|
|
|
|
#endif
|
|
|
|
|
2024-06-25 02:04:39 +00:00
|
|
|
#ifndef WASM_ENABLE_WASI_TEST
|
|
|
|
#define WASM_ENABLE_WASI_TEST 0
|
|
|
|
#endif
|
|
|
|
|
2022-09-01 08:15:00 +00:00
|
|
|
/* Global heap pool size in bytes */
|
|
|
|
#ifndef WASM_GLOBAL_HEAP_SIZE
|
|
|
|
#define WASM_GLOBAL_HEAP_SIZE (10 * 1024 * 1024)
|
|
|
|
#endif
|
|
|
|
|
2019-05-07 02:18:18 +00:00
|
|
|
/* Default length of queue */
|
2024-05-14 02:52:05 +00:00
|
|
|
#ifndef DEFAULT_QUEUE_LENGTH
|
2019-05-07 02:18:18 +00:00
|
|
|
#define DEFAULT_QUEUE_LENGTH 50
|
2024-05-14 02:52:05 +00:00
|
|
|
#endif
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2019-05-31 06:21:39 +00:00
|
|
|
/* The max percentage of global heap that app memory space can grow */
|
2024-05-14 02:52:05 +00:00
|
|
|
#ifndef APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT
|
2019-05-31 06:21:39 +00:00
|
|
|
#define APP_MEMORY_MAX_GLOBAL_HEAP_PERCENT 1 / 3
|
2024-05-14 02:52:05 +00:00
|
|
|
#endif
|
2019-05-31 06:21:39 +00:00
|
|
|
|
2019-05-23 10:03:31 +00:00
|
|
|
/* Default min/max heap size of each app */
|
2021-08-12 09:44:39 +00:00
|
|
|
#ifndef APP_HEAP_SIZE_DEFAULT
|
2019-05-23 10:03:31 +00:00
|
|
|
#define APP_HEAP_SIZE_DEFAULT (8 * 1024)
|
2021-08-12 09:44:39 +00:00
|
|
|
#endif
|
2021-01-25 10:41:48 +00:00
|
|
|
#define APP_HEAP_SIZE_MIN (256)
|
2020-03-16 08:43:57 +00:00
|
|
|
#define APP_HEAP_SIZE_MAX (512 * 1024 * 1024)
|
2019-05-07 02:18:18 +00:00
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
/* Default min/max gc heap size of each app */
|
|
|
|
#ifndef GC_HEAP_SIZE_DEFAULT
|
|
|
|
#define GC_HEAP_SIZE_DEFAULT (128 * 1024)
|
|
|
|
#endif
|
|
|
|
#define GC_HEAP_SIZE_MIN (4 * 1024)
|
|
|
|
#define GC_HEAP_SIZE_MAX (1024 * 1024 * 1024)
|
|
|
|
|
2019-05-23 10:03:31 +00:00
|
|
|
/* Default wasm stack size of each app */
|
2019-11-01 05:38:45 +00:00
|
|
|
#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)
|
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
|
|
|
#define DEFAULT_WASM_STACK_SIZE (16 * 1024)
|
2019-08-02 06:00:35 +00:00
|
|
|
#else
|
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
|
|
|
#define DEFAULT_WASM_STACK_SIZE (12 * 1024)
|
2019-08-02 06:00:35 +00:00
|
|
|
#endif
|
2024-04-02 07:22:07 +00:00
|
|
|
/* Min auxiliary stack size of each wasm thread */
|
2021-02-10 02:11:32 +00:00
|
|
|
#define WASM_THREAD_AUX_STACK_SIZE_MIN (256)
|
2019-05-23 10:03:31 +00:00
|
|
|
|
2022-02-11 03:43:03 +00:00
|
|
|
/* Default/min native stack size of each app thread */
|
|
|
|
#if !(defined(APP_THREAD_STACK_SIZE_DEFAULT) \
|
|
|
|
&& defined(APP_THREAD_STACK_SIZE_MIN))
|
2021-10-12 10:11:32 +00:00
|
|
|
#if defined(BH_PLATFORM_ZEPHYR) || defined(BH_PLATFORM_ALIOS_THINGS) \
|
|
|
|
|| defined(BH_PLATFORM_ESP_IDF) || defined(BH_PLATFORM_OPENRTOS)
|
2020-03-04 12:12:38 +00:00
|
|
|
#define APP_THREAD_STACK_SIZE_DEFAULT (6 * 1024)
|
|
|
|
#define APP_THREAD_STACK_SIZE_MIN (4 * 1024)
|
2021-10-12 10:11:32 +00:00
|
|
|
#elif defined(PTHREAD_STACK_DEFAULT) && defined(PTHREAD_STACK_MIN)
|
2021-10-13 07:13:00 +00:00
|
|
|
#define APP_THREAD_STACK_SIZE_DEFAULT PTHREAD_STACK_DEFAULT
|
|
|
|
#define APP_THREAD_STACK_SIZE_MIN PTHREAD_STACK_MIN
|
2022-02-11 03:43:03 +00:00
|
|
|
#elif WASM_ENABLE_UVWASI != 0
|
|
|
|
/* UVWASI requires larger native stack */
|
|
|
|
#define APP_THREAD_STACK_SIZE_DEFAULT (64 * 1024)
|
|
|
|
#define APP_THREAD_STACK_SIZE_MIN (48 * 1024)
|
2021-10-12 10:11:32 +00:00
|
|
|
#else
|
2024-01-15 11:05:23 +00:00
|
|
|
#define APP_THREAD_STACK_SIZE_DEFAULT (128 * 1024)
|
2021-10-12 10:11:32 +00:00
|
|
|
#define APP_THREAD_STACK_SIZE_MIN (24 * 1024)
|
2020-08-11 06:47:24 +00:00
|
|
|
#endif
|
2022-02-11 03:43:03 +00:00
|
|
|
#endif /* end of !(defined(APP_THREAD_STACK_SIZE_DEFAULT) \
|
|
|
|
&& defined(APP_THREAD_STACK_SIZE_MIN)) */
|
|
|
|
|
|
|
|
/* Max native stack size of each app thread */
|
2020-08-11 06:47:24 +00:00
|
|
|
#if !defined(APP_THREAD_STACK_SIZE_MAX)
|
|
|
|
#define APP_THREAD_STACK_SIZE_MAX (8 * 1024 * 1024)
|
2019-05-23 10:03:31 +00:00
|
|
|
#endif
|
2019-08-21 08:39:50 +00:00
|
|
|
|
2020-04-30 09:52:11 +00:00
|
|
|
/* Reserved bytes to the native thread stack boundary, throw native
|
2024-05-05 23:56:48 +00:00
|
|
|
* stack overflow exception if the guard boundary is reached
|
2024-04-19 02:19:59 +00:00
|
|
|
*
|
|
|
|
* WASM_STACK_GUARD_SIZE needs to be large enough for:
|
|
|
|
*
|
|
|
|
* - native functions
|
2024-04-22 07:00:09 +00:00
|
|
|
*
|
2024-04-19 02:19:59 +00:00
|
|
|
* w/o hw bound check, the overhead (aot_call_function etc) + the native
|
|
|
|
* function itself. as of writing this, the former is about 1000 bytes
|
|
|
|
* on macOS amd64.
|
2024-04-22 07:00:09 +00:00
|
|
|
*
|
2024-04-19 02:19:59 +00:00
|
|
|
* with hw bound check, theoretically, only needs to cover the logic to
|
|
|
|
* set up the jmp_buf stack.
|
|
|
|
*
|
|
|
|
* - aot runtime functions
|
|
|
|
* eg. aot_enlarge_memory.
|
|
|
|
*
|
2024-05-05 23:56:48 +00:00
|
|
|
* - w/o hw bound check, the interpreter loop
|
2024-04-19 02:19:59 +00:00
|
|
|
*
|
2024-04-24 08:18:58 +00:00
|
|
|
* the stack consumption heavily depends on compiler settings,
|
|
|
|
* especially for huge functions like the classic interpreter's
|
|
|
|
* wasm_interp_call_func_bytecode:
|
|
|
|
*
|
|
|
|
* 200 bytes (release build, macOS/amd64)
|
|
|
|
* 2600 bytes (debug build, macOS/amd64)
|
2024-04-22 07:00:09 +00:00
|
|
|
*
|
2024-05-01 07:15:17 +00:00
|
|
|
* - platform-provided functions (eg. libc)
|
|
|
|
*
|
|
|
|
* the following are examples of the stack consumptions observed for
|
|
|
|
* host APIs.
|
|
|
|
*
|
|
|
|
* snprintf: (used by eg. wasm_runtime_set_exception)
|
|
|
|
* - about 1600 bytes on macOS/amd64
|
|
|
|
* - about 2000 bytes on Ubuntu amd64 20.04
|
|
|
|
*
|
|
|
|
* gethostbyname:
|
|
|
|
* - 3KB-6KB on macOS/amd64
|
|
|
|
* - 10KB on Ubuntu amd64 20.04
|
|
|
|
*
|
|
|
|
* getaddrinfo:
|
|
|
|
* - 4KB-17KB on macOS/amd64
|
|
|
|
* - 12KB on Ubuntu amd64 20.04
|
|
|
|
* - 0.3-1.5KB on NuttX/esp32s3
|
2024-04-22 07:00:09 +00:00
|
|
|
*
|
2024-04-19 02:19:59 +00:00
|
|
|
* - stack check wrapper functions generated by the aot compiler
|
|
|
|
* (--stack-bounds-checks=1)
|
|
|
|
*
|
2024-04-22 07:00:09 +00:00
|
|
|
* wamrc issues a warning
|
|
|
|
* "precheck functions themselves consume relatively large amount of stack"
|
|
|
|
* when it detects wrapper functions requiring more than 1KB.
|
|
|
|
*
|
2024-05-01 07:15:17 +00:00
|
|
|
* - the ABI-defined red zone. eg. 128 bytes for SYSV x86-64 ABI.
|
|
|
|
* cf. https://en.wikipedia.org/wiki/Red_zone_(computing)
|
|
|
|
*
|
2024-04-19 02:19:59 +00:00
|
|
|
* Note: on platforms with lazy function binding, don't forget to consider
|
|
|
|
* the symbol resolution overhead on the first call. For example,
|
|
|
|
* on Ubuntu amd64 20.04, it seems to consume about 1500 bytes.
|
2024-04-24 08:18:58 +00:00
|
|
|
* For some reasons, macOS amd64 12.7.4 seems to resolve symbols eagerly.
|
|
|
|
* (Observed with a binary with traditional non-chained fixups.)
|
|
|
|
* The latest macOS seems to apply chained fixups in kernel on page-in time.
|
|
|
|
* (thus it wouldn't consume userland stack.)
|
2024-04-19 02:19:59 +00:00
|
|
|
*/
|
2022-08-12 02:17:11 +00:00
|
|
|
#ifndef WASM_STACK_GUARD_SIZE
|
2022-02-11 03:43:03 +00:00
|
|
|
#if WASM_ENABLE_UVWASI != 0
|
|
|
|
/* UVWASI requires larger native stack */
|
2022-08-12 02:17:11 +00:00
|
|
|
#define WASM_STACK_GUARD_SIZE (4096 * 6)
|
2022-02-11 03:43:03 +00:00
|
|
|
#else
|
2024-04-23 08:51:47 +00:00
|
|
|
/*
|
|
|
|
* Use a larger default for platforms like macOS/Linux.
|
|
|
|
*
|
2024-05-05 23:56:48 +00:00
|
|
|
* For example, the classic interpreter loop which ended up with a trap
|
2024-04-24 08:18:58 +00:00
|
|
|
* (wasm_runtime_set_exception) would consume about 2KB stack on x86-64
|
|
|
|
* macOS. On Ubuntu amd64 20.04, it seems to consume a bit more.
|
2024-04-23 08:51:47 +00:00
|
|
|
*
|
|
|
|
* Although product-mini/platforms/nuttx always overrides
|
|
|
|
* WASM_STACK_GUARD_SIZE, exclude NuttX here just in case.
|
|
|
|
*/
|
|
|
|
#if defined(__APPLE__) || (defined(__unix__) && !defined(__NuttX__))
|
2024-04-24 08:18:58 +00:00
|
|
|
#if BH_DEBUG != 0 /* assumption: BH_DEBUG matches CMAKE_BUILD_TYPE=Debug */
|
2024-04-23 08:51:47 +00:00
|
|
|
#define WASM_STACK_GUARD_SIZE (1024 * 5)
|
|
|
|
#else
|
2024-04-24 08:18:58 +00:00
|
|
|
#define WASM_STACK_GUARD_SIZE (1024 * 3)
|
|
|
|
#endif
|
|
|
|
#else
|
2024-04-23 08:51:47 +00:00
|
|
|
/*
|
|
|
|
* Otherwise, assume very small requirement for now.
|
|
|
|
*
|
|
|
|
* Embedders for very small devices likely fine-tune WASM_STACK_GUARD_SIZE
|
|
|
|
* for their specific applications anyway.
|
|
|
|
*/
|
|
|
|
#define WASM_STACK_GUARD_SIZE 1024
|
|
|
|
#endif
|
2022-02-11 03:43:03 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2020-04-30 09:52:11 +00:00
|
|
|
|
2021-04-19 13:06:56 +00:00
|
|
|
/* Guard page count for stack overflow check with hardware trap */
|
2022-02-11 03:43:03 +00:00
|
|
|
#ifndef STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT
|
2024-04-26 11:37:55 +00:00
|
|
|
#if defined(__APPLE__) && defined(__aarch64__)
|
|
|
|
/* Note: on macOS/iOS arm64, the user page size is 16KB */
|
|
|
|
#define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 1
|
|
|
|
#else
|
2021-04-19 13:06:56 +00:00
|
|
|
#define STACK_OVERFLOW_CHECK_GUARD_PAGE_COUNT 3
|
2022-02-11 03:43:03 +00:00
|
|
|
#endif
|
2024-04-26 11:37:55 +00:00
|
|
|
#endif
|
2021-04-19 13:06:56 +00:00
|
|
|
|
2020-02-22 13:05:09 +00:00
|
|
|
/* Default wasm block address cache size and conflict list size */
|
2020-09-18 10:04:56 +00:00
|
|
|
#ifndef BLOCK_ADDR_CACHE_SIZE
|
2020-02-22 13:05:09 +00:00
|
|
|
#define BLOCK_ADDR_CACHE_SIZE 64
|
2020-09-18 10:04:56 +00:00
|
|
|
#endif
|
2020-02-22 13:05:09 +00:00
|
|
|
#define BLOCK_ADDR_CONFLICT_SIZE 2
|
|
|
|
|
2020-06-15 11:04:04 +00:00
|
|
|
/* Default max thread num per cluster. Can be overwrite by
|
|
|
|
wasm_runtime_set_max_thread_num */
|
|
|
|
#define CLUSTER_MAX_THREAD_NUM 4
|
|
|
|
|
2020-09-24 04:38:54 +00:00
|
|
|
#ifndef WASM_ENABLE_TAIL_CALL
|
|
|
|
#define WASM_ENABLE_TAIL_CALL 0
|
|
|
|
#endif
|
|
|
|
|
2020-11-30 08:03:51 +00:00
|
|
|
#ifndef WASM_ENABLE_CUSTOM_NAME_SECTION
|
|
|
|
#define WASM_ENABLE_CUSTOM_NAME_SECTION 0
|
|
|
|
#endif
|
|
|
|
|
2021-04-15 03:29:20 +00:00
|
|
|
#ifndef WASM_ENABLE_REF_TYPES
|
|
|
|
#define WASM_ENABLE_REF_TYPES 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
#ifndef WASM_ENABLE_GC
|
|
|
|
#define WASM_ENABLE_GC 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_CONST_EXPR_STACK_SIZE
|
|
|
|
#if WASM_ENABLE_GC != 0
|
|
|
|
#define WASM_CONST_EXPR_STACK_SIZE 8
|
|
|
|
#else
|
|
|
|
#define WASM_CONST_EXPR_STACK_SIZE 4
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ENABLE_STRINGREF
|
|
|
|
#define WASM_ENABLE_STRINGREF 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GC_REFTYPE_MAP_SIZE_DEFAULT
|
|
|
|
#define GC_REFTYPE_MAP_SIZE_DEFAULT 64
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GC_RTTOBJ_MAP_SIZE_DEFAULT
|
|
|
|
#define GC_RTTOBJ_MAP_SIZE_DEFAULT 64
|
|
|
|
#endif
|
|
|
|
|
2024-01-31 00:27:17 +00:00
|
|
|
#ifndef WASM_ENABLE_EXCE_HANDLING
|
|
|
|
#define WASM_ENABLE_EXCE_HANDLING 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WASM_ENABLE_TAGS
|
|
|
|
#define WASM_ENABLE_TAGS 0
|
|
|
|
#endif
|
|
|
|
|
2022-09-28 05:09:58 +00:00
|
|
|
#ifndef WASM_ENABLE_SGX_IPFS
|
|
|
|
#define WASM_ENABLE_SGX_IPFS 0
|
|
|
|
#endif
|
|
|
|
|
2022-11-30 08:19:18 +00:00
|
|
|
#ifndef WASM_MEM_ALLOC_WITH_USER_DATA
|
|
|
|
#define WASM_MEM_ALLOC_WITH_USER_DATA 0
|
|
|
|
#endif
|
|
|
|
|
2022-12-05 04:25:26 +00:00
|
|
|
#ifndef WASM_ENABLE_WASM_CACHE
|
|
|
|
#define WASM_ENABLE_WASM_CACHE 0
|
|
|
|
#endif
|
|
|
|
|
2023-06-05 01:17:39 +00:00
|
|
|
#ifndef WASM_ENABLE_STATIC_PGO
|
|
|
|
#define WASM_ENABLE_STATIC_PGO 0
|
|
|
|
#endif
|
|
|
|
|
2023-06-13 02:26:25 +00:00
|
|
|
/* Disable writing linear memory base address to GS segment register,
|
|
|
|
by default only in linux x86-64, linear memory base addr is written
|
|
|
|
to GS segment register before calling wasm/aot function. */
|
|
|
|
#ifndef WASM_DISABLE_WRITE_GS_BASE
|
|
|
|
#define WASM_DISABLE_WRITE_GS_BASE 0
|
|
|
|
#endif
|
|
|
|
|
2023-07-04 08:21:30 +00:00
|
|
|
/* Configurable bounds checks */
|
|
|
|
#ifndef WASM_CONFIGURABLE_BOUNDS_CHECKS
|
|
|
|
#define WASM_CONFIGURABLE_BOUNDS_CHECKS 0
|
|
|
|
#endif
|
|
|
|
|
2023-07-20 23:54:13 +00:00
|
|
|
/* Some chip cannot support external ram with rwx attr at the same time,
|
|
|
|
it has to map it into 2 spaces of idbus and dbus, code in dbus can be
|
|
|
|
read/written and read/executed in ibus. so there are 2 steps to execute
|
2023-11-20 02:25:00 +00:00
|
|
|
the code, first, copy & do relocation in dbus space, and second execute
|
2023-07-20 23:54:13 +00:00
|
|
|
it in ibus space, since in the 2 spaces the contents are the same,
|
|
|
|
so we call it bus mirror.
|
|
|
|
*/
|
|
|
|
#ifndef WASM_MEM_DUAL_BUS_MIRROR
|
|
|
|
#define WASM_MEM_DUAL_BUS_MIRROR 0
|
|
|
|
#endif
|
|
|
|
|
2023-09-07 06:54:11 +00:00
|
|
|
/* The max number of module instance contexts. */
|
|
|
|
#ifndef WASM_MAX_INSTANCE_CONTEXTS
|
|
|
|
#define WASM_MAX_INSTANCE_CONTEXTS 8
|
|
|
|
#endif
|
|
|
|
|
2024-01-02 07:58:17 +00:00
|
|
|
/* linux perf support */
|
|
|
|
#ifndef WASM_ENABLE_LINUX_PERF
|
|
|
|
#define WASM_ENABLE_LINUX_PERF 0
|
|
|
|
#endif
|
|
|
|
|
2024-01-10 08:44:09 +00:00
|
|
|
/* Support registering quick AOT/JIT function entries of some func types
|
2024-04-02 07:22:07 +00:00
|
|
|
to speed up the calling process of invoking the AOT/JIT functions of
|
2024-01-10 08:44:09 +00:00
|
|
|
these types from the host embedder */
|
|
|
|
#ifndef WASM_ENABLE_QUICK_AOT_ENTRY
|
|
|
|
#define WASM_ENABLE_QUICK_AOT_ENTRY 1
|
|
|
|
#endif
|
|
|
|
|
2024-04-01 03:26:05 +00:00
|
|
|
/* Support AOT intrinsic functions which can be called from the AOT code
|
|
|
|
when `--disable-llvm-intrinsics` flag or
|
|
|
|
`--enable-builtin-intrinsics=<intr1,intr2,...>` is used by wamrc to
|
|
|
|
generate the AOT file */
|
|
|
|
#ifndef WASM_ENABLE_AOT_INTRINSICS
|
|
|
|
#define WASM_ENABLE_AOT_INTRINSICS 1
|
|
|
|
#endif
|
|
|
|
|
2024-04-02 07:22:07 +00:00
|
|
|
/* Disable memory64 by default */
|
|
|
|
#ifndef WASM_ENABLE_MEMORY64
|
|
|
|
#define WASM_ENABLE_MEMORY64 0
|
|
|
|
#endif
|
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
#ifndef WASM_TABLE_MAX_SIZE
|
|
|
|
#define WASM_TABLE_MAX_SIZE 1024
|
|
|
|
#endif
|
|
|
|
|
2024-04-18 11:40:57 +00:00
|
|
|
#ifndef WASM_MEM_ALLOC_WITH_USAGE
|
|
|
|
#define WASM_MEM_ALLOC_WITH_USAGE 0
|
|
|
|
#endif
|
|
|
|
|
2024-05-30 06:55:21 +00:00
|
|
|
#ifndef WASM_ENABLE_FUZZ_TEST
|
|
|
|
#define WASM_ENABLE_FUZZ_TEST 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if WASM_ENABLE_FUZZ_TEST != 0
|
2024-06-13 08:06:36 +00:00
|
|
|
#ifndef WASM_MEM_ALLOC_MAX_SIZE
|
2024-05-30 06:55:21 +00:00
|
|
|
/* In oss-fuzz, the maximum RAM is ~2.5G */
|
|
|
|
#define WASM_MEM_ALLOC_MAX_SIZE (2U * 1024 * 1024 * 1024)
|
|
|
|
#endif
|
2024-06-13 08:06:36 +00:00
|
|
|
#endif /* WASM_ENABLE_FUZZ_TEST != 0 */
|
2024-05-30 06:55:21 +00:00
|
|
|
|
2019-11-01 05:38:45 +00:00
|
|
|
#endif /* end of _CONFIG_H_ */
|