Currently, for arm-* archs, TARGET_BIG_ENDIAN_DEFAULT is only set in the case branch for arm*-*-linux-*, not for other arm architectures. We're compiling for the TI TMS570, which is a big-endian processor, with target set to armeb-unknown-eabi. The following patch moves the big-endian check out of the big architecture case, so that TARGET_BIG_ENDIAN_DEFAULT is consistently set for any armeb-*-* target.
We've been using this with good results for over a year at Google on TMS570 processors. This fixes bug 52187 - armeb-unknown-eabi not recognized as big-endian. Seth LaForge gcc/ * config.gcc: Add TARGET_BIG_ENDIAN_DEFAULT=1 for all arm*b archs. diff -u -r gcc-4.8-20130210/gcc/config.gcc gcc-4.8-20130210.new/gcc/config.gcc --- gcc-4.8-20130210/gcc/config.gcc 2013-02-08 08:02:47.000000000 -0800 +++ gcc-4.8-20130210.new/gcc/config.gcc 2013-02-14 16:37:14.282107219 -0800 @@ -809,6 +809,13 @@ ;; esac +# Handle big-endian ARM architectures. +case ${target} in +arm*b-*-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" + ;; +esac + case ${target} in aarch64*-*-elf) tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h" @@ -867,11 +874,6 @@ ;; 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-*-linux*) - tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" - ;; - esac tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h arm/arm.h" # Define multilib configuration for arm-linux-androideabi.