Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backends/arm/scripts/build_executorch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LICENSE file in the root directory of this source tree.

# Optional parameter:
# --build_type= "Release" | "Debug" | "RelWithDebInfo" | "UndefinedSanitizer"
# --build_type= "Release" | "Debug" | "RelWithDebInfo" | "UndefinedSanitizer" | "AddressSanitizer"
# --etdump build with devtools-etdump support

set -eu
Expand All @@ -28,7 +28,7 @@ help() {
echo "Usage: $(basename $0) [options]"
echo "Options:"
echo " --et_build_root=<FOLDER> Build output root folder to use, defaults to ${et_build_root}"
echo " --build_type=<TYPE> Build with Release, Debug, RelWithDebInfo or UndefinedSanitizer, default is ${build_type}"
echo " --build_type=<TYPE> Build with Release, Debug, RelWithDebInfo, UndefinedSanitizer or AddressSanitizer, default is ${build_type}"
echo " --devtools Build Devtools libs"
echo " --etdump Adds Devtools etdump support to track timing, etdump area will be base64 encoded in the log"
echo " --toolchain=<TOOLCHAIN> Toolchain can be specified (e.g. bare metal as arm-none-eabi-gcc or zephyr as arm-zephyr-eabi-gcc Default: ${toolchain}"
Expand Down
11 changes: 11 additions & 0 deletions backends/arm/test/test_arm_baremetal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,15 @@ test_undefinedbehavior_sanitizer() {
echo "${TEST_SUITE_NAME}: PASS"
}

test_address_sanitizer() {
echo "${TEST_SUITE_NAME}: Test ethos-u executor_runner with ASAN"

mkdir -p arm_test/test_run
# Ethos-U85
echo "${TEST_SUITE_NAME}: Test target Ethos-U85"
examples/arm/run.sh --et_build_root=arm_test/test_run --target=ethos-u85-128 --model_name=examples/arm/example_modules/add.py --build_type=AddressSanitizer
echo "${TEST_SUITE_NAME}: PASS"
}


${TEST_SUITE}
21 changes: 21 additions & 0 deletions examples/arm/asan/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

add_library(executorch_asan STATIC asan_runtime.c)

target_compile_features(executorch_asan PRIVATE c_std_11)

target_compile_options(
executorch_asan PRIVATE -fno-sanitize=address -fno-sanitize=kernel-address
-fno-sanitize=undefined
)

set_target_properties(executorch_asan PROPERTIES OUTPUT_NAME "asan")

install(
TARGETS executorch_asan
EXPORT ExecuTorchTargets
ARCHIVE DESTINATION lib
)
Loading