From e328b2987b49997a572842040aa146fd62c5622b Mon Sep 17 00:00:00 2001 From: Zingo Andersen Date: Sat, 8 Feb 2025 15:44:24 +0100 Subject: [PATCH] Arm backend: Fix Corstone-300 linker script patch Fix path of patch code of the corstone-300 linker script and auto create the ethos_u folder from from cmake Signed-off-by: Zingo Andersen Change-Id: I2737e126b84f7740251916994e063834da764f67 --- backends/arm/scripts/utils.sh | 6 +++--- examples/arm/executor_runner/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backends/arm/scripts/utils.sh b/backends/arm/scripts/utils.sh index cb606021dba..e3ed04ffa22 100644 --- a/backends/arm/scripts/utils.sh +++ b/backends/arm/scripts/utils.sh @@ -30,12 +30,12 @@ function verify_md5() { function patch_repo() { # Patch git repo found in $repo_dir, starting from patch $base_rev and applying patches found in $patch_dir/$name. - + # Arg 1: Directory of repo to patch # Arg 2: Rev to start patching at # Arg 3: Directory 'setup-dir' containing patches in 'setup-dir/$name' # Exits with return code 1 if the number of arguments is incorrect. - # Does not do any error handling if the base_rev or patch_dir is not found etc. + # Does not do any error handling if the base_rev or patch_dir is not found etc. [[ $# -ne 3 ]] \ && { echo "[${FUNCNAME[0]}] Invalid number of args, expecting 3, but got $#"; exit 1; } @@ -45,7 +45,7 @@ function patch_repo() { local name="$(basename $repo_dir)" local patch_dir="${3}/$name" - echo -e "[${FUNCNAME[0]}] Patching ${name}..." + echo -e "[${FUNCNAME[0]}] Patching ${name} repo_dir:${repo_dir} base_rev:${base_rev} patch_dir:${patch_dir}" cd $repo_dir git fetch git reset --hard ${base_rev} diff --git a/examples/arm/executor_runner/CMakeLists.txt b/examples/arm/executor_runner/CMakeLists.txt index 5621576fd70..54da4659a02 100644 --- a/examples/arm/executor_runner/CMakeLists.txt +++ b/examples/arm/executor_runner/CMakeLists.txt @@ -45,6 +45,8 @@ set(PYTHON_EXECUTABLE ) # Download ethos_u dependency if needed. +file(MAKE_DIRECTORY ${ETHOS_SDK_PATH}/../ethos_u) + include(FetchContent) set(ethos_u_base_rev "24.08") FetchContent_Declare( @@ -69,7 +71,7 @@ endif() # Always patch the core_platform repo since this is fast enough. set(core_platform_base_rev "b728c774158248ba2cad8e78a515809e1eb9b77f") -set(patch_dir "examples/arm/ethos-u-setup") +set(patch_dir "${ET_DIR_PATH}/examples/arm/ethos-u-setup") execute_process(COMMAND bash -c "pwd && source backends/arm/scripts/utils.sh && patch_repo ${ETHOS_SDK_PATH}/core_platform ${core_platform_base_rev} ${patch_dir}" WORKING_DIRECTORY ${ET_DIR_PATH} COMMAND_ECHO STDOUT