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 <stdio-bufio.h> on the host even if CONFIG_LIBC_PICOLIBC is set by
some other build path.
Use real CI config names and minimal config aliases so these tests are
collected and built again instead of silently being skipped.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Made-with: Cursor
The --gc-sections flag in picolibc.specs causes CMake compiler detection
to fail by dropping required data. Work around this by creating a modified
specs file without the flag.
- Also fixed an issue where NewLib ROM APIs, when called from TEE, were
using the syscall table located in the REE SRAM. This could be abused
as an attack vector to invoke illegal functions from the TEE.
To prevent this, the syscall table is now switched to the TEE-specific
copy during every M-U mode transition.
This change improves build consistency across external projects integrated
through CMake by ensuring that compiler flags defined in configuration files
are passed correctly to the toolchain. It covers the majority of use cases,
as external projects are typically also CMake-based. For projects that use
a custom build system, users will still need to specify the required flags
manually.
The esp_libc relies on the stdio implementation of the vfs component if
CONFIG_VFS_SUPPORT_IO is enabled. This is not an issue in cmakev1
because if the vfs component is not included in the project build, its
configuration is not available, and CONFIG_VFS_SUPPORT_IO is not set.
However, in cmakev2, the configuration for all components is available,
and the presence of some component configuration options does not
necessarily mean that the component is included in the project build.
When esp_libc is compiled without the vfs dependency but with
CONFIG_VFS_SUPPORT_IO enabled, the libc initialization will encounter a
panic due to a NULL pointer dereference (fp->_flags) in __swsetup_r, as
fopen in esp_libc_init_global_stdio will return NULL.