libc/picolibc: Don't force TLS when using picolibc module

The picolibc module can be built without thread local storage support if
desired. Allow that by using 'imply' instead of 'select'. However, when
using the toolchain picolibc, we assume that TLS will be enabled wherever
supported, so make sure we match by adding a 'select' for this case.

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2023-09-05 14:19:07 -07:00 committed by Carles Cufí
parent 14dccd772d
commit f4e6e4b2e5
2 changed files with 7 additions and 1 deletions

View File

@ -81,7 +81,7 @@ config MINIMAL_LIBC
config PICOLIBC
bool "Picolibc library"
select COMMON_LIBC_ABORT
select THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
imply THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
select LIBC_ERRNO if THREAD_LOCAL_STORAGE
select NEED_LIBC_MEM_PARTITION
imply COMMON_LIBC_MALLOC

View File

@ -13,6 +13,12 @@ config PICOLIBC_USE_MODULE
This is enabled by default for toolchains other than the Zephyr
SDK.
# force TLS when using toolchain with TLS support
config PICOLIBC_USE_TOOLCHAIN
bool
default y if PICOLIBC && !PICOLIBC_USE_MODULE
select THREAD_LOCAL_STORAGE if ARCH_HAS_THREAD_LOCAL_STORAGE && TOOLCHAIN_SUPPORTS_THREAD_LOCAL_STORAGE
config PICOLIBC_HEAP_SIZE
int "[DEPRECATED] Picolibc heap size (bytes)"
default -2