[Bug other/52187] New: armeb-unknown-eabi not recognized as big-endian

2012-02-09 Thread egnor at ofb dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52187

 Bug #: 52187
   Summary: armeb-unknown-eabi not recognized as big-endian
Classification: Unclassified
   Product: gcc
   Version: 4.6.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: eg...@ofb.net


In gcc/config.gcc, the stanza for Linux recognizes arm*b-* and treats it as
big-endian:

arm*-*-linux*)  # ARM GNU/Linux with ELF
tm_file="dbxelf.h elfos.h gnu-user.h linux.h linux-android.h
glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h"
case $target in
arm*b-*)
tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
;;
esac

However, the similar stanza for other arm targets does not.  In my case I am
using armeb-unknown-eabi (for a bare metal project), which means the
arm*-*-eabi* stanza takes place.  This ignores the "eb" suffix and builds a
compiler which defaults to little endian.  (Worse, libgcc is built in
little-endian mode, causing subtle bugs even with code compiled with
-mbig-endian.)

Copying the Linux arm*b-* section to the other stanza helps my case, but I'm
not sure it's a general solution.

Bug 16350 may be related -- possibly even a dupe -- though I'm not sure the
scope is the same.  Good code _is_ generated with -mbig-endian, it just needs
to be recognized as the default for appropriate targets.


[Bug target/16350] gcc only understands little endian ARM systems

2012-02-09 Thread egnor at ofb dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16350

Dan Egnor  changed:

   What|Removed |Added

 CC||egnor at ofb dot net

--- Comment #27 from Dan Egnor  2012-02-09 17:53:24 UTC 
---
The precise scope of this bug is unclear to me.

Big endian Linux targets _do_ seem to work now, and -mbig-endian generates
correct code regardless; however, non-Linux big-endian targets do not seem to
be recognized as big-endian by default (which means libgcc is built in little
endian mode, etc.).

See bug 52187 (which may be a dupe of this one, depending on how you interpret
the scope of this bug).


[Bug target/52187] armeb-unknown-eabi not recognized as big-endian

2012-02-09 Thread egnor at ofb dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52187

--- Comment #2 from Dan Egnor  2012-02-09 18:06:36 UTC ---
This is sort of the opposite of 49448.

In 49448, the _Linux_ rule is recognizing a _little endian_ target as _big
endian_ because its big-endian glob is too generous.

In this bug, a _non-Linux_ rule is recognizing a _big endian_ target as _little
endian_, because there's no big-endian glob at all.