X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=klibc%2FMCONFIG;h=d2aa23626c17ff535d991c6db9638345ea022b90;hp=ec8b65c0e4c8a335060e5fa8441f2af5b130f0bc;hb=a0622777688ad84ef3d789e0171cfb0ca3dc21d2;hpb=9e8a3a095d955538acbdf28dba02582f6b2330e5 diff --git a/klibc/MCONFIG b/klibc/MCONFIG index ec8b65c0e..d2aa23626 100644 --- a/klibc/MCONFIG +++ b/klibc/MCONFIG @@ -3,22 +3,29 @@ # 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$(KERNEL_DIR)/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_CFLAGS = -g -O @@ -26,13 +33,13 @@ HOST_LDFLAGS = HOST_LIBS = # Static library paths -CRT0 = $(KLIBSRC)/crt0.o -KLIBC = $(KLIBSRC)/libc.a +CRT0 = $(KLIBOBJ)/crt0.o +KLIBC = $(KLIBOBJ)/libc.a LIBGCC = $(shell $(CC) --print-libgcc) # Shared library paths -CRTSHARED = $(KLIBSRC)/interp.o -LIBSHARED = $(KLIBSRC)/libc.so +CRTSHARED = $(KLIBOBJ)/interp.o +LIBSHARED = $(KLIBOBJ)/libc.so # # This indicates the location of the final version of the shared library. @@ -41,7 +48,15 @@ LIBSHARED = $(KLIBSRC)/libc.so # 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