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.
This commit is contained in:
whitequark 2015-07-26 12:55:52 +03:00
parent b2710e437c
commit 24463a168a
2 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,7 @@
MSCDIR=../.. MSCDIR=../..
include $(MSCDIR)/software/common.mak 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 all: crt0-$(CPU).o libbase.a libbase-nofloat.a

View File

@ -0,0 +1,11 @@
#include <stdlib.h>
#include <string.h>
char *getenv(const char *varname) {
if(!strcmp(varname, "LIBUNWIND_PRINT_APIS") ||
!strcmp(varname, "LIBUNWIND_PRINT_UNWINDING")) {
return "1";
} else {
return NULL;
}
}