Skip to content

Commit d1c0c93

Browse files
committed
iSpearating out changes only for zephyr cmake preset diff
1 parent 77263bb commit d1c0c93

File tree

9 files changed

+15
-30
lines changed

9 files changed

+15
-30
lines changed

backends/arm/scripts/build_executor_runner.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ set -eu
99
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1010
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1111
et_root_dir=$(realpath ${et_root_dir})
12-
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake
12+
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1313
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
1414
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."
1515

1616
pte_file=""
1717
target="ethos-u55-128"
18-
build_type="Debug"
18+
build_type="Release"
1919
bundleio=false
2020
system_config=""
2121
memory_mode=""
@@ -134,8 +134,6 @@ echo "Building with BundleIO/etdump/extra flags: ${build_bundleio_flags} ${build
134134
cmake \
135135
-DCMAKE_BUILD_TYPE=${build_type} \
136136
-DCMAKE_TOOLCHAIN_FILE=${toolchain_cmake} \
137-
-DCMAKE_C_COMPILER="/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc" \
138-
-DCMAKE_CXX_COMPILER="/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++" \
139137
-DTARGET_CPU=${target_cpu} \
140138
-DET_DIR_PATH:PATH=${et_root_dir} \
141139
-DET_BUILD_DIR_PATH:PATH=${et_build_dir} \
@@ -156,6 +154,6 @@ cmake --build ${output_folder}/cmake-out -j$(nproc) -- arm_executor_runner
156154

157155
echo "[${BASH_SOURCE[0]}] Generated baremetal elf file:"
158156
find ${output_folder}/cmake-out -name "arm_executor_runner"
159-
echo "executable_text: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-zephyr-eabi-size {} \; | grep -v filename | awk '{print $1}') bytes"
160-
echo "executable_data: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-zephyr-eabi-size {} \; | grep -v filename | awk '{print $2}') bytes"
161-
echo "executable_bss: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-zephyr-eabi-size {} \; | grep -v filename | awk '{print $3}') bytes"
157+
echo "executable_text: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-none-eabi-size {} \; | grep -v filename | awk '{print $1}') bytes"
158+
echo "executable_data: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-none-eabi-size {} \; | grep -v filename | awk '{print $2}') bytes"
159+
echo "executable_bss: $(find ${output_folder}/cmake-out -name arm_executor_runner -exec arm-none-eabi-size {} \; | grep -v filename | awk '{print $3}') bytes"

backends/arm/scripts/build_executorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -eu
1313
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1414
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
16-
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake
16+
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
1818
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
1919
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."

backends/arm/scripts/build_portable_kernels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -eu
1313
script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1414
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1515
et_root_dir=$(realpath ${et_root_dir})
16-
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake
16+
toolchain_cmake=${script_dir}/../../../examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1717
toolchain_cmake=$(realpath ${toolchain_cmake})
1818
setup_path_script=${et_root_dir}/examples/arm/ethos-u-scratch/setup_path.sh
1919
_setup_msg="please refer to ${et_root_dir}/examples/arm/setup.sh to properly install necessary tools."

backends/arm/test/setup_testing.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ script_dir=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
1111
et_root_dir=$(cd ${script_dir}/../../.. && pwd)
1212
ethos_u_root_dir=${et_root_dir}/examples/arm/ethos-u-scratch/ethos-u
1313

14-
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake
14+
toolchain_cmake=${et_root_dir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake
1515
et_build_dir=${et_root_dir}/arm_test/cmake-out
1616
build_root_test_dir=${et_root_dir}/arm_test/arm_semihosting_executor_runner
1717

examples/arm/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
# ~~~
1111

1212
cmake_minimum_required(VERSION 3.19)
13-
set(CMAKE_C_COMPILER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc")
14-
set(CMAKE_CXX_COMPILER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++")
15-
set(CMAKE_ASM_COMPILER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc")
16-
set(CMAKE_LINKER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-ld")
1713
project(arm_example)
1814

1915
# Option to register op list

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ if(NOT DEFINED ET_PTE_FILE_PATH AND NOT ${SEMIHOSTING})
2121
)
2222
endif()
2323

24-
set(CMAKE_C_COMPILER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc")
25-
set(CMAKE_CXX_COMPILER "/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++")
2624
# Example ExecuTorch demo for bare metal Cortex-M based systems
2725
set(ET_DIR_PATH
2826
"../../.."

examples/arm/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ done
9191
# Default Ethos-u tool folder override with --scratch-dir=<FOLDER>
9292
ethos_u_scratch_dir=$(realpath ${ethos_u_scratch_dir})
9393
setup_path_script=${ethos_u_scratch_dir}/setup_path.sh
94-
toolchain_cmake=${script_dir}/ethos-u-setup/arm-zephyr-eabi-gcc.cmake
94+
toolchain_cmake=${script_dir}/ethos-u-setup/arm-none-eabi-gcc.cmake
9595
_setup_msg="please refer to ${script_dir}/setup.sh to properly install necessary tools."
9696

9797

@@ -126,9 +126,9 @@ function check_setup () {
126126
fi
127127

128128
# 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-
#
129+
hash arm-none-eabi-gcc \
130+
|| { echo "Could not find arm baremetal toolchain on PATH, ${_setup_msg}"; return 1; }
131+
132132
[[ -f ${toolchain_cmake} ]] \
133133
|| { echo "Could not find ${toolchain_cmake} file, ${_setup_msg}"; return 1; }
134134

examples/arm/setup.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ ARCH="$(uname -m)"
1818
OS="$(uname -s)"
1919
root_dir="${script_dir}/ethos-u-scratch"
2020
eula_acceptance=0
21-
skip_toolchain_setup=1
21+
skip_toolchain_setup=0
2222
skip_fvp_setup=0
2323
skip_vela_setup=0
2424

2525

2626
# Figure out if setup.sh was called or sourced and save it into "is_script_sourced"
2727
(return 0 2>/dev/null) && is_script_sourced=1 || is_script_sourced=0
2828

29-
custom_toolchain="/home/zephyruser/zephyr-sdk-0.16.0/arm-zephyr-eabi/bin"
3029
if [[ "${ARCH}" == "x86_64" ]]; then
3130
# FVPs
3231
corstone300_url="https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-300/FVP_Corstone_SSE-300_11.22_20_Linux64.tgz?rev=018659bd574f4e7b95fa647e7836ccf4&hash=22A79103C6FA5FFA7AFF3BE0447F3FF9"
@@ -242,7 +241,6 @@ function create_setup_path(){
242241
toolchain_bin_path="$(cd ${toolchain_dir}/bin && pwd)"
243242
echo "export PATH=\${PATH}:${toolchain_bin_path}" >> ${setup_path_script}
244243
fi
245-
echo "export PATH=\${PATH}:${custom_toolchain}" >> ${setup_path_script}
246244
}
247245

248246
function check_platform_support() {

test/build_size_test.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,13 @@ cmake_install_executorch_lib() {
2323
update_tokenizers_git_submodule
2424
local EXTRA_BUILD_ARGS="${@}"
2525

26-
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake \
26+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
2727
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
28-
-DCMAKE_TOOLCHAIN_FILE="/home/zephyruser/executorch/examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake" \
2928
-DCMAKE_INSTALL_PREFIX=cmake-out \
30-
-DEXECUTORCH_PAL_DEFAULT=posix \
3129
-DCMAKE_BUILD_TYPE=Release \
3230
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
3331
-DEXECUTORCH_OPTIMIZE_SIZE=ON \
34-
-DEXECUTORCH_BUILD_PTHREADPOOL=OFF \
35-
-DEXECUTORCH_BUILD_CPUINFO=OFF \
36-
-DEXECUTORCH_ENABLE_LOGGING=ON \
32+
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
3733
${EXTRA_BUILD_ARGS} \
3834
-Bcmake-out .
3935
cmake --build cmake-out -j9 --target install --config Release
@@ -42,7 +38,6 @@ cmake_install_executorch_lib() {
4238
test_cmake_size_test() {
4339
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DCMAKE_BUILD_TYPE=Release \
4440
-DCMAKE_INSTALL_PREFIX=cmake-out \
45-
-DCMAKE_TOOLCHAIN_FILE="/home/zephyruser/executorch/examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake" \
4641
${EXTRA_BUILD_ARGS} \
4742
-Bcmake-out/test test
4843

0 commit comments

Comments
 (0)