build: Add support for TCC in RISC-V.

For RISC-V TCC needs a modified libc because it doesn't support Extended
Assembly. This change enables that kind of behavior, letting us select
the TCC library when it is present.

* build-aux/bootstrap.sh.in: Add a block to build-source-lib for TCC.
* build-aux/configure-lib.sh: Guard TCC to remove repeated definitions
from its libc.
* build-aux/install.sh.in: Make it install TCC's library, too
This commit is contained in:
Ekaitz Zarraga 2023-11-05 13:28:43 +01:00 committed by Janneke Nieuwenhuizen
parent f9efe47257
commit b71e5d1e2c
3 changed files with 22 additions and 0 deletions

View file

@ -142,3 +142,14 @@ cp bin/mes-mescc bin/mes
fi fi
@SHELL@ ${srcdest}build-aux/build-source-lib.sh @SHELL@ ${srcdest}build-aux/build-source-lib.sh
) )
(
mkdir -p tcc-lib
cp config.sh tcc-lib
cd tcc-lib
compiler=tcc
if test -z "$srcdest"; then
srcdest=../
srcdir=../
fi
${SHELL} ${srcdest}build-aux/build-source-lib.sh
)

View file

@ -108,8 +108,16 @@ lib/mes/ntoab.c
lib/mes/oputc.c lib/mes/oputc.c
lib/mes/ultoa.c lib/mes/ultoa.c
lib/mes/utoa.c lib/mes/utoa.c
"
# /include/mes/lib-cc.h already defines __raise.c as a macro for __TCC__
# if we include it in the target source lib it explodes when reading the
# function definition
if test $compiler != tcc; then
libmes_SOURCES="$libmes_SOURCES
lib/stub/__raise.c lib/stub/__raise.c
" "
fi
if test $mes_libc = mes; then if test $mes_libc = mes; then
libmes_SOURCES="$libmes_SOURCES libmes_SOURCES="$libmes_SOURCES

View file

@ -114,6 +114,9 @@ fi
if test -d mescc-lib/$mes_cpu-mes; then if test -d mescc-lib/$mes_cpu-mes; then
tar -cf- -C mescc-lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir tar -cf- -C mescc-lib $mes_cpu-mes | tar -${v}xf- -C $DESTDIR$libdir
fi fi
if test -d tcc-lib/$mes_cpu-mes; then
tar -cf- -C tcc-lib/$mes_cpu-mes . | tar -${v}xf- -C $DESTDIR$libdir
fi
mkdir -p ${DESTDIR}${guile_site_dir} mkdir -p ${DESTDIR}${guile_site_dir}
mkdir -p ${DESTDIR}${guile_site_ccache_dir} mkdir -p ${DESTDIR}${guile_site_ccache_dir}