mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Cc: "Loïc Minier" <loic.minier@linaro.org>
Subject: [PATCH v2] sandbox: move ELFCLASS detection to asm/elf.h
Date: Thu, 27 Oct 2011 16:45:03 +0800	[thread overview]
Message-ID: <1319705103-30980-1-git-send-email-plagnioj@jcrosoft.com> (raw)

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>
---
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

                 reply	other threads:[~2011-10-27  8:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319705103-30980-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=loic.minier@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox