From: whitequark Date: Sun, 26 Jul 2015 09:55:52 +0000 (+0300) Subject: Add a stub getenv() implementation. X-Git-Tag: 24jan2021_ls180~2183 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=24463a168a84bdc4d8d8e5664ea211a4b91c6813;p=litex.git Add a stub getenv() implementation. This is not strictly necessary to build libunwind (it can be built with -DNDEBUG), but it will be handy while it is debugged. It can be removed afterwards. --- diff --git a/software/libbase/Makefile b/software/libbase/Makefile index c1f2434d..35f92f65 100644 --- a/software/libbase/Makefile +++ b/software/libbase/Makefile @@ -1,7 +1,7 @@ MSCDIR=../.. include $(MSCDIR)/software/common.mak -OBJECTS=exception.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o spiflash.o +OBJECTS=exception.o libc.o errno.o crc16.o crc32.o console.o environ.o system.o id.o uart.o time.o qsort.o strtod.o spiflash.o all: crt0-$(CPU).o libbase.a libbase-nofloat.a diff --git a/software/libbase/environ.c b/software/libbase/environ.c new file mode 100644 index 00000000..2c2c92f0 --- /dev/null +++ b/software/libbase/environ.c @@ -0,0 +1,11 @@ +#include +#include + +char *getenv(const char *varname) { + if(!strcmp(varname, "LIBUNWIND_PRINT_APIS") || + !strcmp(varname, "LIBUNWIND_PRINT_UNWINDING")) { + return "1"; + } else { + return NULL; + } +}