From f50ae95ab593c116dc3f089ec0e11514896f00ef Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Thu, 27 Mar 2025 08:11:38 +0100 Subject: [PATCH 1/5] fix(lwip/cmake): avoid using uninitialized srcs variable Currently, lwip's CMakeLists.txt might use an uninitialized srcs value if CONFIG_LWIP_ENABLE is disabled. This means it could use a srcs value set by another component, involving sources that are entirely unrelated to the lwip component during registration. Perhaps we should simply exit when CONFIG_LWIP_ENABLE is not enabled and avoid registering the component altogether. Signed-off-by: Frantisek Hrbata --- components/lwip/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 4daec4c224..0656576f66 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -1,4 +1,5 @@ idf_build_get_property(target IDF_TARGET) +set(srcs "") if(CONFIG_LWIP_ENABLE) if(NOT ${target} STREQUAL "linux") From 56ac76d4d23dc46efee5ee8692ed49bb75baef0e Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Fri, 4 Apr 2025 09:23:34 +0200 Subject: [PATCH 2/5] fix(esp_coex/cmake): avoid using uninitialized srcs variable Signed-off-by: Frantisek Hrbata --- components/esp_coex/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/esp_coex/CMakeLists.txt b/components/esp_coex/CMakeLists.txt index e6f8699772..a1da2af74c 100644 --- a/components/esp_coex/CMakeLists.txt +++ b/components/esp_coex/CMakeLists.txt @@ -1,5 +1,7 @@ idf_build_get_property(idf_target IDF_TARGET) +set(srcs "") + if(${idf_target} STREQUAL "linux") return() # This component is not supported by the POSIX/Linux simulator endif() From 26e49e1e82ddbb4850048ae75a9807a22ce1ecbd Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Fri, 4 Apr 2025 09:24:46 +0200 Subject: [PATCH 3/5] fix(vfs/cmake): avoid using uninitialized sources variable Signed-off-by: Frantisek Hrbata --- components/vfs/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/vfs/CMakeLists.txt b/components/vfs/CMakeLists.txt index 51d7a21dd7..ca4550376a 100644 --- a/components/vfs/CMakeLists.txt +++ b/components/vfs/CMakeLists.txt @@ -7,6 +7,8 @@ if(${target} STREQUAL "linux") return() endif() +set(sources "") + list(APPEND sources "vfs.c" "vfs_eventfd.c" "vfs_semihost.c" From b84e9b69baea08b546e041d271209194ad625495 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Fri, 11 Apr 2025 14:56:06 +0200 Subject: [PATCH 4/5] fix(newlib/cmake): avoid using uninitialized ldfragments variable Signed-off-by: Frantisek Hrbata --- components/newlib/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/components/newlib/CMakeLists.txt b/components/newlib/CMakeLists.txt index 0d23f0f103..99a11e810f 100644 --- a/components/newlib/CMakeLists.txt +++ b/components/newlib/CMakeLists.txt @@ -66,6 +66,7 @@ else() "src/picolibc/open_memstream.c") endif() +set(ldfragments "") list(APPEND ldfragments "src/newlib.lf" "src/system_libs.lf") if(CONFIG_SPIRAM_CACHE_WORKAROUND) From 63b7ae9ad106575ff915846b8a78d27e1aee1222 Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Thu, 17 Apr 2025 10:01:09 +0200 Subject: [PATCH 5/5] fix(esp_common/cmake): do not rely on the target variable being set Signed-off-by: Frantisek Hrbata --- components/esp_common/project_include.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/esp_common/project_include.cmake b/components/esp_common/project_include.cmake index 2665404c50..b50959c509 100644 --- a/components/esp_common/project_include.cmake +++ b/components/esp_common/project_include.cmake @@ -1,6 +1,8 @@ # # Warn if the toolchain version doesn't match # +idf_build_get_property(target IDF_TARGET) + if(NOT (${target} STREQUAL "linux" OR CMAKE_C_COMPILER_ID MATCHES "Clang")) execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpmachine