newlib/newlib/libc/machine/msp430
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
..
Makefile.am Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
Makefile.in Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
aclocal.m4 2013-12-23 Jeff Johnston <jjohnstn@redhat.com> 2013-12-23 20:45:10 +00:00
configure Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
configure.in Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
setjmp.S * libc/include/complex.h (cabsl): Add prototype. 2015-02-06 16:14:04 +00:00
tiny-printf.c Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00
tiny-puts.c Implement reduced code size "tiny" printf and puts 2019-04-15 14:22:33 +02:00