[PATCH 4/6] hostcc tools: include "compiler.h", fix included headers

Dirk Hörner dirker at gmail.com
Mon Jun 4 16:40:17 EDT 2012


When barebox headers get included from HOSTCC tools they should not
include other architecture specific headers as barebox might get
cross-compiled. Instead, the tool itself should include "compiler.h".

Signed-off-by: Dirk Hörner <dirker at gmail.com>
---
 include/envfs.h      |    2 ++
 include/image.h      |    2 +-
 scripts/bareboxenv.c |    2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/envfs.h b/include/envfs.h
index b5849d9..67b8902 100644
--- a/include/envfs.h
+++ b/include/envfs.h
@@ -1,7 +1,9 @@
 #ifndef _ENVFS_H
 #define _ENVFS_H
 
+#ifdef __BAREBOX__
 #include <asm/byteorder.h>
+#endif
 
 #define ENVFS_MAGIC		    0x798fba79	/* some random number */
 #define ENVFS_INODE_MAGIC	0x67a8c78d
diff --git a/include/image.h b/include/image.h
index 35ff01b..027b5f2 100644
--- a/include/image.h
+++ b/include/image.h
@@ -31,8 +31,8 @@
 #ifndef __IMAGE_H__
 #define __IMAGE_H__
 
-#include <linux/types.h>
 #ifdef __BAREBOX__
+#include <linux/types.h>
 #include <asm/byteorder.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/scripts/bareboxenv.c b/scripts/bareboxenv.c
index b0d5818..866e345 100644
--- a/scripts/bareboxenv.c
+++ b/scripts/bareboxenv.c
@@ -34,6 +34,8 @@
 #include <getopt.h>
 #include <libgen.h>
 
+#include "compiler.h"
+
 #define debug(...)
 
 void *xmalloc(size_t size)
-- 
1.7.10.3




More information about the barebox mailing list