2020-09-15 13:38:44 +02:00
|
|
|
#
|
|
|
|
# For a description of the syntax of this configuration file,
|
|
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
|
|
#
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR
|
|
|
|
tristate "Webassembly Micro Runtime"
|
|
|
|
default n
|
|
|
|
|
|
|
|
if INTERPRETERS_WAMR
|
|
|
|
|
2020-09-29 08:21:21 +02:00
|
|
|
config INTERPRETERS_WAMR_VERSION
|
|
|
|
string "WAMR Version"
|
2022-06-01 08:24:54 +02:00
|
|
|
default "WAMR-04-15-2021"
|
2020-09-29 08:21:21 +02:00
|
|
|
---help---
|
2023-08-11 13:33:13 +02:00
|
|
|
Version WAMR-09-29-2020 and later (include main) supported.
|
2020-09-29 08:21:21 +02:00
|
|
|
|
2021-11-09 07:58:42 +01:00
|
|
|
config INTERPRETERS_IWASM_TASK
|
|
|
|
bool "Webassembly iwasm task"
|
|
|
|
default y
|
|
|
|
|
|
|
|
if INTERPRETERS_IWASM_TASK
|
|
|
|
|
2020-09-15 13:38:44 +02:00
|
|
|
config INTERPRETERS_WAMR_PRIORITY
|
|
|
|
int "Webassembly Micro Runtime priority"
|
|
|
|
default 100
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_STACKSIZE
|
|
|
|
int "Webassembly Micro Runtime stack size"
|
|
|
|
default 8192
|
|
|
|
|
2023-08-11 13:33:13 +02:00
|
|
|
endif # INTERPRETERS_IWASM_TASK
|
2021-11-09 07:58:42 +01:00
|
|
|
|
2020-09-15 13:38:44 +02:00
|
|
|
config INTERPRETERS_WAMR_AOT
|
|
|
|
bool "Enable AOT"
|
2022-05-25 05:46:47 +02:00
|
|
|
select ARCH_USE_TEXT_HEAP if ARCH_HAVE_TEXT_HEAP
|
2020-09-15 13:38:44 +02:00
|
|
|
default n
|
|
|
|
|
2024-01-17 07:44:27 +01:00
|
|
|
config INTERPRETERS_WAMR_AOT_QUICK_ENTRY
|
|
|
|
bool "Enable AOT quick entry"
|
|
|
|
default n
|
|
|
|
depends on INTERPRETERS_WAMR_AOT
|
|
|
|
---help---
|
|
|
|
Note: This option only works with WAMR 1.3.1 or later.
|
|
|
|
Enable AOT quick entry to improve performance for call
|
|
|
|
AOTed function from host side in some cases with simple
|
|
|
|
signature.
|
|
|
|
Enable this option will increase the size of runtime, ~8KB.
|
|
|
|
|
2021-11-09 07:58:42 +01:00
|
|
|
choice
|
|
|
|
prompt "Enable interpreter"
|
|
|
|
default INTERPRETERS_NONE
|
|
|
|
|
2020-09-15 13:38:44 +02:00
|
|
|
config INTERPRETERS_WAMR_FAST
|
|
|
|
bool "Enable fast interpreter"
|
2021-11-09 07:58:42 +01:00
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_CLASSIC
|
|
|
|
bool "Enable classic interpreter"
|
|
|
|
|
|
|
|
config INTERPRETERS_NONE
|
|
|
|
bool "Disable interpreter"
|
|
|
|
|
2023-08-11 13:33:13 +02:00
|
|
|
endchoice # Enable interpreter
|
2020-09-15 13:38:44 +02:00
|
|
|
|
interpreters/wamr: add INTERPRETERS_WAMR_DEBUG_AOT option
At least it's sometimes useful for nuttx sim.
eg. (modified a bit to avoid github autolinks)
```
spacetanuki% lldb ./nuttx
(lldb) target create "./nuttx"
Current executable set to '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64).
(lldb) settings set plugin.jit-loader.gdb.enable on
(lldb) b foo
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 37011 launched: '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64)
NuttShell (NSH) NuttX-10.4.0
nsh> mount -t hostfs -o fs=/tmp/wasm /mnt
nsh> iwasm /mnt/test.aot
1 location added to breakpoint 1
Process 37011 stopped
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
2
3 __attribute__((noinline))
4 void foo()
-> 5 {
6 printf("hello from %s\n", __func__);
7 }
8
Target 0: (nuttx) stopped.
(lldb) bt
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
* frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
frame #_1: 0x000000010580077a JIT(0x1058002d4)`bar(exenv=0x0000000101284280) at test.c:12:2
frame #_2: 0x000000010580086a JIT(0x1058002d4)`baz(exenv=0x0000000101284280) at test.c:19:2
frame #_3: 0x0000000105800972 JIT(0x1058002d4)`__main_argc_argv(exenv=<unavailable>, argc=<unavailable>, argv=<unavailable>) at test.c:26:3
frame #_4: 0x00000001058061aa JIT(0x1058002d4)`aot_func#14 + 278
frame #_5: 0x00000001058005cd JIT(0x1058002d4)`aot_func#2 + 153
frame #_6: 0x00000001000e250f nuttx`push_args_end at invokeNative_em64.s:61
frame #_7: 0x000000010013851a nuttx`wasm_runtime_invoke_native(exec_env=0x0000000101284280, func_ptr=0x0000000105800534, func_type=0x00000001011e2e20, signature=0x0000000000000000, attachment=0x0000000000000000, argv=0x0000000000000000, argc=0, argv_ret=0x0000000000000000) at wasm_runtime_common.c:4631:9
frame #_8: 0x00000001000da1ae nuttx`aot_call_function(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at aot_runtime.c:1654:15
frame #_9: 0x0000000100134b56 nuttx`wasm_runtime_call_wasm(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at wasm_runtime_common.c:2048:15
frame #_10: 0x00000001000fbad4 nuttx`execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:112:15
frame #_11: 0x00000001000fb995 nuttx`wasm_application_execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:238:11
frame #_12: 0x00000001000ea1a0 nuttx`app_instance_main(module_inst=0x00000001011e3890) at main.c:113:5
frame #_13: 0x00000001000e9d60 nuttx`iwasm_main(argc=1, argv=0x00000001011b63f8) at main.c:947:21
frame #_14: 0x0000000100023275 nuttx`nxtask_startup(entrypt=(nuttx`iwasm_main at main.c:545), argc=2, argv=0x00000001011b63f0) at task_startup.c:70:8
frame #_15: 0x000000010001065a nuttx`nxtask_start at task_start.c:134:7
frame #_16: 0x000000010003a15f nuttx`pre_start at sim_initialstate.c:52:3
(lldb)
```
2023-12-25 11:35:12 +01:00
|
|
|
config INTERPRETERS_WAMR_DEBUG_AOT
|
|
|
|
bool "Enable debugger support for AOT modules"
|
|
|
|
default n
|
|
|
|
depends on INTERPRETERS_WAMR_AOT
|
|
|
|
|
2022-08-29 06:25:40 +02:00
|
|
|
config INTERPRETERS_WAMR_DEBUG_INTERP
|
|
|
|
bool "Enable debugger support in the interpreter"
|
|
|
|
default n
|
|
|
|
# Note: It only works with the classic interpreter
|
|
|
|
depends on INTERPRETERS_WAMR_CLASSIC
|
|
|
|
# Note: It uses thread-manager internally
|
|
|
|
depends on INTERPRETERS_WAMR_THREAD_MGR
|
|
|
|
# Note: It sets up the listening socket with SO_LINGER
|
|
|
|
depends on NET_TCP
|
|
|
|
depends on NET_SOLINGER
|
|
|
|
|
2020-09-15 13:38:44 +02:00
|
|
|
config INTERPRETERS_WAMR_LOG
|
|
|
|
bool "Enable log"
|
|
|
|
default n
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_LIBC_BUILTIN
|
|
|
|
bool "Enable built-in libc"
|
|
|
|
default n
|
|
|
|
|
2023-09-15 10:52:23 +02:00
|
|
|
config INTERPRETERS_WAMR_BUILD_MODULES_FOR_NUTTX
|
|
|
|
bool "Build WASM modules for NuttX system interface (Experimental)"
|
|
|
|
default n
|
|
|
|
depends on INTERPRETERS_WAMR_LIBC_BUILTIN
|
|
|
|
|
2022-04-27 06:23:05 +02:00
|
|
|
config INTERPRETERS_WAMR_LIBC_WASI
|
|
|
|
bool "Enable WASI libc"
|
2023-03-03 15:42:41 +01:00
|
|
|
select PSEUDOFS_SOFTLINKS
|
2022-04-27 06:23:05 +02:00
|
|
|
default n
|
2022-05-24 03:08:50 +02:00
|
|
|
---help---
|
2023-08-11 13:33:13 +02:00
|
|
|
Note: As of writing this, this works only with main branch of
|
|
|
|
wasm-micro-runtime.
|
|
|
|
I.e. INTERPRETERS_WAMR_VERSION="main"
|
2022-05-24 03:08:50 +02:00
|
|
|
|
2023-08-11 13:33:13 +02:00
|
|
|
Note: As of writing this, most of the filesystem operations are
|
|
|
|
not implemented. (Mainly because of lack of openat family of
|
|
|
|
the API in NuttX.)
|
2022-04-27 06:23:05 +02:00
|
|
|
|
2020-09-17 14:09:24 +02:00
|
|
|
config INTERPRETERS_WAMR_MULTI_MODULE
|
2022-01-05 16:34:05 +01:00
|
|
|
bool "Enable multi module support"
|
2020-09-17 14:09:24 +02:00
|
|
|
default n
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_MINILOADER
|
|
|
|
bool "Enable mini-loader"
|
|
|
|
default n
|
|
|
|
---help---
|
2023-08-11 13:33:13 +02:00
|
|
|
Mini-loader don't check the integrity of wasm module
|
2020-09-17 14:09:24 +02:00
|
|
|
|
2022-11-16 08:56:20 +01:00
|
|
|
config INTERPRETERS_WAMR_REF_TYPES
|
|
|
|
bool "Enable reference types support"
|
|
|
|
default n
|
|
|
|
|
2022-11-16 09:02:26 +01:00
|
|
|
config INTERPRETERS_WAMR_ENABLE_SPEC_TEST
|
|
|
|
bool "Enable spectest support"
|
|
|
|
default n
|
|
|
|
|
2024-01-04 08:20:11 +01:00
|
|
|
config INTERPRETERS_WAMR_TAIL_CALL
|
|
|
|
bool "Enable tail call support"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
This only available for WAMR 1.3.0 later (don't include 1.3.0)
|
|
|
|
|
2022-08-10 06:03:39 +02:00
|
|
|
config INTERPRETERS_WAMR_STACK_GUARD_SIZE
|
|
|
|
int "Custom stack guard size"
|
2023-12-25 08:14:15 +01:00
|
|
|
default 1024
|
2022-08-10 06:03:39 +02:00
|
|
|
---help---
|
2023-12-25 08:14:15 +01:00
|
|
|
Reserve some space in stack as guard to detect stack overflow.
|
|
|
|
|
|
|
|
Please consider this extra stack consumption when deciding the stack
|
|
|
|
size of your NuttX task on which you run WAMR.
|
|
|
|
|
|
|
|
The default value here (1024) was chosen to match the default value on
|
|
|
|
the majority of other platforms, including Linux. It also matches
|
|
|
|
the expections in the WAMR AoT compiler.
|
|
|
|
On the other hand, it might be a bit larger than what's strictly
|
|
|
|
necessary, especially for typical NuttX targets.
|
2022-08-10 06:03:39 +02:00
|
|
|
|
2020-09-17 14:09:24 +02:00
|
|
|
config INTERPRETERS_WAMR_THREAD_MGR
|
|
|
|
bool "Enable thread manager"
|
|
|
|
default n
|
|
|
|
|
2023-07-05 13:36:46 +02:00
|
|
|
config INTERPRETERS_WAMR_LIB_WASI_THREADS
|
|
|
|
bool "Enable wasi-threads"
|
|
|
|
default n
|
|
|
|
---help---
|
2023-08-11 13:33:13 +02:00
|
|
|
See https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/pthread_impls.md
|
2023-07-05 13:36:46 +02:00
|
|
|
|
2020-09-17 14:09:24 +02:00
|
|
|
config INTERPRETERS_WAMR_LIB_PTHREAD
|
2023-07-05 13:36:46 +02:00
|
|
|
bool "Enable lib pthread (legacy)"
|
2020-09-17 14:09:24 +02:00
|
|
|
default n
|
2023-07-05 13:36:46 +02:00
|
|
|
---help---
|
2023-08-11 13:33:13 +02:00
|
|
|
See https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/pthread_impls.md
|
2020-09-17 14:09:24 +02:00
|
|
|
|
2022-08-09 10:18:30 +02:00
|
|
|
config INTERPRETERS_WAMR_LIB_PTHREAD_SEMAPHORE
|
|
|
|
bool "Enable semaphore"
|
|
|
|
depends on INTERPRETERS_WAMR_LIB_PTHREAD
|
|
|
|
default n
|
|
|
|
|
2021-11-09 07:58:42 +01:00
|
|
|
config INTERPRETERS_WAMR_SHARED_MEMORY
|
|
|
|
bool "Enable shared memory"
|
|
|
|
default n
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_BULK_MEMORY
|
|
|
|
bool "Enable bluk memory"
|
|
|
|
default n
|
|
|
|
|
2022-05-20 07:35:38 +02:00
|
|
|
config INTERPRETERS_WAMR_PERF_PROFILING
|
|
|
|
bool "Enable performance profiling"
|
|
|
|
default n
|
|
|
|
|
2021-11-09 07:58:42 +01:00
|
|
|
config INTERPRETERS_WAMR_MEMORY_PROFILING
|
|
|
|
bool "Enable memory profiling"
|
|
|
|
default n
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_MEMORY_TRACING
|
|
|
|
bool "Enable memory tracing"
|
|
|
|
default n
|
|
|
|
|
2023-03-21 02:50:02 +01:00
|
|
|
config INTERPRETERS_WAMR_DUMP_CALL_STACK
|
|
|
|
bool "Enable dump call stack (on exception)"
|
|
|
|
default n
|
|
|
|
|
2020-09-17 14:09:24 +02:00
|
|
|
config INTERPRETERS_WAMR_DISABLE_HW_BOUND_CHECK
|
|
|
|
bool "Disable hardware bound check"
|
|
|
|
default n
|
|
|
|
|
2023-11-20 04:11:32 +01:00
|
|
|
config INTERPRETERS_WAMR_LOAD_CUSTOM_SECTIONS
|
|
|
|
bool "Enable load custom section support"
|
|
|
|
default n
|
|
|
|
|
2020-09-27 14:25:47 +02:00
|
|
|
config INTERPRETERS_WAMR_CUSTOM_NAME_SECTIONS
|
|
|
|
bool "Enable custom name section support"
|
|
|
|
default n
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_GLOBAL_HEAP_POOL
|
|
|
|
bool "Enable global heap pool"
|
|
|
|
default n
|
|
|
|
|
|
|
|
if INTERPRETERS_WAMR_GLOBAL_HEAP_POOL
|
|
|
|
|
|
|
|
config INTERPRETERS_WAMR_GLOBAL_HEAP_POOL_SIZE
|
|
|
|
int "Global heap pool size (in KB)"
|
|
|
|
default 128
|
|
|
|
|
2023-08-11 13:33:13 +02:00
|
|
|
endif # INTERPRETERS_WAMR_GLOBAL_HEAP_POOL
|
2020-09-27 14:25:47 +02:00
|
|
|
|
2023-07-04 11:09:42 +02:00
|
|
|
config INTERPRETERS_WAMR_CONFIGUABLE_BOUNDS_CHECKS
|
|
|
|
bool "Configuable bounds checks"
|
|
|
|
default n
|
|
|
|
---help---
|
|
|
|
Bounds checks enabled by default. With this option, you can
|
|
|
|
disable bounds checks passing --disable-bounds-checks to
|
|
|
|
iwasm.
|
|
|
|
|
2023-08-11 13:33:13 +02:00
|
|
|
endif # INTERPRETERS_WAMR
|