X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=klibc%2FMCONFIG;h=d2aa23626c17ff535d991c6db9638345ea022b90;hb=6fbecf3547a02be2475f275d6862ed9dcfcce2fe;hp=ed7755b3823264be00834879869be2a0f41baeec;hpb=a41a0e28c2ba0abf99b5e7ea17645ae0e4f05758;p=elogind.git diff --git a/klibc/MCONFIG b/klibc/MCONFIG index ed7755b38..d2aa23626 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -3,30 +3,43 @@ # Makefile configuration, without explicit rules # +# Eventually support separate compilation, but we don't have it yet... +OBJROOT = $(SRCROOT) + ARCH = $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) CROSS = CC = $(CROSS)gcc LD = $(CROSS)ld KLIBSRC = $(SRCROOT)/klibc -REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -I$(KLIBSRC) \ - -I$(KLIBSRC)/arch/$(ARCH)/include \ - -I$(KLIBSRC)/include/bits$(BITSIZE) \ - -D__KLIBC__ -DBITSIZE=$(BITSIZE) -I$(KLIBSRC)/include \ - -I$(SRCROOT)/linux/include +KLIBOBJ = $(OBJROOT)/klibc +REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include \ + -D__KLIBC__ -DBITSIZE=$(BITSIZE) \ + -I$(SRCROOT)/include/arch/$(ARCH) \ + -I$(SRCROOT)/include/bits$(BITSIZE) \ + -I$(SRCROOT)/include \ + -I$(SRCROOT)/linux/include -I$(SRCROOT)/linux/include2 + LDFLAGS = AR = $(CROSS)ar RANLIB = $(CROSS)ranlib NM = $(CROSS)nm PERL = perl STRIP = $(CROSS)strip --strip-all -R .comment -R .note +OBJCOPY = $(CROSS)objcopy HOST_CC = gcc -HOST_LDFLAGS = -s +HOST_CFLAGS = -g -O +HOST_LDFLAGS = HOST_LIBS = -CRT0 = $(KLIBSRC)/crt0.o -KLIBC = $(KLIBSRC)/libc.a -LIBGCC = $(shell $(CC) --print-libgcc) +# Static library paths +CRT0 = $(KLIBOBJ)/crt0.o +KLIBC = $(KLIBOBJ)/libc.a +LIBGCC = $(shell $(CC) --print-libgcc) + +# Shared library paths +CRTSHARED = $(KLIBOBJ)/interp.o +LIBSHARED = $(KLIBOBJ)/libc.so # # This indicates the location of the final version of the shared library. @@ -35,7 +48,15 @@ LIBGCC = $(shell $(CC) --print-libgcc) # SHLIBDIR = /lib +# Enable this to make perror/strerror return real error messages +# This makes klibc.so and any static binary which uses these functions +# about 4K bigger. +ERRLIST = 1 + # # Include arch-specific rule fragments # include $(KLIBSRC)/arch/$(ARCH)/MCONFIG + +# How to tell the linker main() is the entrypoint +EMAIN ?= -e main