public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fdt: Ensure that libfdt_env.h comes from U-Boot
@ 2013-03-11 16:30 Simon Glass
  2013-04-12 20:24 ` Simon Glass
  2013-04-17 15:35 ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Glass @ 2013-03-11 16:30 UTC (permalink / raw)
  To: u-boot

When building host utilities, we include libfdt.h from the host, not from
U-Boot. This in turn brings in libfdt_env.h from the host, which can mess
up the types and cause a build failure, depending on the host environment.
To fix this, force inclusion of U-Boot's libfdt_env.h so that the types
are correct.

Another way to fix this is to use -nostdinc and -idirafter to ensure that
system includes are included after U-Boot ones. Unfortunately this means
that U-Boot's errno.h gets included instead of the system one. This in
turn requires a hack to errno.h to redirect things, so all in all the
solution in this patch is probably cleaner.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 tools/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index c5952fc..889c897 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -164,7 +164,8 @@ NOPEDOBJS := $(addprefix $(obj),$(NOPED_OBJ_FILES-y))
 # Use native tools and options
 # Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
 #
-HOSTCPPFLAGS =	-idirafter $(SRCTREE)/include \
+HOSTCPPFLAGS =	-include $(SRCTREE)/include/libfdt_env.h \
+		-idirafter $(SRCTREE)/include \
 		-idirafter $(OBJTREE)/include2 \
 		-idirafter $(OBJTREE)/include \
 	        -I $(SRCTREE)/lib/libfdt \
-- 
1.8.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-14 15:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 16:30 [U-Boot] [PATCH] fdt: Ensure that libfdt_env.h comes from U-Boot Simon Glass
2013-04-12 20:24 ` Simon Glass
2013-04-17  2:25   ` Jerry Van Baren
2013-04-17 15:35 ` Tom Rini
2013-06-14 14:56   ` Joe Hershberger
2013-06-14 15:07     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox