On Fri, Feb 15, 2013 at 3:29 PM, Mike Stump <mikest...@comcast.net> wrote:
> No.  Counter proposal, let's handle the cases that don't work.  So, you said 
> in your original email that armeb-unknown-eabi doesn't work.
>
> So, in the existing case statement for:
>
> arm*-*-eabi*)
>
> let's just add:
>
>         case ${target} in
>         armeb-*-eabi*)
>           tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
>         esac
>
> Is this not exactly what you want?  Doesn't this solve exactly what you 
> stated was the problem?

OK, attached patch
0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-armeb-eabi-a.patch does
as you describe, and works for my particular use-case.

>> I could inline the test into all
>> of the ARM cases below, but I don't like that approach since it's what
>> caused this problem in the first place (somebody adding BE support to
>> one ARM arch without adding it to the others).
>
> And does it work on uclinux?  Does it work on rtems?  Does it work on every 
> arm that every existed and will exist?  If the answer is no, then it is less 
> ideal than putting this in the config for eabi*).

Well, the current config is certainly broken when giving a big-endian
spec for uclinux, rtems, and every other arm that ever existed or will
exist.  It's possible there are other issues with using a big-endian
processor for uclinux, rtems, etc, but adding
TARGET_BIG_ENDIAN_DEFAULT=1 certainly gets those targets closer to
working.

> If it always works, then moving the existing on up to the existing:
>
> case ${target} in
> i[34567]86-*-*)
>
> would be the right approach.  x86 uses this location already to set 
> tm_defines="${tm_defines} USE_IX86_FRAME_POINTER=1" for example.  The 
> documentation above that group can state that this is the location for things 
> that are cpu specific and os and vendor neutral.

I like that solution better.  Following your suggested list of
big-endian architectures, attached patch
0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch adds
TARGET_BIG_ENDIAN_DEFAULT=1 for $target matching "armeb-* | armbe-* |
armv[3-8]b-*".  I left out xscaleeb, since config.sub canonicalizes
xscaleeb-* to armeb-*.

Please, pick whichever patch pleases you most.  I prefer
0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch.

Changelog entry for
0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch:

gcc/
        * config.gcc: Add TARGET_BIG_ENDIAN_DEFAULT=1 for all arm big-endian 
archs.

Changelog entry for
0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-armeb-eabi-a.patch:

gcc/
        * config.gcc: Add TARGET_BIG_ENDIAN_DEFAULT=1 for all armeb-*-eabi* 
archs.

Seth

Attachment: 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-arm-big-endi.patch
Description: Binary data

Attachment: 0001-Add-TARGET_BIG_ENDIAN_DEFAULT-1-for-all-armeb-eabi-a.patch
Description: Binary data

Reply via email to