[U-Boot] Build breakage due to "Standalone Apps: Standalone apps should only need exports.h"

Mike Partington mparting at lexmark.com
Wed Dec 7 20:56:30 CET 2011


As I understand it, one of the main purposes of standalone applications is
to enable proprietary code to be run with U-Boot.  In order to realize this
objective, however, the code cannot be forced to include anything that is
GPL-encumbered.  Note that spi.h does not meet this criteria.  So, either
spi.h needs to be changed, or the spi interfaces need to be added to
exports.h in a way that does not require any additional typedefs or
structures from other files.  I'm not sure which path is best, but my
preference would be to keep the interface between standalone applications
and U-Boot as clean and well-defined as possible.  To me this means as few
files as possible.

Regards,
Mike Partington

On Wed, Dec 7, 2011 at 2:31 PM, Moffett, Kyle D
<Kyle.D.Moffett at boeing.com>wrote:

> Hi,
>
> I was just rebasing and tweaking my board-support patch to send out
> again and I noticed that the latest U-Boot master branch does not
> build when the config option "CONFIG_CMD_SPI" is enabled:
>  In file included from exports.c:41
>  [...]/include/_exports.h: In function 'jumptable_init':
>  [...]/include/_exports.h:27: error: 'spi_init' undeclared (first use in
> this function)
>  [...]/include/_exports.h:27: error: (Each undeclared identifier is
> reported only once
>  [...]/include/_exports.h:27: error: for each function it appears in.)
>  [...]/include/_exports.h:28: error: 'spi_setup_slave' undeclared (first
> use in this function)
>  [...]/include/_exports.h:29: error: 'spi_free_slave' undeclared (first
> use in this function)
>  [...]/include/_exports.h:30: error: 'spi_claim_bus' undeclared (first use
> in this function)
>  [...]/include/_exports.h:31: error: 'spi_release_bus' undeclared (first
> use in this function)
>  [...]/include/_exports.h:32: error: 'spi_xfer' undeclared (first use in
> this function)
>
> From what I can tell, the only way to "fix" the exports.h header would
> be to copy-paste much of "include/spi.h" (including the structure and
> most of the constants) into "include/exports.h".
>
> Basically, if those SPI functions should be usable from outside code
> then the structure definition and the flags to be passed in all need to
> be available to the outside code as well.
>
> Locally I just reverted the patch, but I'm not sure what the desired
> long-term fix should be, since it seems silly to have to duplicate
> spi.h in exports.h
>
> Cheers,
> Kyle Moffett
>
> --
> Kyle Moffett
> eXMeritus Software
> Integrated Intelligence
> The Boeing Company
>
> (703) 764-0925
> (703) 812-1146 [FAX]
> Kyle.D.Moffett at boeing.com
>
>
>


More information about the U-Boot mailing list