Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael S. Zick <minimod@morethan.org>
To: buildroot@busybox.net
Subject: [Buildroot] [Bug 4634] New: Bigendian binary is output even if it is configured to output little endian
Date: Sun, 18 Dec 2011 07:53:49 -0600	[thread overview]
Message-ID: <201112180753.51312.minimod@morethan.org> (raw)
In-Reply-To: <201112180733.12681.minimod@morethan.org>

On Sun December 18 2011, Michael S. Zick wrote:
> On Sat December 17 2011, bugzilla at busybox.net wrote:
> > https://bugs.busybox.net/show_bug.cgi?id=4634
> > 
> >            Summary: Bigendian binary is output even if it is configured to
> >                     output little endian
> >            Product: buildroot
> >            Version: 2011.11
> >           Platform: PC
> >         OS/Version: Linux
> >             Status: NEW
> >           Severity: major
> >           Priority: P5
> >          Component: Other
> >         AssignedTo: unassigned at buildroot.uclibc.org
> >         ReportedBy: matusita at k-micro.com
> >                 CC: buildroot at uclibc.org
> >    Estimated Hours: 0.0
> > 
> > 
> > I set build options as below in "make menuconfig" to build root filesystem:
> >   Target Architecture (mipsel)
> >   Target Architecture Variant (mips 32r2)
> >   Toolcain-Toolchain type (External toolchain)
> >   Toolcain-Toolchain (CodeSourcery MIPS 2011.03)
> > 
> > I expected that little enfian binary will be output because "mipsel" is
> > selected. But it was big endian.
> > I confirmed it by objdump with "-f" option like below.
> > 
> >   % mips-linux-gnu-objdump -f busybox
> >     busybox:     file format elf32-tradbigmips      <-- Big endian !!!
> >     architecture: mips:isa32r2, flags 0x00000112:
> >     EXEC_P, HAS_SYMS, D_PAGED
> >     start address 0x00403f00
> > 
> > So, I saw following file:
> >   toolchain/toolchain-external/ext-tool.mk
> > 
> > And I understand that this script get libraries' location by calling
> > (prefix)-gcc with following options:
> >   -print-sysroot
> >   -print-file-name=libc.a
> > 
> > But as for this toolchain(CodeSourcery MIPS 2011.03), it is need to set "-EL"
> > option as well to get correct location of little endian libraries.
> > 
> 
> I think that the endian default is a gcc build-time option and some builders
> do select (or it defaults to) little endian.
> 
> But the CS toolchains do default to big endian.
> Too be more general purpose, perhaps there should also be a "knob" to pass
> -mno-mips16 since the gcc default is to produce mixed 16/32 (or 16/64) bit
> code and the mips16e decoder is not a core requirement.
> 
> http://openplayer.org/resource/tutorials/57-cs-multi-library-tour.html
> 
PS:
Another point -

The MIPS recommendation for code generation is to use:
-Os (the BR default) when compiling 'pure' code and to use:
-O2 when compiling mixed code (gcc defaults to mixed code).

Mike
> Mike
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 
> 

  reply	other threads:[~2011-12-18 13:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18  5:28 [Buildroot] [Bug 4634] New: Bigendian binary is output even if it is configured to output little endian bugzilla at busybox.net
2011-12-18 13:33 ` Michael S. Zick
2011-12-18 13:53   ` Michael S. Zick [this message]
2012-01-31 19:46 ` [Buildroot] [Bug 4634] " bugzilla at busybox.net
2012-02-17  9:37 ` bugzilla at busybox.net
2012-02-17  9:42 ` bugzilla at busybox.net

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=201112180753.51312.minimod@morethan.org \
    --to=minimod@morethan.org \
    --cc=buildroot@busybox.net \
    /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