From f4e6e4b2e57ce73e4de3399b650db33565b4f1c2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 5 Sep 2023 14:19:07 -0700 Subject: [PATCH] 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 --- lib/libc/Kconfig | 2 +- lib/libc/picolibc/Kconfig | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index 7c5f92f7e97..c9678adf2c2 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -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 diff --git a/lib/libc/picolibc/Kconfig b/lib/libc/picolibc/Kconfig index b5e1f1bb581..21c6fc38501 100644 --- a/lib/libc/picolibc/Kconfig +++ b/lib/libc/picolibc/Kconfig @@ -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