Subject: Re: Bi-endian platforms and build.sh
To: Simon Burge <simonb@wasabisystems.com>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-toolchain
Date: 12/10/2002 19:27:41
On Wed, Dec 11, 2002 at 02:13:18PM +1100, Simon Burge wrote:

 > +
 > +# Check that MACHINE_ARCH is set correctly for bi-endian machines.
 > +if $bi_endian; then
 > +	case $MACHINE_ARCH in
 > +		mips)
 > +			echo "MACHINE_ARCH must be set, or -a must be used, for $MACHINE."
 > +			echo ""; usage
 > +			;;

Why check for "mips" here?  You should just display this message
unconditionally for bi-endian platforms which do not have a machine_arch
set.  I think that if a bi-endian platform (really, if you think about
it, it's "multi-machine_arch platform") doesn't get -a specified, then
MACHINE_ARCH should default to an empty string... see more below...

 > +	esac
 > +
 > +	# If BUILDID is already set we assume that the user knows what
 > +	# they are doing and don't override that when an endianness
 > +	# qualifier.
 > +	if [ -z "$BUILDID" ]; then
 > +		case $MACHINE_ARCH in
 > +			*el)
 > +				BUILDID=el;;
 > +			*eb)
 > +				BUILDID=eb;;
 > +		esac
 > +	fi

...because this is going to be handled on a per-cpu basis.  I.e. for
mips and sh3/sh5 this is right, but for ARM it is not, because ARM
is "arm" and "armeb", and the little-endian one won't have a default
build ID, in all likelihood (because it is, by far, the common case).

...eventually, this will be extended to handle e.g. "mipsn32el", etc.
as well, so the buildid might be "n32el"... follow where I'm going with
this? :-)

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>