From: Mike Frysinger Date: Fri, 2 Dec 2011 13:29:07 -0500 Subject: [U-Boot] [PATCH v2] sandbox: fix compiling of cpu/os.c In-Reply-To: <1322823193-28699-1-git-send-email-biessmann@corscience.de> References: <1322823193-28699-1-git-send-email-biessmann@corscience.de> Message-ID: <1322850547-24677-1-git-send-email-vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Andreas Bie?mann U-boot itself generally builds with -nostdinc. This is because the bootloader needs to be completely standalone. In the sandbox arch though, we need a little bit of code to glue the u-boot world to the host operating system, and we need to be able to access the host libc's headers in order to do so. Currently, we're using -I/usr/include to workaround the global -nostdinc, but that doesn't work for everyone and for all headers. Instead, let's filter out -nostdinc when building the os.c code. Without this patch, some distros hit errors such as: ---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 Signed-off-by: Mike Frysinger --- v2 - merge my local changelog with Andreas' arch/sandbox/cpu/Makefile | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) 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 -- 1.7.6.1