From 01dd2f0897f34edf728d3f7e7cb2f9a06e5af997 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 25 Jul 2023 09:27:58 -0700 Subject: [PATCH] libc: picolibc: extend support beyond Zephyr SDK The picolibc kconfigs were tied to ZEPHYR_TOOLCHAIN_VARIANT and it only supported the Zephyr SDK, which is the only toolchain having picolibc built-in at the moment. This commit generalizes that to use TOOLCHAIN_HAS_PICOLIBC cmake variable the same way as newlib: TOOLCHAIN_HAS_NEWLIB. This provides the ability for other toolchains to declare their support for picolibc. Signed-off-by: Daniel Leung --- lib/libc/Kconfig | 4 ++-- lib/libc/picolibc/Kconfig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index 522bd4a57b3..7febf1574d4 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -35,8 +35,8 @@ config NEWLIB_LIBC_SUPPORTED config PICOLIBC_SUPPORTED bool depends on !NATIVE_APPLICATION - depends on ("$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr") || (NATIVE_LIBRARY) - depends on !(CPP && "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "zephyr") + depends on ("$(TOOLCHAIN_HAS_PICOLIBC)" = "y") || (NATIVE_LIBRARY) + depends on !(CPP && ("$(TOOLCHAIN_HAS_PICOLIBC)" = "y")) default y select FULL_LIBC_SUPPORTED help diff --git a/lib/libc/picolibc/Kconfig b/lib/libc/picolibc/Kconfig index 659cbf41db6..8f7dc9e21bf 100644 --- a/lib/libc/picolibc/Kconfig +++ b/lib/libc/picolibc/Kconfig @@ -5,7 +5,7 @@ if PICOLIBC config PICOLIBC_USE_MODULE bool "Picolibc as module" - default y if "$(ZEPHYR_TOOLCHAIN_VARIANT)" != "zephyr" + default y if "$(TOOLCHAIN_HAS_PICOLIBC)" != "y" depends on ZEPHYR_PICOLIBC_MODULE depends on !GLIBCXX_LIBCPP help