From: kay.sievers@vrfy.org Date: Wed, 14 Jan 2004 02:48:33 +0000 (-0800) Subject: [PATCH] fix klibc with printf() and gcc X-Git-Tag: 013~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68e07a2b0798bd22554c82496455100f29cf6140;p=systemd [PATCH] fix klibc with printf() and gcc On Mon, Jan 12, 2004 at 05:04:45PM -0800, Greg KH wrote: > Very nice, applied. But I did have to make one small change to get the > code to build properly with klibc: > > > +static void print_record(char *path, struct udevice *dev) > > +{ > > + printf("P: %s\n", path); > > + printf("N: %s\n", dev->name); > > + printf("S: %s\n", dev->symlink); > > + printf("O: %s\n", dev->owner); > > + printf("G: %s\n", dev->group); > > + printf("\n"); > > +} > > Turns out that gcc likes to convert single character printf() calls to > putchar() which is only defined in klibc as a macro :( Just for information. This seems to fix the gcc with klibc :) --- diff --git a/Makefile b/Makefile index 5e641292..a921a22b 100644 --- a/Makefile +++ b/Makefile @@ -133,7 +133,7 @@ ifeq ($(strip $(USE_KLIBC)),true) LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \ -I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -I$(LINUX_INCLUDE_DIR) \ - -D__KLIBC__ + -D__KLIBC__ -fno-builtin-printf LIB_OBJS = LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs else