From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Tue, 15 Oct 2013 10:45:06 +0200 Subject: [U-Boot] [PATCH v2] config.mk: disable -fstack-usage for blackfin and m68k In-Reply-To: <1381825457-25971-1-git-send-email-yamada.m@jp.panasonic.com> References: <1381825457-25971-1-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <20131015104506.7a13444f@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Masahiro, On Tue, 15 Oct 2013 17:24:17 +0900, Masahiro Yamada 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.