feat(libc): pass __PICOLIBC_ERRNO_FUNCTION to picolibc builds

This commit is contained in:
Alexey Lapshin
2026-08-05 16:45:09 +07:00
parent 0c1e6bd965
commit 0c28bbe3f8
4 changed files with 13 additions and 5 deletions
+2 -3
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2025-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -12,11 +12,10 @@
* 'errno' is defined in the TDATA section. The linker script ensures that
* it is positioned at the beginning of the TDATA segment.
*/
#undef errno
__thread int errno __attribute__((section(".tdata.errno"))) = 0;
#if CONFIG_LIBC_PICOLIBC_NEWLIB_COMPATIBILITY
int *__errno(void)
{
return &errno;
}
#endif