Add control for the native stack check with hardware trap (#1682)
Add a new options to control the native stack hw bound check feature: - Besides the original option `cmake -DWAMR_DISABLE_HW_BOUND_CHECK=1/0`, add a new option `cmake -DWAMR_DISABLE_STACK_HW_BOUND_CHECK=1/0` - When the linear memory hw bound check is disabled, the stack hw bound check will be disabled automatically, no matter what the input option is - When the linear memory hw bound check is enabled, the stack hw bound check is enabled/disabled according to the value of input option - Besides the original option `--bounds-checks=1/0`, add a new option `--stack-bounds-checks=1/0` for wamrc Refer to: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1677
This commit is contained in:
@ -92,6 +92,7 @@ else:
|
||||
|
||||
if GetDepend(['WAMR_DISABLE_HW_BOUND_CHECK']):
|
||||
CPPDEFINES += ['WASM_DISABLE_HW_BOUND_CHECK=1']
|
||||
CPPDEFINES += ['WASM_DISABLE_STACK_HW_BOUND_CHECK=1']
|
||||
print("[WAMR] Hardware boundary check disabled")
|
||||
|
||||
if GetDepend(['WAMR_BUILD_SIMD']):
|
||||
|
||||
@ -205,9 +205,16 @@ else ()
|
||||
endif ()
|
||||
if (WAMR_DISABLE_HW_BOUND_CHECK EQUAL 1)
|
||||
add_definitions (-DWASM_DISABLE_HW_BOUND_CHECK=1)
|
||||
add_definitions (-DWASM_DISABLE_STACK_HW_BOUND_CHECK=1)
|
||||
message (" Hardware boundary check disabled")
|
||||
else ()
|
||||
add_definitions (-DWASM_DISABLE_HW_BOUND_CHECK=0)
|
||||
if (WAMR_DISABLE_STACK_HW_BOUND_CHECK EQUAL 1)
|
||||
add_definitions (-DWASM_DISABLE_STACK_HW_BOUND_CHECK=1)
|
||||
message (" Hardware boundary check for native stack disabled")
|
||||
else ()
|
||||
add_definitions (-DWASM_DISABLE_STACK_HW_BOUND_CHECK=0)
|
||||
endif ()
|
||||
endif ()
|
||||
if (WAMR_BUILD_SIMD EQUAL 1)
|
||||
if (NOT WAMR_BUILD_TARGET MATCHES "RISCV64.*")
|
||||
|
||||
Reference in New Issue
Block a user