Makefile: add a new script to check -fstack-usage support

If -fstack-usage option is given to crosstools
that do not support it, gcc displays a warning message
but still exits with status 0.

This means we can not rely on $(call cc-option,...)
to detect if -fstack-usage option is supported or not.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
diff --git a/Makefile b/Makefile
index ed7c6a0..d187e6b 100644
--- a/Makefile
+++ b/Makefile
@@ -547,7 +547,9 @@
 KBUILD_AFLAGS	+= -g
 
 # Report stack usage if supported
-KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
+ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-stack-usage.sh $(CC)),y)
+	KBUILD_CFLAGS += -fstack-usage
+endif
 
 KBUILD_CFLAGS += $(call cc-option,-Wno-format-nonliteral)