From ba1d20f2ad51ede5a701e5cd14ecf735e2c36a56 Mon Sep 17 00:00:00 2001 From: Michal Sieron Date: Mon, 2 Aug 2021 10:32:29 +0200 Subject: [PATCH] Add missing functions to make lm32 and or1k link I added missing.c with functions that were preventing LiteX from successfull linking on lm32 and or1k. --- litex/soc/software/libc/Makefile | 6 +++--- litex/soc/software/libc/missing.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 litex/soc/software/libc/missing.c diff --git a/litex/soc/software/libc/Makefile b/litex/soc/software/libc/Makefile index fe8416dee..dd516df1e 100644 --- a/litex/soc/software/libc/Makefile +++ b/litex/soc/software/libc/Makefile @@ -1,7 +1,7 @@ include ../include/generated/variables.mak include $(SOC_DIRECTORY)/software/common.mak -all: libc.a iob.c.o +all: libc.a iob.c.o missing.c.o CPUFAMILY= @@ -56,7 +56,7 @@ libc.a: cross.txt $(PICOLIBC_DIRECTORY)/newlib/libc/machine/$(CPUFAMILY)/meson.b meson compile cp newlib/libc.a libc.a -iob.c.o: $(LIBC_DIRECTORY)/iob.c +%.o: $(LIBC_DIRECTORY)/% $(compile) - $(AR) csr libc.a iob.c.o + $(AR) csr libc.a $@ diff --git a/litex/soc/software/libc/missing.c b/litex/soc/software/libc/missing.c new file mode 100644 index 000000000..0a88ec663 --- /dev/null +++ b/litex/soc/software/libc/missing.c @@ -0,0 +1,12 @@ +int getpid() { + return 1; +} + +int kill(int pid, int name) { + _exit(0); +} + +void _exit(int code) { + while (1); +} +