Frame pointers are supposed to enable debuggers to reliably tell
where a call comes from. That is defeated by GCC's sibling call
optimization (aka tail recursion elimination).
This patch turns this optimization off when compiling with frame pointers.
Signed-Off-By: Matthias Urlichs <[email protected]>
---
Index: Makefile
===================================================================
--- cf96cb2bd8bb633b174549815ad3c45f65ae2848/Makefile (mode:100644)
+++ df32987da12629d4a4498fc8948bf11b1a49d377/Makefile (mode:100644)
@@ -518,7 +518,7 @@
CFLAGS += $(call add-align,CONFIG_CC_ALIGN_JUMPS,-jumps)
ifdef CONFIG_FRAME_POINTER
-CFLAGS += -fno-omit-frame-pointer
+CFLAGS += -fno-omit-frame-pointer $(call cc-option,-fno-optimize-sibling-calls,)
else
CFLAGS += -fomit-frame-pointer
endif