newlib-cygwin/newlib/libc
Jozef Lawrynowicz 1e6c561d48 Implement reduced code size "tiny" printf and puts
"tiny" printf is derived from _vfprintf_r in libc/stdio/nano-vfprintf.c.
"tiny" puts has been implemented so that it just calls write, without
any other processing.
Support for buffering, reentrancy and streams has been removed from
these functions to achieve reduced code size.

This reduced code size implementation of printf and puts can be enabled
in an application by passing "--wrap printf" and "--wrap puts" to the
GNU linker. This will replace references to "printf" and "puts" in user
code with "__wrap_printf" and "__wrap_puts" respectively.
If there is no implementation of these __wrap* functions in user code,
these "tiny" printf and puts implementations will be linked into the
final executable.

The wrapping mechanism is supposed to be invisible to the user:
- A GCC wrapper option such as "-mtiny-printf" will be added to alias
  these wrap commands.
- If the user is unaware of the "tiny" implementation, and chooses to
  implement their own __wrap_printf and __wrap_puts, their own
  implementation will be automatically chosen over the "tiny" printf and
  puts from the library.

Newlib must be configured with --enable-newlib-nano-formatted-io for
the "tiny" printf and puts functions to be built into the library.

Code size reduction examples:
printf("Hello World\n")
  baseline - msp430-elf-gcc gcc-8_3_0-release
     text    data     bss
   5638     214      26
  "tiny" puts enabled
    text    data     bss
     714      90      20

printf("Hello %d\n", a)
  baseline - msp430-elf-gcc gcc-8_3_0-release
    text    data     bss
   10916     614      28

  "tiny" printf enabled
    text    data     bss
    4632     280      20
2019-04-15 14:22:33 +02:00
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype update to Unicode 11.0 2019-01-13 23:33:51 +01:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
include Cygwin: add secure_getenv 2019-02-19 13:01:50 -06:00
locale newlib: Drop incorrect const qualifier from __loadlocale parameter 2018-10-10 11:18:20 +02:00
machine Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
misc RISC-V: Do not use _init/_fini 2018-07-30 10:47:57 +02:00
posix scandir: Add support for struct dirent::d_type 2019-02-01 10:37:00 +01:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search search: Fix Berkeley DB hash code for 16-bit targets. 2018-09-06 17:29:49 +02:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00
stdio stdio: drop unused O_TEXT handling on non-Cygwin 2019-02-22 21:58:51 +01:00
stdio64 ansification: remove _EXFNPTR, _EXPARM 2018-01-17 11:47:27 -06:00
stdlib Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
string update to Unicode 11.0 2019-01-13 23:33:51 +01:00
sys Align comments and spaces in libgloss/arm/crt0.S and newlib/libc/sys/arm/crt0.S to ease further code alignment. 2019-04-12 14:34:47 +01:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr xdr_private.h needs sys/types.h for u_char 2018-09-06 14:10:42 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05:00
configure Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
configure.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00