[PATCH 03/10] ftrace: allow building without frame pointers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rabin Vincent
Date: Friday, March 12, 2010 - 11:49 pm

With current gcc, compiling with both -pg and -fomit-frame-pointer is
not allowed.  However, -pg can be used to build without actually
specying -fno-omit-frame-pointer, upon which the defaut 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 <fweisbec@gmail.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
---
v2: Better comment.

 Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 08ff02d..61404e0 100644
--- a/Makefile
+++ b/Makefile
@@ -546,8 +546,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
-- 
1.7.0

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/10] ARM: ftrace: document mcount formats, Rabin Vincent, (Fri Mar 12, 11:49 pm)
[PATCH 03/10] ftrace: allow building without frame pointers, Rabin Vincent, (Fri Mar 12, 11:49 pm)
[PATCH 05/10] ARM: ftrace: add ENDPROC annotations, Rabin Vincent, (Fri Mar 12, 11:49 pm)
[PATCH 06/10] ARM: ftrace: add Thumb-2 support, Rabin Vincent, (Fri Mar 12, 11:49 pm)
[PATCH 08/10] ARM: ftrace: fix and update dynamic ftrace, Rabin Vincent, (Fri Mar 12, 11:49 pm)
[PATCH 10/10] ARM: ftrace: enable dynamic ftrace, Rabin Vincent, (Fri Mar 12, 11:49 pm)
Re: [PATCH 05/10] ARM: ftrace: add ENDPROC annotations, Russell King - ARM Linux, (Sat Mar 13, 1:45 am)
Re: [PATCH 08/10] ARM: ftrace: fix and update dynamic ftrace, Steven Rostedt, (Sat Mar 13, 10:42 am)
Re: [PATCH 06/10] ARM: ftrace: add Thumb-2 support, Catalin Marinas, (Sun Mar 14, 3:30 pm)
Re: [PATCH 06/10] ARM: ftrace: add Thumb-2 support, Rabin Vincent, (Mon Mar 15, 11:32 am)
Re: [PATCH 06/10] ARM: ftrace: add Thumb-2 support, Catalin Marinas, (Tue Mar 16, 3:23 am)
Re: [PATCH 06/10] ARM: ftrace: add Thumb-2 support, Rabin Vincent, (Wed Mar 31, 11:25 am)
Re: [PATCH 05/10] ARM: ftrace: add ENDPROC annotations, Rabin Vincent, (Wed Apr 21, 12:23 pm)
Re: [PATCH 06/10] ARM: ftrace: add Thumb-2 support, Catalin Marinas, (Fri Apr 23, 8:37 am)
Re: [PATCH 07/10] ftrace: pass KBUILD_CFLAGS to record_mco ..., Frederic Weisbecker, (Fri Aug 6, 8:31 am)
Re: [PATCH 05/10] ARM: ftrace: add ENDPROC annotations, Catalin Marinas, (Tue Aug 10, 10:07 am)
Re: [PATCH 05/10] ARM: ftrace: add ENDPROC annotations, Rabin Vincent, (Tue Aug 10, 12:11 pm)