From 6317c82f063f1e1d165ac08c1cd2a0c3ea381f8d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 28 Jan 2020 09:58:56 -0600 Subject: [PATCH] toolchain: Have Kconfig NEWLIB_LIBC_NANO depend on toolchain support Introduce HAS_NEWLIB_LIBC_NANO Kconfig option that the toolchain specific Kconfig (gnuarmemb & zephyr 0.11) can select to convey that the feature is supported. This removes the need to if protect the NEWLIB_LIBC_NANO Kconfig with: if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "gnuarmemb" Signed-off-by: Kumar Gala --- cmake/toolchain/gnuarmemb/Kconfig | 1 + cmake/toolchain/zephyr/0.11/Kconfig | 1 + lib/libc/Kconfig | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/toolchain/gnuarmemb/Kconfig b/cmake/toolchain/gnuarmemb/Kconfig index 42e08668829..c233f4826e9 100644 --- a/cmake/toolchain/gnuarmemb/Kconfig +++ b/cmake/toolchain/gnuarmemb/Kconfig @@ -5,3 +5,4 @@ config TOOLCHAIN_GNUARMEMB def_bool y + select HAS_NEWLIB_LIBC_NANO diff --git a/cmake/toolchain/zephyr/0.11/Kconfig b/cmake/toolchain/zephyr/0.11/Kconfig index 3a3d8b62680..1d7081469c3 100644 --- a/cmake/toolchain/zephyr/0.11/Kconfig +++ b/cmake/toolchain/zephyr/0.11/Kconfig @@ -5,3 +5,4 @@ config TOOLCHAIN_ZEPHYR_0_11 def_bool y + select HAS_NEWLIB_LIBC_NANO diff --git a/lib/libc/Kconfig b/lib/libc/Kconfig index e4c60aac7ad..7544fb25faf 100644 --- a/lib/libc/Kconfig +++ b/lib/libc/Kconfig @@ -38,17 +38,19 @@ config EXTERNAL_LIBC endchoice # LIBC_IMPLEMENTATION +config HAS_NEWLIB_LIBC_NANO + bool + if NEWLIB_LIBC -if "$(ZEPHYR_TOOLCHAIN_VARIANT)" = "gnuarmemb" config NEWLIB_LIBC_NANO bool "Build with newlib-nano C library" + depends on HAS_NEWLIB_LIBC_NANO default y help Build with newlib-nano library, for small embedded apps. The newlib-nano library for ARM embedded processors is a part of the GNU Tools for ARM Embedded Processors. -endif config NEWLIB_LIBC_ALIGNED_HEAP_SIZE int "Newlib aligned heap size"