From 35bb5b1e0e84cfa1a8906f7e6a77f391ff315791 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Fri, 22 Feb 2008 15:15:03 +0100 Subject: Add option to enable -Wframe-larger-than= on gcc 4.4 Add option to enable -Wframe-larger-than= on gcc 4.4 gcc mainline (upcoming 4.4) added a new -Wframe-larger-than=... option to warn at build time about too large stack frames. Add a config option to enable this warning, since this very useful for the kernel. I choose (somewhat arbitarily) 2048 as default warning threshold for 64bit and 1024 as default for 32bit architectures. With some research and fixing all the code for smaller values these defaults should be probably lowered. With the default allyesconfigs have some new warnings, but I think that is all code that should be just fixed. At some point (when gcc 4.4 is released and widely used) this should obsolete make checkstack Signed-off-by: Andi Kleen Signed-off-by: Sam Ravnborg --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 6ae7fd4475b..c6d331ba140 100644 --- a/Makefile +++ b/Makefile @@ -507,6 +507,10 @@ else KBUILD_CFLAGS += -O2 endif +ifneq (CONFIG_FRAME_WARN,0) +KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN}) +endif + # Force gcc to behave correct even for buggy distributions # Arch Makefiles may override this setting KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector) -- cgit v1.2.3