diff options
author | Juro Bystricky <juro.bystricky@intel.com> | 2016-11-08 10:35:49 -0800 |
---|---|---|
committer | Anas Nashif <nashif@linux.intel.com> | 2016-11-09 02:47:43 +0000 |
commit | f3bf5abd52b9459b22fd0849b72029a58e7ea17a (patch) | |
tree | 9ac3c07bc4adbbf9dc86471e29e66dd35c4d116d /misc | |
parent | cc9cdadeaedd349cce602763bd423d7387250c64 (diff) |
newlib: add support for nano-formatted-io
If newlib is configured with --enable-newlib-nano-formatted-io,
floating-point support is split out of the formatted I/O code into
weak functions which are not linked by default. This leads to a smaller
code by about 16~20k when using newlib "printf" and/or "sscanf" but not
using floating point I/O.
Programs that need floating-point I/O support must explicitly request
linking of one or both of the floating-point functions:
_printf_float or _scanf_float.
This can be done at link time using the -u option which can be passed
to either gcc or ld.
Implemented via new configuration options:
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF
CONFIG_NEWLIB_LIBC_FLOAT_SCANF
Change-Id: I57f9d9f02e6d21d6011d14de7153b1d3ba6f6e32
Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/Kconfig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/misc/Kconfig b/misc/Kconfig index 14a80176f..320fb7e6b 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]" |