Following error happens when build envtools for mx6qsabrelite.
$ make tools envtools
UPD include/generated/timestamp_autogenerated.h
HOSTCC tools/printinitialenv
GENENV u-boot-initial-env
COPY tools/version.h
HOSTCC tools/env/crc32.o
HOSTCC tools/env/ctype.o
HOSTCC tools/env/env_attr.o
HOSTCC tools/env/env_flags.o
In file included from ./arch/arm/include/asm/mach-imx/regs-lcdif.h:16,
from ./arch/arm/include/asm/arch/imx-regs.h:371,
from include/configs/mx6_common.h:21,
from include/configs/nitrogen6x.h:13,
from include/config.h:3,
from include/env.h:12,
from tools/env/../../env/flags.c:7,
from tools/env/env_flags.c:1:
./arch/arm/include/asm/mach-imx/regs-common.h:51:9: error: unknown type name
'uint8_t'
51 | __mxs_reg_8(reg)
| ^~~~~~~~~~~
uint8_t type is defined in linux/types.h header file.
The config.h includes regs-common.h that uses uint8_t type,
to fix this, include config.h after linux/types.h in env.h file.
Fixes: 9f1807e57cbb ("env: add env_set_runtime() helper")
Signed-off-by: Jacky Cao <[email protected]>
---
include/env.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/env.h b/include/env.h
index 9b872fb26eb..dcd017fa5e6 100644
--- a/include/env.h
+++ b/include/env.h
@@ -9,10 +9,10 @@
#ifndef __ENV_H
#define __ENV_H
-#include <config.h>
#include <compiler.h>
#include <stdbool.h>
#include <linux/types.h>
+#include <config.h>
struct environment_s;
--
2.34.1