From 56b1c32590fd9610195195b2593b8313617b0a3e Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Thu, 14 May 2026 09:16:17 +0200 Subject: [PATCH] fix(bootloader_support): declare esp_security as a dependency for flash_encrypt flash_encrypt.c is in the unconditional source list and includes esp_security/esp_key_mgr.h whenever SOC_KEY_MANAGER_SUPPORTED is set. Move the esp_security PRIV_REQUIRES declaration outside the BOOTLOADER_BUILD branch so every build variant that compiles flash_encrypt.c gets the dependency consistently. --- components/bootloader_support/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/bootloader_support/CMakeLists.txt b/components/bootloader_support/CMakeLists.txt index 4f4f71702d8..9a91d1c10e9 100644 --- a/components/bootloader_support/CMakeLists.txt +++ b/components/bootloader_support/CMakeLists.txt @@ -105,9 +105,13 @@ else() esp_hal_clock esp_hal_security) endif() +# src/flash_encrypt.c includes esp_security/esp_key_mgr.h on +# SOC_KEY_MANAGER_SUPPORTED targets. flash_encrypt.c is in the unconditional +# srcs list, so declare the dep unconditionally for all build variants. +list(APPEND priv_requires esp_security) + if(BOOTLOADER_BUILD) list(APPEND srcs "src/bootloader_panic.c") - list(APPEND priv_requires esp_security) if(CONFIG_SECURE_FLASH_ENC_ENABLED) list(APPEND srcs "src/flash_encryption/flash_encrypt.c"