[U-Boot] [PATCH v2] config.mk: disable -fstack-usage for blackfin and m68k

Albert ARIBAUD albert.u.boot at aribaud.net
Tue Oct 15 10:45:06 CEST 2013


Hi Masahiro,

On Tue, 15 Oct 2013 17:24:17 +0900, Masahiro Yamada
<yamada.m at jp.panasonic.com> wrote:

> Currently gcc does not seem to support -fstack-usage option
> for some targets, such as blackfin and m68k.
> 
> 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.
> 
> Adding -Werror option to cc-option function does not work either,
> because gcc always succeeds in compiling /dev/null input
> with -fstack-usage option.
> We cannot rely on cc-option.
> 
> To suppress warnings for such targets that -fstack-usage is not supported,
> this commit surrounds the concerned lines with
> ifdef CONFIG_CC_STACKUSAGE .. endif.
> And it adds CONFIG_CC_STACKUSAGE=y to arch/${ARCH}/config.mk
> except blackfin and m68k.

Please keep the commit message to a (short) description of the patch,
and move the rationale to a comment below the '---' line.

Also: what is the benefit of creating an elaborate mechanism to hide
a warning message that says the option is useless, IOW, wouldn't it be
simpler to only specify -fstack-usage to the arches that support it?

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list