From 7e9501fdecdee8151938e624b41978307cadddd2 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Tue, 10 Aug 2010 19:20:53 +0100 Subject: ARM: 6312/1: ftrace: allow building without frame pointers With current gcc, compiling with both -pg and -fomit-frame-pointer is not allowed. However, -pg can be used to build without actually specifying -fno-omit-frame-pointer, upon which the default behaviour for the target will be used. On ARM, it is not possible to build a Thumb-2 kernel with -fno-omit-frame-pointer (FRAME_POINTERS depends on !THUMB2_KERNEL). In order to support ftrace for Thumb-2, we need to be able to allow a combination of FUNCTION_TRACER and !FRAME_POINTER. We do this by omitting -fomit-frame-pointer if ftrace is enabled. Acked-by: Frederic Weisbecker Signed-off-by: Rabin Vincent Signed-off-by: Russell King --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 031b61cb5274f..cd2123b17b6e0 100644 --- a/Makefile +++ b/Makefile @@ -554,8 +554,15 @@ endif ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls else +# Some targets (ARM with Thumb2, for example), can't be built with frame +# pointers. For those, we don't have FUNCTION_TRACER automatically +# select FRAME_POINTER. However, FUNCTION_TRACER adds -pg, and this is +# incompatible with -fomit-frame-pointer with current GCC, so we don't use +# -fomit-frame-pointer with FUNCTION_TRACER. +ifndef CONFIG_FUNCTION_TRACER KBUILD_CFLAGS += -fomit-frame-pointer endif +endif ifdef CONFIG_DEBUG_INFO KBUILD_CFLAGS += -g -- cgit v1.2.3