Picolibc now requires to create stdin, stdout and stderr files
ourselves instead of __iob array. Thus changes and renaming
of iob.c to stdio.c
f320a0aa17
added option to select default printf format, so using
picolibc.specs or defining PRINTF_LEVEL is no longer needed.
Use picolibc.specs to specify integer only printf/scanf.
To do that, we need to pass specs file with options to
the linker. With LTO enabled, name mapping was failing,
so LTO is now disabled for picolibc compilation only.
This also means, that exchange.c and arc4random.c no
longer need to be recompiled and added back.
Removed libbase completely and moved remaining files into
libutils, libcomm and libmisc.
Libcomm is place for code used for communicating with other
devices, which doesn't yet live in its own liblite*.
Libutils is code used in multiple places, like crc calculation,
progress bar, memtests.
Libmisc is everything else like sim_debug, which is code for
litex_sim or exception.c for or1k.
Use gcc-ar and gcc-nm, because they have LTO plugins
Turn off LTO for libcompiler_rt, exchange.c and arc4random.c
from newlib.
Also add getentropy, dummy function, because for some reason
libbase/console.c wants it.
Picolibc doesn't maintain meson.build or cross*.txt files
for lm32 and or1k CPUs.
This commit adds meson.build files for both of them.
Also libc/Makefile got modifed to determine CPU family
from $(CPU) value and generate cross.txt file.
Now picolibc gets compiled with LiteX flags too.
It doesn't compile on neither of them yet,
but at least riscv still works.
Picolibc requires __iob array for its IO functions
This commit creates such array with dummy functions
using putchar/readchar from console.c
To prevent name conflicts printf and others were
removed from console.c
Also putchar had to be renamed to base_putchar
Right now it is still limited as it compiles only for one target,
but it should be possible to build BIOS with one command
Tested with digilent_arty.py