Skip to contentSkip to conversation

Sandbox question

U-Boot Andreas Bießmann 3 participants 3 messages Dec 1, 2011

lore
Share & tools
lore
#0 lore raw

Dear Simon,

I started to play around with new sandbox architecture and encountered a serious problem.
Due to the '-nostdinc' switch the file arch/sandbox/cpu/os.c requires additional CPPFLAGS '-I/usr/include'. On my debian box this is not enough since the bits/*.h are placed in /usr/include/i386-linux-gnu and therefore I get errors when compiling arch/sandbox/os.c.
Are there any clean solution to get this working?

best regards

Andreas Bie?mann

#1 lore raw

Hi Andreas,

Quoted 9 lines · Andreas Bie?mann

Dear Simon,

I started to play around with new sandbox architecture and encountered a serious problem.
Due to the '-nostdinc' switch the file arch/sandbox/cpu/os.c requires additional CPPFLAGS '-I/usr/include'. On my debian box this is not enough since the bits/*.h are placed in /usr/include/i386-linux-gnu and therefore I get errors when compiling arch/sandbox/os.c.
Are there any clean solution to get this working?

Perhaps removing the -nostdinc switch for just that file would work? The idea with sandbox is that os.c is the interface to the OS, and is compiled with access to system headers. You might get link failures, but it might be ok. It would be nice to avoid 'gcc -print-search-dirs' if we can.

Regards,
Simon

Quoted 5 lines

best regards

Andreas Bie?mann

#2 lore raw
In reply to Andreas Bießmann
Quoted 7 lines · On Thursday 01 December 2011 11:35:14 Andreas Bie?mann wrote:

I started to play around with new sandbox architecture and encountered a serious problem.
Due to the '-nostdinc' switch the file arch/sandbox/cpu/os.c requires additional CPPFLAGS '-I/usr/include'. On my debian box this is not enough since the bits/*.h are placed in /usr/include/i386-linux-gnu and therefore I get errors when compiling arch/sandbox/os.c.
Are there any clean solution to get this working?

try this
-mike

arch/sandbox/cpu/Makefile +2 -3
index e5e860b..25ca148 100644
@@ -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,8 @@ all:	$(obj).depend $(LIB)
 $(LIB):	$(OBJS)
 	$(call cmd_link_o_target, $(OBJS))
 
+$(obj)os.o: ALL_CFLAGS := $(filter-out -nostdinc,$(ALL_CFLAGS))
+
 #########################################################################
 
 # defines $(obj).depend target

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111201/b5fcbf06/attachment.pgp>