public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] *** PROBABLY SPAM *** Re: [PATCH 1/1] mips: unify lds
Date: Sat, 23 May 2009 01:48:15 +0200	[thread overview]
Message-ID: <20090522234815.GF19891@game.jcrosoft.org> (raw)
In-Reply-To: <4A0E3A20.5010900@pobox.com>

> 
> Background is, we're going to have a single, unified u-boot.lds, hence
> OUTPUT_FORMAT(default, big, little) command would be applied across all
> supported targets as well.  Then, we'd like to pass -EL specifier to the
> linker so that some little-endian builds are processed properly.
> 
> The goal here is,
> 
> * Explicitly add the endianness specifier _if_needed_, this allows
>   to compile kernels with a toolchain for the other endianness.
for the kernel they do not use the libgcc at all
this will allow you to compile it in the endianness specifier evenif your
toolchain does not support it
but to do this in u-boot we will need to re-implement the div64 to allow a
assembly implementation
> 
> * We carefully avoid to add it redundantly because gcc 3.3/3.4
>   complains when fed the toolchain default!
> 
> * Expected behavior
> 
>   # echo mips-linux | grep -q 'mips.*el-.*' || echo -EL
>   -EL
>   # echo mips-linux | grep -q 'mips.*el-.*' && echo -EB
>   # echo mipsel-linux | grep -q 'mips.*el-.*' || echo -EL
>   # echo mipsel-linux | grep -q 'mips.*el-.*' && echo -EB
>   -EB
> 
> * Side-effects
> 
>   Some LE toolchains with 'mips-linux', will have a redundant -LE.
>   Some BE toolchains with 'mipsel-linux', will have a redundant -BE.
> 
>   In these cases, you would see a lot of warnings. It's harmless, so
>   I'd like to ignore them as they're minor enough, and consolidation
>   of lds files is more important here.  Also note that I believe we
>   would never find the latter case.
> 
> 
> So, I'd like to say the patch itself looks basically good.
> But still some work needs to be done.
> 
> * How about splitting the patch into two, 1) CONFIG_CPU_LITTLE_ENDIAN
>   introduction patch, and 2) u-boot.lds consoliation patch ?
> 
> * Just wondered, is there any reason why you didn't use PREDEF_{BE,LE}
>   like Linux kernel does?
no just to avaid double define
> 
>   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_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' || echo -EL $(UNDEF_ALL) $(PREDEF_LE))
>   else
>   PLATFORM_CFLAGS += $(shell $(CC) -dumpmachine |grep -q 'mips.*el-.*' && echo -EB $(UNDEF_ALL) $(PREDEF_BE))
>   endif
> 
> * By the way, s/PLATFORM_CFLAGS/PLATFORM_CPPFLAGS/.
> 
> * And we need -EL/-EB specifier on PLATFORM_LDFLAGS as well.
>   We call the GNU ld directly on the final link, so $(UNDEF_ALL) and
>   $(PREDEF_??) part probably are not required.
yes the PREDEF will not be necessarely
> 
> * We need to fix examples/{Makefile,mips.lds} as well.ind time to work on?
> 
> * We need to remove ENDIANNESS from cpu/mips/config.mk, finally.
> 
>   diff --git a/cpu/mips/config.mk b/cpu/mips/config.mk
>   index a173c54..098d6c7 100644
>   --- a/cpu/mips/config.mk
>   +++ b/cpu/mips/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)
> 
> If there're any problems or objections, I'll work on the patch on my
> side (to help Jean), and try to queue them toward the next release.
> Revised patches are welcome, of course.
did you find time to work on?

Best Regards,
J.

  parent reply	other threads:[~2009-05-22 23:48 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     ` Jean-Christophe PLAGNIOL-VILLARD [this message]
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       ` [U-Boot] [PATCH 1/2 V2] mips: add endianness support Shinya Kuribayashi
2009-05-23 15:19         ` 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=20090522234815.GF19891@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.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