From: Shinya Kuribayashi <skuribay@pobox.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2 V2] mips: add endianness support
Date: Sun, 24 May 2009 00:24:41 +0900 [thread overview]
Message-ID: <4A181539.8090004@pobox.com> (raw)
In-Reply-To: <1243078501-27652-1-git-send-email-plagnioj@jcrosoft.com>
Hi,
Jean-Christophe PLAGNIOL-VILLARD wrote:
> curently we need to specify the endian of each board in the LDS
>
> in order to unify all of them add full endianness support
>
> by default the mips platforms will be compiled as big-endian
> to compile it as little-endian define CONFIG_CPU_LITTLE_ENDIAN
>
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> Makefile | 2 ++
> board/dbau1x00/u-boot.lds | 5 +----
> board/gth2/u-boot.lds | 5 +----
> board/incaip/u-boot.lds | 5 +----
> board/pb1x00/u-boot.lds | 5 +----
> board/purple/u-boot.lds | 5 +----
> board/qemu-mips/u-boot.lds | 5 +----
> board/tb0229/u-boot.lds | 3 +--
> cpu/mips/config.mk | 9 ---------
> examples/Makefile | 1 +
> examples/mips.lds | 5 +----
> mips_config.mk | 25 +++++++++++++++++++++++++
> 12 files changed, 36 insertions(+), 39 deletions(-)
[snip]
> diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
> index a173c54..928b7d8 100644
> --- a/cpu/mips/config.mk
> +++ b/cpu/mips/config.mk
> @@ -28,12 +28,3 @@ else \
> echo "-march=4kc -mtune=4kc"; \
> fi)
>
> -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
> -ENDIANNESS = -EL
> -else
> -ENDIANNESS = -EB
> -endif
> -
> -MIPSFLAGS += $(ENDIANNESS)
This is ok, but
> -
> -PLATFORM_CPPFLAGS += $(MIPSFLAGS)
I think this wrongly removes -march=4kc -mtune=4kc.
> diff --git a/mips_config.mk b/mips_config.mk
> index 05eb05d..423e216 100644
> --- a/mips_config.mk
> +++ b/mips_config.mk
> @@ -46,3 +46,28 @@ PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
> PLATFORM_CPPFLAGS += -G 0 -mabicalls -fpic
> PLATFORM_CPPFLAGS += -msoft-float
> PLATFORM_LDFLAGS += -G 0 -static -n -nostdlib
> +
> +#
> +# We explicitly add the endianness specifier if needed, this allows
> +# to compile kernels with a toolchain for the other endianness. We
> +# carefully avoid to add it redundantly because gcc 3.3/3.4 complains
> +# when fed the toolchain default!
> +#
> +# Certain gcc versions upto gcc 4.1.1 (probably 4.2-subversion as of
> +# 2006-10-10 don't properly change the predefined symbols if -EB / -EL
> +# are used, so we kludge that here. A bug has been filed at
> +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29413.
> +#
> +
> +UNDEF_ALL += -UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__
> +UNDEF_ALL += -UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__
> +PREDEF_BE += -DMIPSEB -D_MIPSEB -D__MIPSEB -D__MIPSEB__
> +PREDEF_LE += -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__
> +
> +ifdef CONFIG_CPU_LITTLE_ENDIAN
> +PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
> +PLATFORM_LDFLAGS += -EL
> +else
> +PLATFORM_CPPFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
> +PLATFORM_LDFLAGS += -EB
> +endif
Thanks for resubmitting, but there's one thing I'm warried about.
when I gave it a try last time, with almost the same patch you did,
I had a GNU make problem. I'll look closely into it, so please
wait for some time.
Shinya
next prev parent reply other threads:[~2009-05-23 15:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-10 20:56 [U-Boot] [PATCH 1/1] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-10 21:34 ` Wolfgang Denk
2009-05-16 3:59 ` Shinya Kuribayashi
2009-05-16 4:02 ` Shinya Kuribayashi
2009-05-22 23:48 ` [U-Boot] *** PROBABLY SPAM *** " Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 11:35 ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 11:35 ` [U-Boot] [PATCH 2/2 V2] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 15:45 ` Shinya Kuribayashi
2009-05-23 15:24 ` Shinya Kuribayashi [this message]
2009-05-23 15:19 ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 17:58 ` Shinya Kuribayashi
2009-05-23 19:41 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42 ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42 ` [U-Boot] [PATCH 2/3] mips: add endianness support Jean-Christophe PLAGNIOL-VILLARD
2009-05-23 19:42 ` [U-Boot] [PATCH 3/3] mips: unify lds Jean-Christophe PLAGNIOL-VILLARD
2009-05-31 22:27 ` Wolfgang Denk
2009-05-31 22:26 ` [U-Boot] [PATCH 2/3] mips: add endianness support Wolfgang Denk
2009-05-23 22:28 ` [U-Boot] [PATCH 1/3] fix: missing autoconfig.mk from general Makefile Wolfgang Denk
2009-05-24 15:18 ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-24 17:13 ` Wolfgang Denk
2009-06-23 14:34 ` Shinya Kuribayashi
2009-06-23 15:14 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-23 15:40 ` Shinya Kuribayashi
2009-06-23 21:26 ` Jean-Christophe PLAGNIOL-VILLARD
2009-06-23 17:07 ` Mike Frysinger
2009-06-23 17:33 ` Jean-Christophe PLAGNIOL-VILLARD
2009-07-10 22:35 ` Wolfgang Denk
2009-07-11 3:18 ` Mike Frysinger
2009-07-17 19:18 ` Wolfgang Denk
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=4A181539.8090004@pobox.com \
--to=skuribay@pobox.com \
--cc=u-boot@lists.denx.de \
/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