From f1d84e671f23760b033b1befde326738d5971cb3 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 15 Apr 2026 11:41:10 +0200 Subject: [PATCH 01/16] fix(esp_event/test): remove quotes around space-separated PRIV_REQUIRES list The test app set priv_requires as a single quoted string ("esp_event unity") instead of separate list items. The v1 build system silently splits on spaces, but the v2 compat layer treats it as a single component name. --- components/esp_event/test_apps/main/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_event/test_apps/main/CMakeLists.txt b/components/esp_event/test_apps/main/CMakeLists.txt index f5f1624eda0..025a652260b 100644 --- a/components/esp_event/test_apps/main/CMakeLists.txt +++ b/components/esp_event/test_apps/main/CMakeLists.txt @@ -1,7 +1,7 @@ idf_build_get_property(target IDF_TARGET) set(srcs "test_event_main.c" "test_event_common.cpp") -set(priv_requires "esp_event unity") +set(priv_requires esp_event unity) if(NOT ${target} STREQUAL "linux") list(APPEND srcs From 8f202ad7e87171b8aac1607443c11dff57266bed Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 17 Apr 2026 08:43:05 +0200 Subject: [PATCH 02/16] fix(esp_libc/kconfig): exclude IDF_TARGET_LINUX from LibC menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On the Linux target the host's C library is used directly; none of the LibC menu options apply. Mark the entire "LibC" menu as `depends on !IDF_TARGET_LINUX` so its symbols (LIBC_NEWLIB, LIBC_PICOLIBC, …) stay undefined on Linux builds. Also gate the picolibc-specific include in components/console/linenoise/ linenoise.c under `!CONFIG_IDF_TARGET_LINUX` so the file does not try to pull on the host even if CONFIG_LIBC_PICOLIBC is set by some other build path. --- components/console/linenoise/linenoise.c | 2 ++ components/esp_libc/Kconfig | 1 + 2 files changed, 3 insertions(+) diff --git a/components/console/linenoise/linenoise.c b/components/console/linenoise/linenoise.c index 64fcf23a12d..e0c0bc21657 100644 --- a/components/console/linenoise/linenoise.c +++ b/components/console/linenoise/linenoise.c @@ -124,9 +124,11 @@ #include #include #include "linenoise.h" +#if !CONFIG_IDF_TARGET_LINUX #if CONFIG_LIBC_PICOLIBC #include #endif +#endif // !CONFIG_IDF_TARGET_LINUX #if CONFIG_LIBC_PICOLIBC && !CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY __thread FILE *linenoise_stdin; diff --git a/components/esp_libc/Kconfig b/components/esp_libc/Kconfig index 6c7447c9d60..f49eee7c104 100644 --- a/components/esp_libc/Kconfig +++ b/components/esp_libc/Kconfig @@ -1,4 +1,5 @@ menu "LibC" + depends on !IDF_TARGET_LINUX choice LIBC prompt "LibC to build application with" From 6e3fae60fc2de821636a1da699b9499734b1f2ff Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 17 Apr 2026 11:40:22 +0200 Subject: [PATCH 03/16] fix(components): initialize srcs variable to prevent scope leakage --- components/app_trace/CMakeLists.txt | 3 ++- components/esp_tee/CMakeLists.txt | 1 + components/esp_trace/CMakeLists.txt | 3 ++- components/spiffs/CMakeLists.txt | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/components/app_trace/CMakeLists.txt b/components/app_trace/CMakeLists.txt index 78513c5c295..56a53429a4e 100644 --- a/components/app_trace/CMakeLists.txt +++ b/components/app_trace/CMakeLists.txt @@ -4,8 +4,9 @@ if(${target} STREQUAL "linux") return() # This component is not supported by the POSIX/Linux simulator endif() +set(srcs) if(CONFIG_ESP_TRACE_TRANSPORT_APPTRACE) - set(srcs + list(APPEND srcs "app_trace.c" "app_trace_util.c" "host_file_io.c" diff --git a/components/esp_tee/CMakeLists.txt b/components/esp_tee/CMakeLists.txt index f75bb4b970b..dcba631e4d3 100644 --- a/components/esp_tee/CMakeLists.txt +++ b/components/esp_tee/CMakeLists.txt @@ -19,6 +19,7 @@ elseif(esp_tee_build) # TEE build currently only uses the shared headers. idf_component_register(INCLUDE_DIRS include) else() + set(srcs) if(CONFIG_SECURE_ENABLE_TEE) if(NOT CMAKE_BUILD_EARLY_EXPANSION) # Add custom flash target for TEE binary diff --git a/components/esp_trace/CMakeLists.txt b/components/esp_trace/CMakeLists.txt index 876cdf00e77..937b664d110 100644 --- a/components/esp_trace/CMakeLists.txt +++ b/components/esp_trace/CMakeLists.txt @@ -4,8 +4,9 @@ if(${target} STREQUAL "linux") return() endif() +set(srcs) if(CONFIG_ESP_TRACE_ENABLE) - set(srcs + list(APPEND srcs "src/core/esp_trace_core.c" "src/core/esp_trace_registry.c" "src/ports/port_utils.c" diff --git a/components/spiffs/CMakeLists.txt b/components/spiffs/CMakeLists.txt index e53ea7166dd..27ae6405740 100644 --- a/components/spiffs/CMakeLists.txt +++ b/components/spiffs/CMakeLists.txt @@ -6,6 +6,8 @@ set(original_srcs "spiffs/src/spiffs_cache.c" "spiffs/src/spiffs_hydrogen.c" "spiffs/src/spiffs_nucleus.c") +set(srcs) +set(pr) list(APPEND srcs "spiffs_api.c" ${original_srcs}) if(NOT ${target} STREQUAL "linux") From fbddd41690a88bad5aace736c1acd74cc15ff88a Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 17 Apr 2026 15:38:00 +0200 Subject: [PATCH 04/16] fix(esp_hw_support): use elif __riscv guard in spinlock.h spinlock.h used #else to include riscv/rv_utils.h for all non-Xtensa targets. On Linux host (neither __XTENSA__ nor __riscv defined), this pulls in a non-existent header. Change to #elif __riscv, matching esp_cpu.h's existing pattern. --- components/esp_hw_support/include/spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp_hw_support/include/spinlock.h b/components/esp_hw_support/include/spinlock.h index 66f825efce4..e34f7564879 100644 --- a/components/esp_hw_support/include/spinlock.h +++ b/components/esp_hw_support/include/spinlock.h @@ -13,7 +13,7 @@ #if __XTENSA__ #include "xtensa/xtruntime.h" #include "xt_utils.h" -#else +#elif __riscv #include "riscv/rv_utils.h" #endif From 506cedf16c25a61d09679827a6756142afb44705 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Tue, 21 Apr 2026 11:23:33 +0200 Subject: [PATCH 05/16] fix(esp_wifi): declare interface deps in non-WiFi stub registration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Public headers (notably esp_wifi_default.h) include esp_event.h, esp_netif.h and esp_phy.h. Declare these in REQUIRES so the headers are visible to consumers — same interface as the WiFi-enabled registration at the bottom of this file. Also declare wpa_supplicant as PRIV_REQUIRES so the remote/ EAP stubs can include esp_eap_client.h when the stub registration is compiled. --- components/esp_wifi/CMakeLists.txt | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index f9e8fb8ee57..65e991cdb7b 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -15,25 +15,18 @@ if( NOT CONFIG_ESP_WIFI_ENABLED "src/wifi_netif.c" "src/wifi_default_ap.c") - # In build system v2, idf_component_optional_requires() includes the target - # component into the build immediately, so these stub sources are compiled - # even on targets where Wi-Fi is not supported. The stubs need esp_event and - # esp_netif headers, so those dependencies must be declared here for v2. - # - # In build system v1, idf_component_optional_requires() only links a - # component that is already part of the build. On non-Wi-Fi targets, this - # component is never pulled in, so the stubs are never compiled and the - # dependencies are not needed. Additionally, the CMAKE_BUILD_EARLY_EXPANSION - # guard ensures that the stubs are not compiled for v1. - set(priv_reqs "") - if(IDF_BUILD_V2) - set(priv_reqs "esp_event" "esp_netif") - endif() + # Public headers (notably esp_wifi_default.h) include esp_event.h, + # esp_netif.h and esp_phy.h. Declare these in REQUIRES so the headers + # are visible to consumers — same interface as the WiFi-enabled + # registration at the bottom of this file. + set(reqs "esp_event" "esp_netif" "esp_phy") + set(priv_reqs "wpa_supplicant") # This component provides "esp_wifi" "wifi_apps/nan_app" headers if WiFi not enabled # (implementation supported optionally in a managed component esp_wifi_remote) idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" "wifi_apps/nan_app/include" + REQUIRES ${reqs} PRIV_REQUIRES ${priv_reqs}) add_subdirectory(remote) # wifi-remote on esp32p4/h2 (no wifi) return() From 7e5588fd6aab90b67f9601265cfd0ed29ade7ebe Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Thu, 21 May 2026 08:11:22 +0200 Subject: [PATCH 06/16] fix(bt): declare esp_event as a private requirement bt sources include esp_wifi_types.h via esp_blufi_api.h, which transitively includes esp_event_base.h from the esp_event component. --- components/bt/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/components/bt/CMakeLists.txt b/components/bt/CMakeLists.txt index 348af5ef910..84e1e9e549a 100644 --- a/components/bt/CMakeLists.txt +++ b/components/bt/CMakeLists.txt @@ -89,6 +89,7 @@ set(bt_priv_requires esp_ringbuf esp_gdbstub esp_security + esp_event ) idf_component_register(SRCS "${srcs}" From 964c4385871d6fbf6728410a83cd7b360c0b1f65 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 22 Apr 2026 14:47:54 +0200 Subject: [PATCH 07/16] fix(esp_hal_sd): include for offsetof in sdio_slave_hal.c picolibc with C23 no longer exposes implicitly through other headers; add the explicit include for `offsetof`. --- components/esp_hal_sd/sdio_slave_hal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/esp_hal_sd/sdio_slave_hal.c b/components/esp_hal_sd/sdio_slave_hal.c index 25829f397e1..dd36936bd71 100644 --- a/components/esp_hal_sd/sdio_slave_hal.c +++ b/components/esp_hal_sd/sdio_slave_hal.c @@ -7,6 +7,7 @@ // The HAL layer for SDIO slave (common part) #include +#include #include #include "soc/sdio_slc_struct.h" #include "soc/sdio_hinf_struct.h" From aee4403d91e23564253eb296d3158038e0bec2a5 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 22 Apr 2026 14:48:35 +0200 Subject: [PATCH 08/16] fix(dns_over_https): declare main and protocol_examples_common deps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dns_over_https/main includes time_sync.h, nvs_flash.h, esp_event.h, esp_timer.h, and mbedtls headers. Declare nvs_flash, esp_event, esp_timer, mbedtls and time_sync in PRIV_REQUIRES so the build is self-describing under any build system. Also move esp_netif from PRIV_REQUIRES to REQUIRES in protocol_examples_common, since its public header exposes esp_netif.h. Also add the PRIVATE keyword to target_link_libraries in the dns_over_https component — CMake rejects mixed keyword/plain signatures on the same target. --- .../common_components/protocol_examples_common/CMakeLists.txt | 3 ++- .../dns_over_https/components/dns_over_https/CMakeLists.txt | 2 +- examples/protocols/dns_over_https/main/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/common_components/protocol_examples_common/CMakeLists.txt b/examples/common_components/protocol_examples_common/CMakeLists.txt index 56b6b035669..a57438922ad 100644 --- a/examples/common_components/protocol_examples_common/CMakeLists.txt +++ b/examples/common_components/protocol_examples_common/CMakeLists.txt @@ -33,7 +33,8 @@ endif() idf_component_register(SRCS "${srcs}" INCLUDE_DIRS "include" - PRIV_REQUIRES esp_netif esp_driver_gpio esp_driver_uart esp_wifi vfs console openthread) + REQUIRES esp_netif + PRIV_REQUIRES esp_driver_gpio esp_driver_uart esp_wifi vfs console openthread) if(CONFIG_EXAMPLE_PROVIDE_WIFI_CONSOLE_CMD) idf_component_optional_requires(PRIVATE console) diff --git a/examples/protocols/dns_over_https/components/dns_over_https/CMakeLists.txt b/examples/protocols/dns_over_https/components/dns_over_https/CMakeLists.txt index 38bfd7d6e1b..8e7b57083f3 100644 --- a/examples/protocols/dns_over_https/components/dns_over_https/CMakeLists.txt +++ b/examples/protocols/dns_over_https/components/dns_over_https/CMakeLists.txt @@ -3,5 +3,5 @@ idf_component_register(SRCS "dns_over_https.c" "dns_utils.c" PRIV_REQUIRES nvs_flash lwip esp_event esp-tls esp_http_client) if(CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM) - target_link_libraries(${COMPONENT_LIB} "-u lwip_hook_netconn_external_resolve") + target_link_libraries(${COMPONENT_LIB} PRIVATE "-u lwip_hook_netconn_external_resolve") endif() diff --git a/examples/protocols/dns_over_https/main/CMakeLists.txt b/examples/protocols/dns_over_https/main/CMakeLists.txt index 90701fa2804..30048ac7121 100644 --- a/examples/protocols/dns_over_https/main/CMakeLists.txt +++ b/examples/protocols/dns_over_https/main/CMakeLists.txt @@ -7,4 +7,5 @@ endif() idf_component_register(SRCS "example_dns_over_https.c" INCLUDE_DIRS "." + PRIV_REQUIRES time_sync nvs_flash esp_event esp_timer mbedtls EMBED_TXTFILES ${cert_file}) From 794d3772e4b0eb6b09e4b65ea1a3363477f8efc2 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Tue, 12 May 2026 16:15:09 +0200 Subject: [PATCH 09/16] fix(hal): initialize priv_include to prevent scope leakage in cmakev2 --- components/hal/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index 31fc5d88bc7..f9ab4e27f0c 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -3,6 +3,7 @@ idf_build_get_property(esp_tee_build ESP_TEE_BUILD) set(srcs "hal_utils.c") set(includes "platform_port/include") +set(priv_include) set(requires) # target specific include must be added before the generic one From bc0ae03f6028528b377aaa8c9658a1571ca3f075 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 13 May 2026 09:05:56 +0200 Subject: [PATCH 10/16] fix(esp_stdio): align VFS console force-link with the source-selection condition stdio_vfs.c (the sole definition of esp_vfs_include_console_register) is only added to the source list on non-Linux targets. The trailing target_link_libraries(... -u esp_vfs_include_console_register) was applied whenever CONFIG_VFS_SUPPORT_IO was enabled, including on the Linux host build where the symbol is not part of the link. Constrain the force-undef to the same condition that opts the defining source in. --- components/esp_stdio/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esp_stdio/CMakeLists.txt b/components/esp_stdio/CMakeLists.txt index b929cc4e4a7..f4253624659 100644 --- a/components/esp_stdio/CMakeLists.txt +++ b/components/esp_stdio/CMakeLists.txt @@ -27,7 +27,7 @@ endif() idf_component_register(SRCS ${srcs} INCLUDE_DIRS ${includes}) -if(CONFIG_VFS_SUPPORT_IO) +if(CONFIG_VFS_SUPPORT_IO AND NOT ${target} STREQUAL "linux") if(IDF_BUILD_V2) idf_component_include(vfs) @@ -63,6 +63,9 @@ if(CONFIG_VFS_SUPPORT_IO) endif() target_link_libraries(${COMPONENT_LIB} PRIVATE idf::vfs) - # Make sure esp_stdio_register gets called at startup stage + # Make sure esp_stdio_register gets called at startup stage. + # The referenced symbol is defined in stdio_vfs.c, which is only added to + # the source list above on non-Linux targets; the force-undef is gated on + # the same condition for the link line to remain resolvable. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_vfs_include_console_register") endif() From 07af6ddcf74a80136077af66688de497f2f1a8e0 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 13 May 2026 17:26:32 +0200 Subject: [PATCH 11/16] fix(host_test): use ${project_elf} variable and keyword link form Three host_test CMakeLists.txt files relied on idioms tied to a specific build system layout. Make them portable: - spiffs/host_test and esp_partition/host_test/partition_api_test passed a hard-coded ".elf" target name to add_dependencies(). Use ${project_elf}, the canonical variable that resolves to the live executable target name in either build system. - nvs_flash/host_test/nvs_page_test linked --coverage using the plain signature of target_link_libraries. CMake forbids mixing plain and keyword signatures on the same target; the component library link already uses the keyword form. Switch the --coverage link to the keyword signature. --- .../esp_partition/host_test/partition_api_test/CMakeLists.txt | 2 +- .../nvs_flash/host_test/nvs_page_test/main/CMakeLists.txt | 2 +- components/spiffs/host_test/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_partition/host_test/partition_api_test/CMakeLists.txt b/components/esp_partition/host_test/partition_api_test/CMakeLists.txt index e2f75e47709..ead8ac860c6 100644 --- a/components/esp_partition/host_test/partition_api_test/CMakeLists.txt +++ b/components/esp_partition/host_test/partition_api_test/CMakeLists.txt @@ -41,4 +41,4 @@ add_custom_target(partition-table-8M ${partition_table_display} VERBATIM) -add_dependencies(partition_api_test.elf partition-table partition-table-8M) +add_dependencies(${project_elf} partition-table partition-table-8M) diff --git a/components/nvs_flash/host_test/nvs_page_test/main/CMakeLists.txt b/components/nvs_flash/host_test/nvs_page_test/main/CMakeLists.txt index ef19b495893..37dd200b799 100644 --- a/components/nvs_flash/host_test/nvs_page_test/main/CMakeLists.txt +++ b/components/nvs_flash/host_test/nvs_page_test/main/CMakeLists.txt @@ -8,7 +8,7 @@ idf_component_register(SRCS "nvs_page_test.cpp" PRIV_REQUIRES spi_flash) target_compile_options(${COMPONENT_LIB} PUBLIC --coverage) -target_link_libraries(${COMPONENT_LIB} --coverage) +target_link_libraries(${COMPONENT_LIB} PUBLIC --coverage) if(CMAKE_C_COMPILER_ID MATCHES "Clang") target_compile_options(${COMPONENT_LIB} PRIVATE -std=gnu++20) endif() diff --git a/components/spiffs/host_test/CMakeLists.txt b/components/spiffs/host_test/CMakeLists.txt index ad58d6cb410..5d962307296 100644 --- a/components/spiffs/host_test/CMakeLists.txt +++ b/components/spiffs/host_test/CMakeLists.txt @@ -23,4 +23,4 @@ set_property( APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${build_dir}/image.bin") -add_dependencies(host_test_spiffs.elf image.bin) +add_dependencies(${project_elf} image.bin) From 56b1c32590fd9610195195b2593b8313617b0a3e Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Thu, 14 May 2026 09:16:17 +0200 Subject: [PATCH 12/16] 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" From bdcd2d611cf4dd11aa6937c9eb3c2a1664762cfe Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 18 May 2026 12:54:48 +0200 Subject: [PATCH 13/16] fix(test_apps/gdb): declare spi_flash as a private requirement of main main/hello_world_main.c uses spi_flash headers. Declare spi_flash in PRIV_REQUIRES so the build works under cmakev2's strict component isolation. --- tools/test_apps/system/gdb/main/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/test_apps/system/gdb/main/CMakeLists.txt b/tools/test_apps/system/gdb/main/CMakeLists.txt index 69def7bc1d8..6d3124864f7 100644 --- a/tools/test_apps/system/gdb/main/CMakeLists.txt +++ b/tools/test_apps/system/gdb/main/CMakeLists.txt @@ -1,3 +1,4 @@ idf_component_register(SRCS "hello_world_main.c" - INCLUDE_DIRS "") + INCLUDE_DIRS "" + PRIV_REQUIRES spi_flash) target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format") From 77b7625b8147574a320bc09f797a7f9ff7e8dd4d Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 18 May 2026 12:58:52 +0200 Subject: [PATCH 14/16] fix(test_apps/memprot): declare esp_hal_wdt as a private requirement of main main/{esp32s2,esp32c3,esp32s3}/test_panic.c uses WDT registers from esp_hal_wdt. Declare it explicitly so the build works under cmakev2's strict component isolation. --- tools/test_apps/system/memprot/main/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/test_apps/system/memprot/main/CMakeLists.txt b/tools/test_apps/system/memprot/main/CMakeLists.txt index 7a4baca5a7e..102448ae89d 100644 --- a/tools/test_apps/system/memprot/main/CMakeLists.txt +++ b/tools/test_apps/system/memprot/main/CMakeLists.txt @@ -1,10 +1,13 @@ if( IDF_TARGET STREQUAL "esp32s2" ) idf_component_register(SRCS "esp32s2/test_memprot_main.c" "esp32s2/test_panic.c" - INCLUDE_DIRS "") + INCLUDE_DIRS "" + PRIV_REQUIRES esp_hal_wdt) elseif( IDF_TARGET STREQUAL "esp32c3" ) idf_component_register(SRCS "esp32c3/test_memprot_main.c" "esp32c3/test_panic.c" "esp32c3/return_from_panic.S" - INCLUDE_DIRS "") + INCLUDE_DIRS "" + PRIV_REQUIRES esp_hal_wdt) elseif( IDF_TARGET STREQUAL "esp32s3" ) idf_component_register(SRCS "esp32s3/test_memprot_main.c" "esp32s3/test_panic.c" - INCLUDE_DIRS "") + INCLUDE_DIRS "" + PRIV_REQUIRES esp_hal_wdt) endif() From c105ea3af865434dc66caf3d8c0812a5dfcb81a8 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 18 May 2026 13:36:32 +0200 Subject: [PATCH 15/16] fix(ulp): initialize sources to prevent scope leakage in cmakev2 --- components/ulp/project_include.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/components/ulp/project_include.cmake b/components/ulp/project_include.cmake index 891bbaecc43..bc9712fa26e 100644 --- a/components/ulp/project_include.cmake +++ b/components/ulp/project_include.cmake @@ -5,6 +5,7 @@ function(__setup_ulp_project app_name project_path prefix type s_sources exp_dep_srcs) if(NOT CMAKE_BUILD_EARLY_EXPANSION) + set(sources "") spaces2list(s_sources) foreach(source ${s_sources}) get_filename_component(source ${source} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) From 8e720e36c3d37a9bbf545daa9715f80b4543e1d5 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 18 May 2026 15:46:53 +0200 Subject: [PATCH 16/16] fix(esp_hal_gpspi): narrow freq_limit scope to its consumer in spi_hal_cal_clock_conf freq_limit was declared at the top of the #if SPI_LL_SUPPORT_TIME_TUNING block and only consumed by HAL_EARLY_LOGE inside an inner if(). When the log macro expands to nothing (e.g. log component absent from the build closure, as in g0_components, or log level set below ERROR), the variable became unused and tripped -Wunused-variable, failing builds under --check-warnings. Move the declaration into the inner if() that calls HAL_EARLY_LOGE so it shares the same scope and lifetime as its consumer. --- components/esp_hal_gpspi/spi_hal_iram.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/esp_hal_gpspi/spi_hal_iram.c b/components/esp_hal_gpspi/spi_hal_iram.c index f03bffcc91c..10386c34cb6 100644 --- a/components/esp_hal_gpspi/spi_hal_iram.c +++ b/components/esp_hal_gpspi/spi_hal_iram.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -50,10 +50,12 @@ esp_err_t spi_hal_cal_clock_conf(const spi_hal_timing_param_t *timing_param, spi spi_hal_cal_timing(timing_param->clk_src_hz, eff_clk_n, timing_param->use_gpio, timing_param->input_delay_ns, &dummy, &miso_delay); #if SPI_LL_SUPPORT_TIME_TUNING - const int freq_limit = spi_hal_get_freq_limit(timing_param->use_gpio, timing_param->input_delay_ns); - if (!(timing_param->half_duplex || dummy == 0 || timing_param->no_compensate)) { - // This only a short log used as a "key" of the idf hint system, see `hints.yml` + // Short log used as a "key" by the idf hint system (see `hints.yml`). + // freq_limit is consumed only by HAL_EARLY_LOGE; mark unused so + // -Wunused-variable stays quiet when the macro expands to empty. + const int freq_limit __attribute__((unused)) = + spi_hal_get_freq_limit(timing_param->use_gpio, timing_param->input_delay_ns); HAL_EARLY_LOGE(SPI_HAL_TAG, "The clock_speed_hz should less than %d", freq_limit); return ESP_ERR_NOT_SUPPORTED; }