newlib: fix conflicting configure options

Configuring the newlib with "--enable-newlib-nano-formatted-io" and
"--enable-newlib-io-pos-args" would cause built GCC cannot compile some
IO functions like "std::cout".

And I added additional notes at Nano Formatted I/O config.

Signed-off-by: Chen Tao <t.clydechen@gmail.com>
This commit is contained in:
Chen Tao 2022-06-27 17:13:18 +09:00 committed by Chris Packham
parent b9ee00e3cb
commit 75c8a08a3a

View File

@ -55,6 +55,7 @@ config LIBC_NEWLIB_IO_LDBL
config LIBC_NEWLIB_IO_POS_ARGS
bool
prompt "Enable printf-family positional arg support"
depends on !LIBC_NEWLIB_NANO_FORMATTED_IO
help
Enable printf-family positional arg support.
@ -199,6 +200,29 @@ config LIBC_NEWLIB_NANO_FORMATTED_IO
with size constraint issues. This option does not affect wide-char
formatted I/O functions.
Some notes about this feature:
1) Floating-point support is split out of the formatted I/O code into
weak functions which are not linked by default. 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.
2) The following configuration options are ignored for non-wide-char
formatted I/O functions, and can be thought of as disabled.
"Enable printf-family positional arg support"
"Enable IOs on C99 formats"
"Enable IOs on long long"
"Enable IOs on long doubles"
Additionally, "Enable IOs on floats and doubles" is supported in this
specific implementation, one can disable it to further reduce code size.
In this case, the floating-point specifiers will not be recognized or
handled, and the -u option will not work either.
Learn more: https://sourceware.org/newlib/README
config LIBC_NEWLIB_EXTRA_CONFIG_ARRAY
string
prompt "Extra config for newlib"