From a0a388289747744596403d7404c07d743b88e631 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 17 Apr 2026 08:43:05 +0200 Subject: [PATCH] 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"