Skip to content

Commit 2551b8c

Browse files
BujSetGithub Executorch
authored andcommitted
Deciding to still to single toolchain-gcc.cmake file and just allow for toolchain overload selection.
1 parent 527485f commit 2551b8c

File tree

7 files changed

+30
-243
lines changed

7 files changed

+30
-243
lines changed

.github/workflows/trunk.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ jobs:
259259
260260
# User toolchain
261261
${toolchain_prefix}c++ --version
262-
toolchain_cmake=examples/arm/ethos-u-setup/arm-eabi-gcc.cmake
262+
263+
# We will use the the bare metal default, specify to use the
264+
# arm zephyr toolchain if we need to
265+
toolchain_cmake=examples/arm/ethos-u-setup/arm-eabi-none-gcc.cmake
263266
toolchain_cmake=$(realpath ${toolchain_cmake})
264267
265268
# Build and test size test

CMakePresets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"cacheVariables": {
115115
"EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/zephyr.cmake",
116116
"ARM_TOOLCHAIN_NAME": "zephyr",
117-
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/examples/arm/ethos-u-setup/arm-eabi-gcc.cmake"
117+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake"
118118
}
119119
}
120120
]

examples/arm/ethos-u-setup/arm-eabi-gcc.cmake

Lines changed: 0 additions & 118 deletions
This file was deleted.

examples/arm/ethos-u-setup/arm-none-eabi-gcc.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ set(TARGET_CPU
2525
)
2626
string(TOLOWER ${TARGET_CPU} CMAKE_SYSTEM_PROCESSOR)
2727

28+
if(ARM_TOOLCHAIN_NAME MATCHES "^zephyr")
29+
set(CMAKE_ARM_ARCH_ABI arm-zephyr-eabi)
30+
else()
31+
set(CMAKE_ARM_ARCH_ABI arm-none-eabi)
32+
endif()
33+
2834
set(CMAKE_SYSTEM_NAME Generic)
2935
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
3036
set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
@@ -101,3 +107,11 @@ add_compile_options(
101107
-Wno-error=shift-count-overflow
102108
-Wno-psabi
103109
)
110+
111+
if (CMAKE_ARM_ARCH_ABI STREQUAL "arm-zephyr-eabi")
112+
add_compile_options(
113+
-Wno-stringop-overread
114+
-Wno-error=format=
115+
-Wno-error=maybe-uninitialized
116+
)
117+
endif()

examples/arm/ethos-u-setup/arm-zephyr-eabi-gcc.cmake

Lines changed: 0 additions & 111 deletions
This file was deleted.

examples/arm/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function setup_fvp() {
224224
}
225225

226226
function setup_toolchain() {
227-
# Download and install the arm-none-eabi toolchain
227+
# Download and install the arm toolchain (default is arm-none-eabi)
228228
cd "${root_dir}"
229229
local selected_toolchain_url="${toolchain_url}"
230230
local selected_toolchain_dir="${toolchain_dir}"

test/build_size_test.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ cmake_install_executorch_lib() {
2323
update_tokenizers_git_submodule
2424
local EXTRA_BUILD_ARGS="${@}"
2525

26-
# CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
27-
# -DCMAKE_CXX_STANDARD_REQUIRED=ON \
28-
# -DCMAKE_INSTALL_PREFIX=cmake-out \
29-
# -DCMAKE_BUILD_TYPE=Release \
30-
# -DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
31-
# -DEXECUTORCH_OPTIMIZE_SIZE=ON \
32-
# -DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
33-
# ${EXTRA_BUILD_ARGS} \
34-
# -Bcmake-out .
35-
cmake --preset zephyr ${EXTRA_BUILD_ARGS} -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out .
26+
CXXFLAGS="$COMMON_CXXFLAGS" retry cmake -DBUCK2="$BUCK2" \
27+
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
28+
-DCMAKE_INSTALL_PREFIX=cmake-out \
29+
-DCMAKE_BUILD_TYPE=Release \
30+
-DEXECUTORCH_BUILD_EXECUTOR_RUNNER=OFF \
31+
-DEXECUTORCH_OPTIMIZE_SIZE=ON \
32+
-DPYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" \
33+
${EXTRA_BUILD_ARGS} \
34+
-Bcmake-out .
3635
cmake --build cmake-out -j9 --target install --config Release
3736
}
3837

@@ -41,7 +40,7 @@ test_cmake_size_test() {
4140
-DCMAKE_INSTALL_PREFIX=cmake-out \
4241
${EXTRA_BUILD_ARGS} \
4342
-Bcmake-out/test test
44-
# cmake --preset zephyr ${EXTRA_BUILD_ARGS} -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=cmake-out -Bcmake-out/test test
43+
4544
echo "Build size test"
4645
cmake --build cmake-out/test -j9 --config Release
4746

0 commit comments

Comments
 (0)