[U-Boot] [PATCH 1/3] common: add ifdefs around bouncebuf.c body

Stephen Warren swarren at wwwdotorg.org
Tue Nov 6 19:04:34 CET 2012


On 11/05/2012 04:47 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On Mon, Nov 5, 2012 at 3:04 PM, Stephen Warren <swarren at wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren at nvidia.com>
>>
>> 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.
>>
>> Signed-off-by: Stephen Warren <swarren at nvidia.com>
> 
> Acked-by: Simon Glass <sjg at chromium.org>
> 
> This seems like a problem that might come up in other areas. I wonder
> if SPL should have its own autoconf.mk?

That might be a good idea. Is the config.h separate for SPL-vs-non-SPL?
Perhaps it doesn't need to be because it's simply always evaluated at
each individual compile time, whereas perhaps autoconf.mk is generated
once rather than evaluated? As you can tell, I have not looked into this
or most aspects of U-Boot's build system, so I have no idea how feasible
fixing the build system for this would be.


More information about the U-Boot mailing list