From 4a556a925c79fa2518315546fd38a7210e1e8d77 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Mon, 18 Sep 2023 11:35:35 +0000 Subject: [PATCH] cmake: skip build time priority checking with armclang The script does not play well with armclang binariest at the moment. Disable the automatic invocation when running with armclang, at least until this is investigated and fixed. Signed-off-by: Fabio Baltieri --- CMakeLists.txt | 18 ++++++++++-------- Kconfig.zephyr | 1 + 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0b25d16c8c..6d5c643f3e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1816,14 +1816,16 @@ if(CONFIG_CHECK_INIT_PRIORITIES) ) endif() -add_custom_target( - initlevels - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py - --elf-file=${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} - --initlevels - DEPENDS ${logical_target_for_zephyr_elf} - USES_TERMINAL -) +if(NOT CMAKE_C_COMPILER_ID STREQUAL "ARMClang") + add_custom_target( + initlevels + COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py + --elf-file=${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME} + --initlevels + DEPENDS ${logical_target_for_zephyr_elf} + USES_TERMINAL + ) +endif() # Generate and use MCUboot related artifacts as needed. if(CONFIG_BOOTLOADER_MCUBOOT) diff --git a/Kconfig.zephyr b/Kconfig.zephyr index 3523bb50617..4b6976a503f 100644 --- a/Kconfig.zephyr +++ b/Kconfig.zephyr @@ -748,6 +748,7 @@ config CHECK_INIT_PRIORITIES bool "Build time initialization priorities check" default y depends on !NATIVE_LIBRARY + depends on "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "armclang" help Check the build for initialization priority issues by comparing the initialization priority in the build with the device dependency