From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 06 Nov 2012 11:07:04 -0700 Subject: [U-Boot] [PATCH 1/3] common: add ifdefs around bouncebuf.c body In-Reply-To: <201211060154.03822.marex@denx.de> References: <1352156642-7975-1-git-send-email-swarren@wwwdotorg.org> <201211060154.03822.marex@denx.de> Message-ID: <509951C8.3070503@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/05/2012 05:54 PM, Marek Vasut wrote: > Dear Stephen Warren, > >> From: Stephen Warren >> >> If a U-Boot config file enables CONFIG_BOUNCE_BUFFER only for the main >> U-Boot build and not for the SPL, then config.mk will contain >> CONFIG_BOUNCE_BUFFER=y, so common/Makefile will build bouncebuf.c for >> both the SPL and main U-Boot, but config.h won't set CONFIG_BOUNCE_BUFFER >> for the SPL, so bouncebuf.h will provide static inline functions, which >> will conflict with the compiled bouncebuf.c. Solve this by guarding the >> body of bouncebuf.c with the ifdef to avoid conflicts. > > Uh, don't you want the bounce buffer not compiled in for SPL? Then maybe add > CONFIG_SPL_BOUNCE_BUFFER to force BB to be compiled into SPL or something ... Not compiling bouncebuf.c for SPL would solve this too. I have no idea what build system contortions would be required to do this though. Do you think the build system should be fixed first rather than taking this series/patch? I guess we shouldn't need a separate CONFIG_SPL_BOUNCE_BUFFER option though; we should rather simply set CONFIG_SPL_BOUNCE_BUFFER appropriately for SPL and non-SPL, and have everything key off that one variable, right?