gcc: build with -fstack-usage

will generate an extra file that specifies the maximum amount
of stack used, on a per-function basis.

Using a static stack checker the data can be analysed, for example:
   http://dlbeer.co.nz/oss/avstack.html

Change-Id: I23bd8ce7c4516bd0c7ffb74504e6d379677f25f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2015-10-14 11:03:41 -04:00
commit 20439b488e

View file

@ -670,6 +670,10 @@ KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# generate an extra file that specifies the maximum amount of stack used,
# on a per-function basis.
KBUILD_CFLAGS += $(call cc-option,-fstack-usage)
# conserve stack if available
KBUILD_CFLAGS += $(call cc-option,-fconserve-stack)