This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
The triplet armv5b-softfloat-linux gives a binutils package that generates ARM big endian object files by default, but gcc insists that armv5b-softfloat-linux is little endian.
Created an attachment (id=6680) [edit] This is a suggested fix to make gcc understand arm*b-*
As aways patches goto gcc-patches@gcc.gnu.org after reading <http://gcc.gnu.org/contribute.html>.
He did submit it to gcc-patches; see http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00233.html The patch seems to fix a real gcc build problem here; I'm adding it to crosstool for gcc-3.4.[01].
Confirmed.
this also applies pretty nicely to 3.3.5, 3.4.2, 3.4.3, and even gcc cvs HEAD :( one question though ... going by config/arm/arm.h, wouldnt you want to use this logic instead ? #if TARGET_BIG_ENDIAN_DEFAULT #define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END #else #define TARGET_ENDIAN_DEFAULT -ARM_FLAG_BIG_END #endif granted i havent fully tested this change from '0' to '-ARM_FLAG_BIG_END', but it *seems* to work :) also, what do we have to do in order to get this into mainline gcc ? this simple patch has been hanging around for a while :/
Created an attachment (id=8444) [edit] equivalent patch for gcc 4.0 20050305
Created an attachment (id=8445) [edit] proposed patch for gcc 3.4.0 fixes regex for big-endian target triples
Created an attachment (id=8446) [edit] proposed patch for gcc 4.0-20050305 fix regex for big-endian target triples
Created an attachment (id=11245) [edit] gcc-4.1.0-arm-bigendian.patch gcc-4.1.x needs slight tweak since all the ARM_FLAG_* defines have been cut this patch applies with a little fuzz to mainline
Created an attachment (id=12042) [edit] fix target linker emulation for arm elf and eabi
(In reply to comment #9) > Created an attachment (id=11245) [edit] > gcc-4.1.0-arm-bigendian.patch > > gcc-4.1.x needs slight tweak since all the ARM_FLAG_* defines have been cut > this patch applies with a little fuzz to mainline I've rediffed that patch against 4.1.1. If you try to build a big-endian eabi toolchain, you need another fix (see patch of gcc/config/arm/linux-eabi.h)
Created an attachment (id=12542) [edit] fix target linker emulation for arm elf and eabi (take 2) If you try to build a big-endian eabi toolchain, you need another fix (see patch of gcc/config/arm/linux-eabi.h)
Created an attachment (id=12705) [edit] fix target linker emulation for arm elf and eabi (take 3) If you try to build a big-endian eabi toolchain, you need another fix (see patch of gcc/config/arm/linux-eabi.h)
Created an attachment (id=14503) [edit] updated to gcc-4.3 trunk updated against gcc-trunk (for 4.3.0)
Subject: Bug 16350 Author: nickc Date: Thu Nov 8 13:44:09 2007 New Revision: 129999 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129999 Log: PR target/16350 * config.gcc: For arm*b-* define TARGET_BIG_ENDIAN_DEFAULT. * config/arm/linux-elf.h (TARGET_ENDIAN_DEFAULT): Define based on TARGET_BIG_ENDIAN_DEFAULT. Use for MULTILIB_DEFAULTS. (TARGET_DEFAULT): Set according to TARGET_ENDIAN_DEFAULT. (LINUX_TARGET_LINK_SPEC): Pass -mlittle-endian on to the assembler. * config/arm/linux-eabi.h (TARGET_LINKER_EMULATION): Set according to TARGET_BIG_ENDIAN_DEFAULT. (SUBTARGET_EXTRA_LINK_SPEC): Likewise. * gcc/config/arm/bpabi.h (TARGET_DEFAULT_MASK): Set according to TARGET_BIG_ENDIAN_DEFAULT. Modified: trunk/gcc/ChangeLog trunk/gcc/config.gcc trunk/gcc/config/arm/bpabi.h trunk/gcc/config/arm/linux-eabi.h trunk/gcc/config/arm/linux-elf.h
Hi Bernhard, I have applied your patch. I made one small change: I adjusted the new comments in the header files to: /* TARGET_BIG_ENDIAN_DEFAULT is set in config.gcc for big endian configurations. */ This was conformance with the GNU Coding Standards and also for brevity. Cheers Nick
Subject: Re: gcc only understands little endian ARM systems When I (not Bernhard) wrote the original patch, Richard Earnshaw didn't like the approach. See: http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02265.html
Subject: Bug number PR16350 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00358.html
Subject: Bug number PR16350 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00362.html
I notice that the latest patch attached to this bug report doesn't quite match up with what was committed as per comment #15: this bit in gcc/config/arm/linux-elf.h wasn't changed: #undef MULTILIB_DEFAULTS #define MULTILIB_DEFAULTS \ - { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } + { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } I don't know if that was deliberate or not, but my guess based on the revision log for the change is that it was accidental, since the log explicitly says "use it for MULTILIB_DEFAULTS".