From 09e08414c6ac42837428f4b046afcec82cf5a197 Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Thu, 31 Jul 2014 14:29:48 +1000 Subject: Build with -ffreestanding so we can override printf It turns out that GCC will use a builtin printf implementation that directly wraps vfprintf (or something), so when I tried to do my neat trick of overriding printf() with a call to vprlog() adding the timebase and default log level to the log message, it wouldn't work as GCC was being helpful. This change to compiler options will mean that other places where GCC is being helpful and using builtins rather than our implementations will go away, potentially helping/hurting us. We probably want to build with -ffreestanding anyway though. Signed-off-by: Stewart Smith Signed-off-by: Benjamin Herrenschmidt --- Makefile.main | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Makefile.main') diff --git a/Makefile.main b/Makefile.main index 884c0c2..7810058 100644 --- a/Makefile.main +++ b/Makefile.main @@ -45,10 +45,10 @@ endif CPPFLAGS += -D__SKIBOOT__ -nostdinc CPPFLAGS += -isystem $(shell $(CC) -print-file-name=include) CPPFLAGS += -DBITS_PER_LONG=64 -m64 -DHAVE_BIG_ENDIAN -# Ideally we want -ffreestanding and remove our copy of stdint.h +# We might want to remove our copy of stdint.h # but that means uint64_t becomes an ulong instead of an ullong -# causing all our printf's to warn ... so leave that alone for now -#CPPFLAGS += -ffreestanding +# causing all our printf's to warn +CPPFLAGS += -ffreestanding CFLAGS := -fno-strict-aliasing -fno-stack-protector -pie CFLAGS += $(CWARNS) $(OPTS) $(DBG) -- cgit v1.1