boot/image-fit.c: Restore building tools on macOS
PATCH 1/1 boot/image-fit.c: Restore building tools on macOS
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.
---
Cc: Marek Vasut <[email protected]>
--- boot/image-fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
boot/image-fit.c +1 -1
@@ -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>
Signature · 1 line
2.43.0
Quoted 27 lines · Tom Rini
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 <[email protected]>---
Cc: Marek Vasut <[email protected]>--- boot/image-fit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)boot/image-fit.c +1
-0@@ -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
boot/image-fit.c DECLARE_GLOBAL_DATA_PTR; · line 40
Quoted 6 lines
boot/image-fit.c +0
-1@@ -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>
Well, this blows up *everywhere* and so is wrong. I'll figure out something or another for a v2.
Signature · 1 line
Tom
Quoted 10 lines · Tom Rini
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 <[email protected]>---
Cc: Marek Vasut <[email protected]>
I ran across this missing malloc() once before, but never triggered it in CI after changing the fixed patch slightly. It seems it does trigger sometimes, so:
Thanks !