浏览代码

Fix musl build

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

Tested for target at91sam9261ek_dataflash_cs3.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
Cc: Tom Rini <trini@konsulko.com>
Jörg Krause 9 年之前
父节点
当前提交
26e355d131
共有 4 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      include/image.h
  2. 2 0
      tools/env/fw_env.c
  3. 1 0
      tools/imagetool.h
  4. 1 0
      tools/proftool.c

+ 1 - 0
include/image.h

@@ -23,6 +23,7 @@
 struct lmb;
 
 #ifdef USE_HOSTCC
+#include <sys/types.h>
 
 /* new uImage format support enabled on host */
 #define CONFIG_FIT		1

+ 2 - 0
tools/env/fw_env.c

@@ -8,6 +8,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#define _GNU_SOURCE
+
 #include <errno.h>
 #include <env_flags.h>
 #include <fcntl.h>

+ 1 - 0
tools/imagetool.h

@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <time.h>
 #include <unistd.h>
 #include <u-boot/sha1.h>

+ 1 - 0
tools/proftool.c

@@ -16,6 +16,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/param.h>
+#include <sys/types.h>
 
 #include <compiler.h>
 #include <trace.h>