[PATCH] boot/image-fit.c: Restore building tools on macOS

Tom Rini trini at konsulko.com
Mon Dec 1 18:40:38 CET 2025


The ordering of headers in this file doesn't follow our rules exactly
because this file ends up being included when building host tools and so
has to be correct for host include paths and ordering as well. We need
to have <malloc.h> higher in the file or macOS will fail to build due to
declaration problems.

Fixes: 8fbcc0e0e839 ("boot: Assure FDT is always at 8-byte aligned address")
Signed-off-by: Tom Rini <trini at konsulko.com>
---
Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
 boot/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/boot/image-fit.c b/boot/image-fit.c
index cccaa48f6839..3f66bec49041 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -23,6 +23,7 @@
 #include <log.h>
 #include <mapmem.h>
 #include <asm/io.h>
+#include <malloc.h>
 #include <memalign.h>
 #include <asm/global_data.h>
 #ifdef CONFIG_DM_HASH
@@ -35,7 +36,6 @@ DECLARE_GLOBAL_DATA_PTR;
 #include <bootm.h>
 #include <image.h>
 #include <bootstage.h>
-#include <malloc.h>
 #include <upl.h>
 #include <u-boot/crc.h>
 
-- 
2.43.0



More information about the U-Boot mailing list