This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR16350 patch ping - gcc doesn't understand big-endian ARM


On Thu, 2005-03-24 at 14:22, Lennert Buytenhek wrote:
> On Thu, Mar 24, 2005 at 12:28:05PM +0000, Richard Earnshaw wrote:
> 
> > > [root@ixp12eb ~]# uname -a
> > > Linux ixp12eb.wantstofly.org 2.6.12-rc1 #1 Sun Mar 20 19:24:18 CET 2005 armv4b armv4b armv4b GNU/Linux
> > > 
> > > So.. config.guess should be mapping anything of the form "arm*b" to
> > > 'armeb', then?
> > 
> > The point of config.guess is to canonicalize this information so that
> > it doesn't have to be done in every single gnu package.  If just passing
> > in uname(1) information causes ambiguity then config.guess isn't doing
> > its job.
> 
> Sure, that makes sense -- there are clear advantages of not having
> the arm architecture name as part of the target triple.  Question
> is, would rewriting to 'armeb' be a good thing to do?  config.guess
> returning 'armeb-unknown-linux-gnu' on big-endian ARMs, and something
> like 'arm-unknown-linux-gnu' for little-endian seems clean enough.
> 

GCC doesn't care about the returned architecture type.   But I can't
assert that no gnu package takes this into account.

I've attached my proposed patch to config.guess below.   I think it
should be minimal enough that it shouldn't cause problems with most gnu
packages that don't look for exact uname(1) entries.  On my netwinder
box I now get:

	armv4_el-unknown-linux-gnu


> (Should xscale* triples be deprecated as well, then, since they are
> basically also just ARMs?)
> 

This is a different issue.  Let's not complicate this thread further.

> > What happens if we have an ARM architecture 'armv7b' at some time in
> > the future?  Then we'd have to handle armv7bb and armv7bl.
> 
> [ But armv7bl still wouldn't match arm*b- :-) ]

Maybe on Linux.  But I'd like to separate the endianness configuration
out into a separate test that can be applied to *all* arm targets, not
just arm/linux.  We can't assume that they all behave this way. 
However, we can assume that config.guess can be made to canonicalize
them for us.

Could you test the attached patch on your big-endian board?

R.
Index: config.guess
===================================================================
RCS file: /cvs/gcc/gcc/config.guess,v
retrieving revision 1.67
diff -p -r1.67 config.guess
*** config.guess	16 Nov 2004 00:57:00 -0000	1.67
--- config.guess	24 Mar 2005 14:22:01 -0000
*************** EOF
*** 822,827 ****
--- 822,832 ----
  	echo ${UNAME_MACHINE}-pc-minix
  	exit 0 ;;
      arm*:Linux:*:*)
+ 	case ${UNAME_MACHINE} in
+ 	    *_el | *_eb);; # Don't do this canonicalization twice
+ 	    *b) UNAME_MACHINE=`echo ${UNAME_MACHINE} | sed -e "s/b$/_eb/"`;;
+ 	    *l) UNAME_MACHINE=`echo ${UNAME_MACHINE} | sed -e "s/l$/_el/"`;;
+ 	esac
  	echo ${UNAME_MACHINE}-unknown-linux-gnu
  	exit 0 ;;
      cris:Linux:*:*)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]