[U-Boot] [PATCH 1/1] Fix musl build

Tom Rini trini at konsulko.com
Wed Apr 22 18:13:54 CEST 2015


On Sat, Apr 18, 2015 at 08:07:02AM +0200, Jörg Krause wrote:

> This patch fixes cross-compiling U-Boot tools with the musl C library:
>   * including <sys/types.h> is needed for ulong
>   * defining _GNU_SOURCE is needed for loff_t
> 
> Signed-off-by: Jörg Krause <joerg.krause at embedded.rocks>
> ---
>  include/image.h    | 1 +
>  tools/env/fw_env.c | 2 ++
>  tools/imagetool.h  | 1 +
>  tools/proftool.c   | 1 +
>  4 files changed, 5 insertions(+)
> 
> diff --git a/include/image.h b/include/image.h
> index 3844be6..ac2fd6e 100644
> --- a/include/image.h
> +++ b/include/image.h
> @@ -18,6 +18,7 @@
>  
>  #include "compiler.h"
>  #include <asm/byteorder.h>
> +#include <sys/types.h>
>  
>  /* Define this to avoid #ifdefs later on */
>  struct lmb;

This is wrong.  We need to add this include a few lines later below
#ifdef USE_HOSTCC otherwise we may fail to build:
+   at91sam9261ek_dataflash_cs3
+(at91sam9261ek_dataflash_cs3) In file included from ../include/common.h:82:0:
+(at91sam9261ek_dataflash_cs3) ../include/image.h:21:23: fatal error: sys/types.h: No s
uch file or directory
+(at91sam9261ek_dataflash_cs3)  #include <sys/types.h>
+(at91sam9261ek_dataflash_cs3)                        ^
+(at91sam9261ek_dataflash_cs3) compilation terminated.
+(at91sam9261ek_dataflash_cs3) make[2]: *** [include/autoconf.mk] Error 1
+(at91sam9261ek_dataflash_cs3) make[1]: *** No rule to make target 'include/config/auto
.conf', needed by 'include/config/uboot.release'.  Stop.
+(at91sam9261ek_dataflash_cs3) make: *** [sub-make] Error 2

Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150422/71d79802/attachment.sig>


More information about the U-Boot mailing list