mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH v3] sandbox: move ELFCLASS detection to asm/elf.h
@ 2011-10-27 11:50 Jean-Christophe PLAGNIOL-VILLARD
  2011-11-22  7:51 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-10-27 11:50 UTC (permalink / raw)
  To: barebox; +Cc: Loïc Minier

now we can detect the host build from gcc macro
and cross compile the sandbox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Loïc Minier <loic.minier@linaro.org>
---
v3:

	fix typo
v2:
	as discuss with Loïc use the size of the pointer

Loïc

	to build on most of arch you need this fix and 3 others
	already in the next

	commit	9a5898e5: sandbox: simplify linker script
	commit	15f87657: sandbox: remove duplicate barebox.lds.S
	ommit	e3e71f5e: sandbox: move __SANDBOX__ to Makefile

	Sacha those 4 patches could go to the master as they fix the sandbox

Best Regards,
J.

 arch/sandbox/Makefile          |   13 -------------
 arch/sandbox/include/asm/elf.h |   11 ++++++++++-
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile
index b88f1f6..9fd18a2 100644
--- a/arch/sandbox/Makefile
+++ b/arch/sandbox/Makefile
@@ -36,19 +36,6 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 				  -e s/s390x/s390/ -e s/parisc64/parisc/ \
 				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ )
 
-ifeq ($(SUBARCH),x86_64)
-ELF_CLASS := ELFCLASS64
-endif
-ifeq ($(SUBARCH),i386)
-ELF_CLASS  := ELFCLASS32
-endif
-ifeq ($(SUBARCH),powerpc)
-ELF_CLASS  := ELFCLASS32
-endif
-
-CPPFLAGS += -DELF_CLASS="$(ELF_CLASS)"
-export ELF_CLASS
-
 archprepare: maketools
 
 PHONY += maketools
diff --git a/arch/sandbox/include/asm/elf.h b/arch/sandbox/include/asm/elf.h
index b60d248..405393f 100644
--- a/arch/sandbox/include/asm/elf.h
+++ b/arch/sandbox/include/asm/elf.h
@@ -1,2 +1,11 @@
+#ifndef __ASM_SANDBOX_ELF_H__
+#define __ASM_SANDBOX_ELF_H__
 
-/* nothing yet */
+#if __SIZEOF_POINTER__ == 8
+#define ELF_CLASS	ELFCLASS64
+#define CONFIG_PHYS_ADDR_T_64BIT
+#else
+#define ELF_CLASS	ELFCLASS32
+#endif
+
+#endif /* __ASM_SANDBOX_ELF_H__ */
-- 
1.7.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2011-11-22  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-27 11:50 [PATCH v3] sandbox: move ELFCLASS detection to asm/elf.h Jean-Christophe PLAGNIOL-VILLARD
2011-11-22  7:51 ` Jean-Christophe PLAGNIOL-VILLARD

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