Compile entire picolibc

It does not compile yet, will need __iob array to be defined
Also there are multiple definitions of some functions
This commit is contained in:
Michal Sieron 2021-07-28 20:06:09 +02:00
parent 514754bedf
commit db390537a9
4 changed files with 9 additions and 73 deletions

View file

@ -36,12 +36,14 @@ def _create_dir(d, remove_if_exists=False):
# Software Packages --------------------------------------------------------------------------------
soc_software_packages = [
# picolibc
"libc",
# Compiler-RT.
"libcompiler_rt",
# LiteX cores.
"libbase",
"libc",
# LiteX Ecosystem cores.
"libfatfs",

View file

@ -1,7 +1,10 @@
include ../include/generated/variables.mak
include $(SOC_DIRECTORY)/software/common.mak
newlib/libc.a:
$(LIBC_DIRECTORY)/do-rv32im-configure $(PICOLIBC_DIRECTORY)
libc.a:
meson $(PICOLIBC_DIRECTORY) \
-Dmultilib=false \
--cross-file "$(LIBC_DIRECTORY)/cross-rv32im.txt"
meson compile
sh $(LIBC_DIRECTORY)/swap_libc.sh
cp newlib/libc.a libc.a

View file

@ -1,11 +0,0 @@
#!/bin/sh
ARCH=riscv64-unknown-elf
DIR=`dirname $0`
meson "$1" \
-Dtests=true \
-Dmultilib=false \
-Dincludedir="picolibc/$ARCH/include" \
-Dlibdir="picolibc/$ARCH/lib" \
--cross-file "$DIR/cross-rv32im.txt" \

View file

@ -1,58 +0,0 @@
#!/bin/sh
AR=riscv64-unknown-elf-ar
for obj in \
vsnprintf.c.o \
vfprintf.c.o \
fputc.c.o \
filestrput.c.o \
dtoa_ryu.c.o \
ryu_table.c.o \
ryu_umul128.c.o \
ryu_log10.c.o \
ryu_log2pow5.c.o \
ryu_pow5bits.c.o \
ryu_divpow2.c.o \
qsort.c.o \
strchr.c.o \
strpbrk.c.o \
strrchr.c.o \
strcpy.c.o \
strncpy.c.o \
strcmp.S.o \
strncmp.c.o \
strcat.c.o \
strncat.c.o \
strlen.c.o \
strnlen.c.o \
strspn.c.o \
memcmp.c.o \
memset.S.o \
memcpy.c.o \
memmove.S.o \
strstr.c.o \
memchr.c.o \
strtoul.c.o \
strtol.c.o \
snprintf.c.o \
sprintf.c.o \
rand.c.o \
srand.c.o \
abort.c.o \
errno.c.o \
strerror.c.o \
strtod.c.o \
ctype_.c.o \
locale.c.o \
mbtowc_r.c.o \
wctomb_r.c.o \
strcasecmp.c.o \
isdigit.c.o \
; do
$AR x "newlib/libc.a" $obj
$AR csr "../libbase/libbase.a" $obj
$AR csr "../libbase/libbase-nofloat.a" $obj
rm $obj
done