[U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired

Masahiro Yamada yamada.m at jp.panasonic.com
Thu Sep 26 04:17:46 CEST 2013


As far as I know, gcc does not support -fstack-usage
for some targets such as blackfin, m68k, microblaze, etc.

If -fstack-usage option is given for those targets,
gcc displays a warning message as follows:

    warning: -fstack-usage not supported for this target [enabled by default]

But it still exits with status 0.

So,

    # Report stack usage if supported
    CFLAGS_STACK := $(call cc-option,-fstack-usage)
    CFLAGS += $(CFLAGS_STACK)

does not work as we expect because cc-option sees exit status
to judge whether the given option is supported or not.

To suppress warnings for such targets that -fstack-usage is not supported,
this commit surrounds the concerned lines with
ifdef CONFIG_CC_STACKUSAGE .. endif.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
Cc: Tom Rini <trini at ti.com>
---
 config.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/config.mk b/config.mk
index 48913f6..d405ab4 100644
--- a/config.mk
+++ b/config.mk
@@ -278,9 +278,9 @@ CFLAGS_WARN := $(call cc-option,-Wno-format-nonliteral) \
 	       $(call cc-option,-Wno-format-security)
 CFLAGS += $(CFLAGS_WARN)
 
-# Report stack usage if supported
-CFLAGS_STACK := $(call cc-option,-fstack-usage)
-CFLAGS += $(CFLAGS_STACK)
+ifdef CONFIG_CC_STACKUSAGE
+CFLAGS += $(call cc-option,-fstack-usage)
+endif
 
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 
-- 
1.8.1.2



More information about the U-Boot mailing list