diff --git a/lib/Makefile b/lib/Makefile index 1b02e98ea1f..287ff74ba45 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -5,6 +5,15 @@ endif ifdef CONFIG_NEWLIB_LIBC ZEPHYRINCLUDE += $(TOOLCHAIN_CFLAGS) ALL_LIBS += m c + +ifdef CONFIG_NEWLIB_LIBC_FLOAT_PRINTF +LDFLAGS += -u _printf_float +endif + +ifdef CONFIG_NEWLIB_LIBC_FLOAT_SCANF +LDFLAGS += -u _scanf_float +endif + endif include $(srctree)/lib/iot/Makefile diff --git a/misc/Kconfig b/misc/Kconfig index 14a80176fa0..320fb7e6b2a 100644 --- a/misc/Kconfig +++ b/misc/Kconfig @@ -123,6 +123,21 @@ config NEWLIB_LIBC endchoice +config NEWLIB_LIBC_FLOAT_PRINTF + bool "Build with newlib float printf" + default n + depends on NEWLIB_LIBC + help + Build with floating point printf enabled. This will increase the size of + the image. + +config NEWLIB_LIBC_FLOAT_SCANF + bool "Build with newlib float scanf" + default n + depends on NEWLIB_LIBC + help + Build with floating point scanf enabled. This will increase the size of + the image. config MINIMAL_LIBC_EXTENDED bool "Build additional libc functions [EXPERIMENTAL]"