@@ -37,6 +37,7 @@ memory_mode=""
3737et_build_root=" ${et_root_dir} /arm_test" 
3838ethos_u_scratch_dir=${script_dir} /ethos-u-scratch
3939scratch_dir_set=false
40+ toolchain=arm-non-eabi-gcc
4041
4142function  help()  {
4243    echo  " Usage: $( basename $0 ) " 
@@ -73,6 +74,7 @@ for arg in "$@"; do
7374      --no_quantize) aot_arm_compiler_flag_quantize=" " 
7475      --portable_kernels=* ) portable_kernels=" ${arg#* =} " 
7576      --target=* ) target=" ${arg#* =} " 
77+       --toolchain=* ) toolchain=" ${arg#* =} " 
7678      --output=* ) output_folder=" ${arg#* =} " ;  output_folder_set=true ;;
7779      --bundleio) bundleio=true ;;
7880      --etdump) build_with_etdump=true ;;
9193#  Default Ethos-u tool folder override with --scratch-dir=<FOLDER>
9294ethos_u_scratch_dir=$( realpath ${ethos_u_scratch_dir} ) 
9395setup_path_script=${ethos_u_scratch_dir} /setup_path.sh
94- toolchain_cmake=${script_dir} /ethos-u-setup/arm-none-eabi-gcc .cmake
96+ toolchain_cmake=${script_dir} /ethos-u-setup/${toolchain} .cmake
9597_setup_msg=" please refer to ${script_dir} /setup.sh to properly install necessary tools." 
9698
9799
@@ -126,8 +128,8 @@ function check_setup () {
126128    fi 
127129
128130    #  If setup_path_script was correct all these checks should now pass
129-     hash  arm-none-eabi-gcc  \
130-         ||  { echo  " Could not find arm baremetal  toolchain on PATH, ${_setup_msg} " ;  return  1;  }
131+     hash  ${toolchain}  \
132+         ||  { echo  " Could not find ${toolchain}  toolchain on PATH, ${_setup_msg} " ;  return  1;  }
131133
132134    [[ -f  ${toolchain_cmake}  ]] \
133135        ||  { echo  " Could not find ${toolchain_cmake}  file, ${_setup_msg} " ;  return  1;  }
@@ -172,8 +174,8 @@ if [ "$bundleio" = true ] ; then
172174    et_dump_flag=" --etdump" 
173175fi 
174176
175- backends/arm/scripts/build_executorch.sh --et_build_root=" ${et_build_root} " $build_type  $devtools_flag 
176- backends/arm/scripts/build_portable_kernels.sh --et_build_root=" ${et_build_root} " $build_type  --portable_kernels=$portable_kernels 
177+ backends/arm/scripts/build_executorch.sh --et_build_root=" ${et_build_root} " $build_type  $devtools_flag  --toolchain= " ${toolchain} " 
178+ backends/arm/scripts/build_portable_kernels.sh --et_build_root=" ${et_build_root} " $build_type  --portable_kernels=$portable_kernels  --toolchain= " ${toolchain} " 
177179
178180if  [[ -z  " $model_name " ;  then 
179181    #  the test models run, and whether to delegate
@@ -257,7 +259,7 @@ for i in "${!test_model[@]}"; do
257259    else 
258260        set  -x
259261        #  Rebuild the application as the pte is imported as a header/c array
260-         backends/arm/scripts/build_executor_runner.sh --et_build_root=" ${et_build_root} " " ${pte_file} " ${build_type}  --target=${target}  --system_config=${system_config}  --memory_mode=${memory_mode}  ${bundleio_flag}  ${et_dump_flag}  --extra_build_flags=" ${extra_build_flags} " " ${ethos_u_scratch_dir} " 
262+         backends/arm/scripts/build_executor_runner.sh --et_build_root=" ${et_build_root} " " ${pte_file} " ${build_type}  --target=${target}  --system_config=${system_config}  --memory_mode=${memory_mode}  ${bundleio_flag}  ${et_dump_flag}  --extra_build_flags=" ${extra_build_flags} " " ${ethos_u_scratch_dir} "  --toolchain= " ${toolchain} " 
261263        if  [ " $build_only " =  false  ] ;  then 
262264            #  Execute the executor_runner on FVP Simulator
263265            elf_file=" ${output_folder} /${elf_folder} /cmake-out/arm_executor_runner" 
0 commit comments