Skip to content

Commit 954f63b

Browse files
committed
scripts: check_init_priorities: use the Zephyr executable file
Rework check_init_priorities to use the main executable file instead of the individual object files for discovering the devices. This should make the script more robust in case of stale files in the build directory, and also makes it work with LTO object files. Additionally, keep track of the detected init calls, and add a handy "-i" option to produce a human readable print of the initcalls in the call sequence, which can be useful for debugging initialization problems due to odd SYS_INIT and DEVICE interactions. Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 9fc414a commit 954f63b

File tree

6 files changed

+353
-270
lines changed

6 files changed

+353
-270
lines changed

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,8 +1811,7 @@ if(CONFIG_CHECK_INIT_PRIORITIES)
18111811
list(APPEND
18121812
post_build_commands
18131813
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py
1814-
--build-dir ${PROJECT_BINARY_DIR}/..
1815-
--edt-pickle ${EDT_PICKLE}
1814+
--elf-file=${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME}
18161815
${fail_on_warning}
18171816
)
18181817
endif()

Kconfig.zephyr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ config BUILD_OUTPUT_STRIP_PATHS
747747
config CHECK_INIT_PRIORITIES
748748
bool "Build time initialization priorities check"
749749
default y
750+
depends on !NATIVE_LIBRARY
750751
help
751752
Check the build for initialization priority issues by comparing the
752753
initialization priority in the build with the device dependency

0 commit comments

Comments
 (0)