diff options
| author | Jeremy Katz <katzj@redhat.com> | 2002-10-23 16:47:34 +0000 |
|---|---|---|
| committer | Jeremy Katz <katzj@redhat.com> | 2002-10-23 16:47:34 +0000 |
| commit | 4a4e802734e033b38bcc6e9d52dddc7df5a9af1f (patch) | |
| tree | 508e674ecab2dfa93c9b14bdc951c74a70666633 /loader | |
| parent | ab76ae268d8b78cad2f71908770e4b967e29ed37 (diff) | |
make ppc use diet
define memcmp and memset instead of depending on implicit declarations
patches from dan burcaw (dburcaw@terrasoftsolutions.com)
Diffstat (limited to 'loader')
| -rw-r--r-- | loader/Makefile | 21 | ||||
| -rw-r--r-- | loader/minilibc.c | 19 | ||||
| -rw-r--r-- | loader/minilibc.h | 2 |
3 files changed, 40 insertions, 2 deletions
diff --git a/loader/Makefile b/loader/Makefile index 037029d8e..91ca55e3d 100644 --- a/loader/Makefile +++ b/loader/Makefile @@ -10,10 +10,12 @@ NEWTLIB = ../mininewt/libnewt.a ifneq (ia64, $(ARCH)) ifneq (i386, $(ARCH)) ifneq (x86_64, $(ARCH)) +ifneq (ppc, $(ARCH)) OBJS += fnmatch-stub.o printf-stub.o pwd-stub.o dl-stub.o endif endif endif +endif LOADEROBJS = loader.o loader-pcmcia.o popen.o SOURCES = $(subst .o,.c,$(OBJS)) loader.c @@ -88,8 +90,8 @@ OBJS += stubs.o endif ifeq (ppc, $(ARCH)) -BINS += loader -OBJS += stubs.o +BINS += loader loader-local loader-network +OBJS += dietstubs.o ctype.o endif ifeq (.depend,$(wildcard .depend)) @@ -122,11 +124,26 @@ LDFLAGS = -nostdlib /usr/lib/crt1.o LOADERLIBS += -lresolv STATIC=-static else +ifeq (ppc, $(ARCH)) +MINILIBC=MINILIBC.o +COPTS+=-DUSE_MINILIBC=1 -DUSE_LOGDEV +LDFLAGS = -nostdlib /usr/lib/crt1.o +LOADERLIBS += -lrpc +ISYS = ../isys/libisys-diet.a +SLANGLIB = ../minislang/libslang-diet.a +NEWTLIB = ../mininewt/libnewt-diet.a +GUNZIP = ../isys/gzlib/libgunzip-diet.a +DIET=diet +REALCC=gcc +CC=$(DIET) $(REALCC) +STATIC=-static +else CFLAGS+=-DUSE_MINILIBC=0 STATIC=-static LOADERLIBS += -lresolv endif endif +endif LANGS = $(shell awk '{ print $$2 }' ../lang-table | egrep -v '(^en$$)') diff --git a/loader/minilibc.c b/loader/minilibc.c index 85ec3c0ff..a08711b30 100644 --- a/loader/minilibc.c +++ b/loader/minilibc.c @@ -212,3 +212,22 @@ void printf(char * fmt, ...) { } } +int memcmp(const void *dst, const void *src, size_t count) { + int r; + const char *d=dst; + const char *s=src; + while (count--) { + if ((r=(*d - *s))) + return r; + ++d; + ++s; + } + return 0; +} + +void* memset(void * dst, int s, size_t count) { + char * a = dst; + while (count--) + *a++ = s; + return dst; +} diff --git a/loader/minilibc.h b/loader/minilibc.h index 1f21f177d..16eb423b5 100644 --- a/loader/minilibc.h +++ b/loader/minilibc.h @@ -230,5 +230,7 @@ void printint(int i); void printf(char * fmt, ...); char * strchr(char * str, int ch); char * strncpy(char * dst, const char * src, size_t len); +int memcmp(const void *dst, const void *src, size_t count); +void* memset(void * dst, int s, size_t count); void printstr(char * string); |
