newlib-cygwin/newlib/libc/machine
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
..
a29k Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
aarch64 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
amdgcn Add missing includes. 2019-03-25 16:44:10 +01:00
arc Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
arm Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
bfin Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
cr16 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
cris Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
crx Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
d10v Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
d30v Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
epiphany Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
fr30 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
frv Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
ft32 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
h8300 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
h8500 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
hppa Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
i386 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
i960 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
iq2000 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
lm32 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
m32c Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
m32r Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
m68hc11 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
m68k Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
m88k Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
mep Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
microblaze Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
mips Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
mn10200 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
mn10300 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
moxie Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
msp430 Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
mt Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
nds32 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
necv70 Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
nios2 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
nvptx Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
or1k Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
powerpc Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
riscv Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
rl78 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
rx Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
sh Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
sparc Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
spu Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
tic4x Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
tic6x Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
tic80 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
v850 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
visium Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
w65 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
x86_64 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
xc16x Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
xscale Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
xstormy16 Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
z8k Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
Makefile.am Make newlib manpages (v3) 2016-07-04 14:17:10 +01:00
Makefile.in Regenerate newlib Makefiles 2016-07-04 17:13:55 +01:00
aclocal.m4 2012-12-20 Jeff Johnston <jjohnstn@redhat.com> 2012-12-20 21:10:27 +00:00
configure AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00
configure.in AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00