From: Xiangfu Liu <xiangfu@openmobilefree.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] [mips] add $(ENDIANNESS) option when link hello_world example
Date: Mon, 26 Jul 2010 23:06:02 +0800 [thread overview]
Message-ID: <4C4DA45A.7060400@openmobilefree.net> (raw)
In-Reply-To: <4C46FF49.6040205@pobox.com>
Hi Shinya
thanks for the links and patch.
comment inline :)
On 07/21/2010 10:08 PM, Shinya Kuribayashi wrote:
> Little endian build is one of the outstanding issues for MIPS ports[1].
>
> There are several technical issues, 1) lack of powerful configration
> infrastructure (it's drastically improved these days, so not a problem
> any more), 2) *LDFLAGS things are not propageted throughout the build
> system properly, especially through examples/standalone (it seems this
> issue is also addressed via distributed STANDALONE_LOAD_ADDR). Or in
> some cases, 3) you might want to generate u-boot image with different
> endiannness from toolchain's default (native build vs. non-native).
> And finally 4) ELDK toolchains vs. non-ELDK tools issues. As for #4,
> you'll see troublesome -dumpspecs outputs from ELDK toolchain[2].
>
> [1] http://search.gmane.org/?query=mips+little+endian&group=gmane.comp.boot-loaders.u-boot
> [2] http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/31998
>
> Anyway, to move discussion forward we need to sort out what's the most
> priority, what's next, what's nice to have, and what's not.
what about split this patch to two:
one is all *.lds files,
the other one is for the argument,
>
> +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
> +
I have one question here. if we decete the board cpu by CONFIG_CPU_LITTLE_ENDIAN.
why we need check the toolchina again. what about just like this? :
+PLATFORM_CPPFLAGS += -$(UNDEF_ALL)
+ifdef CONFIG_CPU_LITTLE_ENDIAN
+PLATFORM_CPPFLAGS += -EL $(PREDEF_LE))
+PLATFORM_LDFLAGS += -EL
+else
+PLATFORM_CPPFLAGS += -EB $(PREDEF_BE))
+PLATFORM_LDFLAGS += -EB
+endif
+
the original U-Boot is detect -EL/-EB by toolchain name. maybe the
CONFIG_CPU_LITTLE_ENDIAN option is better.
this will not broken the ELDK compile.
Hi Shinya
I will try to make those two patch tomorrow. test, then send again.
what do you think. do you have any advice to me? :)
> +STANDALONE_LOAD_ADDR = 0x80200000 -T mips.lds $(PLATFORM_LDFLAGS)
> diff --git a/arch/mips/cpu/config.mk b/arch/mips/cpu/config.mk
> index a173c54..098d6c7 100644
> --- a/arch/mips/cpu/config.mk
> +++ b/arch/mips/cpu/config.mk
> @@ -28,12 +28,4 @@ else \
> echo "-march=4kc -mtune=4kc"; \
> fi)
>
> -ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
> -ENDIANNESS = -EL
> -else
> -ENDIANNESS = -EB
> -endif
> -
> -MIPSFLAGS += $(ENDIANNESS)
> -
> PLATFORM_CPPFLAGS += $(MIPSFLAGS)
> diff --git a/board/dbau1x00/u-boot.lds b/board/dbau1x00/u-boot.lds
> index 9a6cd1b..3c4fbe3 100644
> --- a/board/dbau1x00/u-boot.lds
> +++ b/board/dbau1x00/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/board/gth2/u-boot.lds b/board/gth2/u-boot.lds
> index e6eee9b..aeb0fcc 100644
> --- a/board/gth2/u-boot.lds
> +++ b/board/gth2/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/board/incaip/u-boot.lds b/board/incaip/u-boot.lds
> index 9a6cd1b..3c4fbe3 100644
> --- a/board/incaip/u-boot.lds
> +++ b/board/incaip/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/board/pb1x00/u-boot.lds b/board/pb1x00/u-boot.lds
> index 9a6cd1b..3c4fbe3 100644
> --- a/board/pb1x00/u-boot.lds
> +++ b/board/pb1x00/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/board/purple/u-boot.lds b/board/purple/u-boot.lds
> index 1881e65..542601a 100644
> --- a/board/purple/u-boot.lds
> +++ b/board/purple/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/board/qemu-mips/u-boot.lds b/board/qemu-mips/u-boot.lds
> index ad058ca..bd16786 100644
> --- a/board/qemu-mips/u-boot.lds
> +++ b/board/qemu-mips/u-boot.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> ENTRY(_start)
> SECTIONS
> diff --git a/examples/standalone/mips.lds b/examples/standalone/mips.lds
> index 717b201..63a1c92 100644
> --- a/examples/standalone/mips.lds
> +++ b/examples/standalone/mips.lds
> @@ -24,7 +24,7 @@
> /*
> OUTPUT_FORMAT("elf32-bigmips", "elf32-bigmips", "elf32-bigmips")
> */
> -OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
> +OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradlittlemips")
> OUTPUT_ARCH(mips)
> SECTIONS
> {
> diff --git a/include/configs/pb1x00.h b/include/configs/pb1x00.h
> index 5ad745e..49ca07c 100644
> --- a/include/configs/pb1x00.h
> +++ b/include/configs/pb1x00.h
> @@ -28,6 +28,8 @@
> #ifndef __CONFIG_H
> #define __CONFIG_H
>
> +#define CONFIG_CPU_LITTLE_ENDIAN
> +
> #define CONFIG_MIPS32 1 /* MIPS32 CPU core */
> #define CONFIG_PB1X00 1
> #define CONFIG_SOC_AU1X00 1 /* alchemy series cpu */
--
Best Regards
Xiangfu Liu
http://www.openmobilefree.net
next prev parent reply other threads:[~2010-07-26 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-21 10:27 [U-Boot] [PATCH] [mips] add $(ENDIANNESS) option when link hello_world example Xiangfu Liu
2010-07-21 14:08 ` Shinya Kuribayashi
2010-07-26 15:06 ` Xiangfu Liu [this message]
2010-07-26 22:00 ` Shinya Kuribayashi
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=4C4DA45A.7060400@openmobilefree.net \
--to=xiangfu@openmobilefree.net \
--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