public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired
@ 2013-09-26  2:17 Masahiro Yamada
  2013-09-26 11:52 ` Tom Rini
  0 siblings, 1 reply; 10+ messages in thread
From: Masahiro Yamada @ 2013-09-26  2:17 UTC (permalink / raw)
  To: u-boot

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@jp.panasonic.com>
Cc: Tom Rini <trini@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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-10-15 10:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-26  2:17 [U-Boot] [PATCH] config.mk: enable -fstack-usage only when it is desired Masahiro Yamada
2013-09-26 11:52 ` Tom Rini
2013-09-26 14:32   ` Michal Simek
2013-09-27  2:23     ` Masahiro Yamada
2013-09-27  8:13       ` Michal Simek
2013-09-27  2:09   ` Masahiro Yamada
2013-09-27 17:57     ` Jeroen Hofstee
2013-09-30  8:01       ` Masahiro Yamada
2013-10-08 19:46         ` Jeroen Hofstee
2013-10-15 10:51           ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox