|
|
@@ -27,8 +27,8 @@ The script `runtime_lib.cmake` defines a number of variables for configuring the
|
|
|
- **WAMR_BUILD_TARGET**: set the target CPU architecture. Current supported targets are: X86_64, X86_32, AARCH64, ARM, THUMB, XTENSA, ARC, RISCV32, RISCV64 and MIPS.
|
|
|
- For ARM and THUMB, the format is \<arch>\[\<sub-arch>]\[_VFP], where \<sub-arch> is the ARM sub-architecture and the "_VFP" suffix means using VFP coprocessor registers s0-s15 (d0-d7) for passing arguments or returning results in standard procedure-call. Both \<sub-arch> and "_VFP" are optional, e.g. ARMV7, ARMV7_VFP, THUMBV7, THUMBV7_VFP and so on.
|
|
|
- For AARCH64, the format is\<arch>[\<sub-arch>], VFP is enabled by default. \<sub-arch> is optional, e.g. AARCH64, AARCH64V8, AARCH64V8.1 and so on.
|
|
|
- - For RISCV64, the format is \<arch\>[_abi], where "_abi" is optional, currently the supported formats are RISCV64, RISCV64_LP64D and RISCV64_LP64: RISCV64 and RISCV64_LP64D are identical, using [LP64D](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#-named-abis) as abi (LP64 with hardware floating-point calling convention for FLEN=64). And RISCV64_LP64 uses [LP64](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#-named-abis) as abi (Integer calling-convention only, and hardware floating-point calling convention is not used).
|
|
|
- - For RISCV32, the format is \<arch\>[_abi], where "_abi" is optional, currently the supported formats are RISCV32, RISCV32_ILP32D and RISCV32_ILP32: RISCV32 and RISCV32_ILP32D are identical, using [ILP32D](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#-named-abis) as abi (ILP32 with hardware floating-point calling convention for FLEN=64). And RISCV32_ILP32 uses [ILP32](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#-named-abis) as abi (Integer calling-convention only, and hardware floating-point calling convention is not used).
|
|
|
+ - For RISCV64, the format is \<arch\>[_abi], where "_abi" is optional, currently the supported formats are RISCV64, RISCV64_LP64D and RISCV64_LP64: RISCV64 and RISCV64_LP64D are identical, using [LP64D](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#named-abis) as abi (LP64 with hardware floating-point calling convention for FLEN=64). And RISCV64_LP64 uses [LP64](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#named-abis) as abi (Integer calling-convention only, and hardware floating-point calling convention is not used).
|
|
|
+ - For RISCV32, the format is \<arch\>[_abi], where "_abi" is optional, currently the supported formats are RISCV32, RISCV32_ILP32D and RISCV32_ILP32: RISCV32 and RISCV32_ILP32D are identical, using [ILP32D](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#named-abis) as abi (ILP32 with hardware floating-point calling convention for FLEN=64). And RISCV32_ILP32 uses [ILP32](https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#named-abis) as abi (Integer calling-convention only, and hardware floating-point calling convention is not used).
|
|
|
|
|
|
```bash
|
|
|
cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
|
|
|
@@ -120,6 +120,14 @@ cmake -DWAMR_BUILD_PLATFORM=linux -DWAMR_BUILD_TARGET=ARM
|
|
|
|
|
|
- **WAMR_BUILD_CUSTOM_NAME_SECTION**=1/0, load the function name from custom name section, default to disable if not set
|
|
|
|
|
|
+#### **Enable AOT stack frame feature**
|
|
|
+- **WAMR_BUILD_AOT_STACK_FRAME**=1/0, default to disable if not set
|
|
|
+> Note: if it is enabled, the AOT stack frames (like stack frame of classic interpreter but only necessary data is committed) will be created for AOT mode in function calls. And please add `--enable-dump-call-stack` option to wamrc during compiling AOT module.
|
|
|
+
|
|
|
+#### **ENABLE JIT stack frame feature**
|
|
|
+- **WAMR_BUILD_JIT_STACK_FRAME**=1/0, default to disable if not set
|
|
|
+> Note: if it is enabled, the JIT stack frames (like stack frame of classic interpreter but only necessary data is committed) will be created for JIT mode in function calls.
|
|
|
+
|
|
|
#### **Enable dump call stack feature**
|
|
|
- **WAMR_BUILD_DUMP_CALL_STACK**=1/0, default to disable if not set
|
|
|
|
|
|
@@ -156,7 +164,8 @@ Currently we only profile the memory consumption of module, module_instance and
|
|
|
- **WAMR_APP_THREAD_STACK_SIZE_MAX**=n, default to 8 MB (8388608) if not set
|
|
|
> Note: the AOT boundary check with hardware trap mechanism might consume large stack since the OS may lazily grow the stack mapping as a guard page is hit, we may use this configuration to reduce the total stack usage, e.g. -DWAMR_APP_THREAD_STACK_SIZE_MAX=131072 (128 KB).
|
|
|
|
|
|
-#### **WAMR_BH_VPRINTF**=<vprintf_callback>, default to disable if not set
|
|
|
+#### **Set vprintf callback**
|
|
|
+- **WAMR_BH_VPRINTF**=<vprintf_callback>, default to disable if not set
|
|
|
> Note: if the vprintf_callback function is provided by developer, the os_printf() and os_vprintf() in Linux, Darwin, Windows and VxWorks platforms, besides WASI Libc output will call the callback function instead of libc vprintf() function to redirect the stdout output. For example, developer can define the callback function like below outside runtime lib:
|
|
|
>
|
|
|
> ```C
|
|
|
@@ -199,17 +208,32 @@ Currently we only profile the memory consumption of module, module_instance and
|
|
|
|
|
|
> For AoT file, must use `--emit-custom-sections` to specify which sections need to be emitted into AoT file, otherwise all custom sections (except custom name section) will be ignored.
|
|
|
|
|
|
-### **Stack guard size**
|
|
|
+#### **Stack guard size**
|
|
|
- **WAMR_BUILD_STACK_GUARD_SIZE**=n, default to N/A if not set.
|
|
|
> Note: By default, the stack guard size is 1K (1024) or 24K (if uvwasi enabled).
|
|
|
|
|
|
-### **Disable the writing linear memory base address to x86 GS segment register
|
|
|
+#### **Disable writing the linear memory base address to x86 GS segment register**
|
|
|
- **WAMR_DISABLE_WRITE_GS_BASE**=1/0, default to enable if not set and supported by platform
|
|
|
> Note: by default only platform [linux x86-64](https://github.com/bytecodealliance/wasm-micro-runtime/blob/5fb5119239220b0803e7045ca49b0a29fe65e70e/core/shared/platform/linux/platform_internal.h#L67) will enable this feature, for 32-bit platforms it's automatically disabled even when the flag is set to 0. In linux x86-64, writing the linear memory base address to x86 GS segment register may be used to speedup the linear memory access for LLVM AOT/JIT, when `--enable-segue=[<flags>]` option is added for `wamrc` or `iwasm`.
|
|
|
|
|
|
-### **Enable running PGO(Profile-Guided Optimization) instrumented AOT file**
|
|
|
+#### **Enable running PGO(Profile-Guided Optimization) instrumented AOT file**
|
|
|
- **WAMR_BUILD_STATIC_PGO**=1/0, default to disable if not set
|
|
|
|
|
|
+#### **Configurale memory access boundary check**
|
|
|
+- **WAMR_CONFIGUABLE_BOUNDS_CHECKS**=1/0, default to disable if not set
|
|
|
+> Note: If it is enabled, allow to run `iwasm --disable-bounds-checks` to disable the memory access boundary checks for interpreter mode.
|
|
|
+
|
|
|
+#### **Module instance context APIs**
|
|
|
+- **WAMR_BUILD_MODULE_INST_CONTEXT**=1/0, default to disable if not set
|
|
|
+> Note: If it is enabled, allow to set one or more contexts created by embedder for a module instance, the below APIs are provided:
|
|
|
+```C
|
|
|
+ wasm_runtime_create_context_key
|
|
|
+ wasm_runtime_destroy_context_key
|
|
|
+ wasm_runtime_set_context
|
|
|
+ wasm_runtime_set_context_spread
|
|
|
+ wasm_runtime_get_context
|
|
|
+```
|
|
|
+
|
|
|
**Combination of configurations:**
|
|
|
|
|
|
We can combine the configurations. For example, if we want to disable interpreter, enable AOT and WASI, we can run command:
|