From: Tom Rini Date: Fri, 24 May 2013 15:16:48 -0400 Subject: [U-Boot] [PATCH v2] spl: Make CONFIG_SPL_BUILD contain more functionality In-Reply-To: <1369422361.15817.16@scott-Lenovo-G560> References: <1368781939-15750-1-git-send-email-ying.zhang@freescale.com> <20130517123425.GO32163@bill-the-cat> <1369422361.15817.16@scott-Lenovo-G560> Message-ID: <20130524191648.GU17119@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, May 24, 2013 at 02:06:01PM -0500, Scott Wood wrote: > On 05/17/2013 07:34:25 AM, Tom Rini wrote: > >On Fri, May 17, 2013 at 05:12:19PM +0800, ying.zhang at freescale.com > >wrote: > > > >> From: Ying Zhang > >> > >> There was some functionality will be used in the SPL. They > >> had been excluded by ifndef CONFIG_SPL_BUILD. Now, put it > >> into the SPL. > >> > >> Signed-off-by: Ying Zhang > >> --- > >> Compared with the previous version, give up new symbol and > >delete the line > >> ifndef CONFIG_SPL_BUILD in common/env_common.c > > > >What the heck is going on? First, you seem to be changing a number of > >checks from !CONFIG_SPL_BUILD to !CONFIG_SPL_NAND_MINIMAL, and > >then stop > >defining CONFIG_SPL_NAND_MINIMAL always and only define it for > >CONFIG_SPL_BUILD. Next, powerpc uses > >-ffunction-sections/-fdata-sections/--gc-sections so outside of > >assembler files, we shouldn't need to be using CONFIG_SPL_BUILD to not > >build something that's a static function. > > gc-sections does not work on anonymous strings. It also doesn't > work to avoid code that doesn't compile due to some missing > dependency (e.g. missing #define). I don't know off the top of my > head if this code falls into one of these categories (I don't even > know what code we're talking about from the context here, without > digging back for the original patch). > > I'm not sure why being a static function matters. Yes, there's a gcc bug (afaict) about strings, and #define-related fail to builds don't work, just unreferenced functions. You do sometimes need/want to whack #ifndef's around static functions for when you have to not define function A because of one of the above fails to be collected, and then you end up with an unused function warning. -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: