Patchwork [U-Boot] sandbox: fix compiling of cpu/os.c

login
register
mail settings
Submitter Andreas Bießmann
Date Dec. 2, 2011, 10:53 a.m.
Message ID <1322823193-28699-1-git-send-email-biessmann@corscience.de>
Download mbox | patch
Permalink /patch/128823/
State Superseded
Delegated to: Mike Frysinger
Headers show

Comments

Andreas Bießmann - Dec. 2, 2011, 10:53 a.m.
Due to -nostdinc switch in default CPPFLAGS compiling of OS dependent files in
'sandbox' architecture may miss some required search paths.
Therefore remove -nostdinc for os dependent files in 'sandbox'.

Without this patch something like this may occour:

---8<---
In file included from /usr/include/fcntl.h:27:0,
                 from os.c:22:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
--->8---

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Inspired-by: Mike Frysinger <vapier@gentoo.org>
---
This solution was suggested in
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/118933/focus=118937

 arch/sandbox/cpu/Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/arch/sandbox/cpu/Makefile b/arch/sandbox/cpu/Makefile
index e5e860b..2ae0f71 100644
--- a/arch/sandbox/cpu/Makefile
+++ b/arch/sandbox/cpu/Makefile
@@ -23,9 +23,6 @@ 
 # MA 02111-1307 USA
 #
 
-# os.c is build in the system environment, so needs standard includes
-CPPFLAGS_arch/sandbox/cpu/os.o += -I/usr/include
-
 include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(CPU).o
@@ -40,6 +37,10 @@  all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
+# os.c is build in the system environment, so needs standard includes
+$(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
+$(obj).depend.os: CPPFLAGS := $(filter-out -nostdinc,$(CPPFLAGS))
+
 #########################################################################
 
 # defines $(obj).depend target