From owner-freebsd-questions@FreeBSD.ORG Tue Jan 12 22:20:48 2010 Return-Path: Delivered-To: FreeBSD-Questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C882D1065740 for ; Tue, 12 Jan 2010 22:20:48 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mx1.freebsd.org (Postfix) with ESMTP id 8E1AF8FC19 for ; Tue, 12 Jan 2010 22:20:48 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 3so61435qwe.7 for ; Tue, 12 Jan 2010 14:20:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.16.213 with SMTP id p21mr8598620qaa.113.1263333309317; Tue, 12 Jan 2010 13:55:09 -0800 (PST) X-Originating-IP: [128.95.133.85] In-Reply-To: <44hbqrm1w2.fsf@be-well.ilk.org> References: <20100112210427.GB18673@Grumpy.DynDNS.org> <4B4CE9B1.4040508@netscape.net> <44hbqrm1w2.fsf@be-well.ilk.org> Date: Tue, 12 Jan 2010 13:55:09 -0800 Message-ID: From: Rob Farmer To: FreeBSD-Questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Kaya Saman Subject: Re: Endianness X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2010 22:20:48 -0000 On Tue, Jan 12, 2010 at 1:47 PM, Lowell Gilbert wrote: > Kaya Saman writes: > >> David Kelly wrote: >>> On Tue, Jan 12, 2010 at 12:51:00PM -0800, Rob Farmer wrote: >>> >>>> I'm trying to create a port of an application which only works on >>>> little endian systems and I'm trying to figure out how to set >>>> ONLY_FOR_ARCHS. =A0Wikipedia says PowerPC, Sparc, and IA64 are bi-endi= an >>>> and the OS chooses the mode. I'm not familiar with these platforms - >>>> I'm sure it has been answered somewhere, but I can't find it - which >>>> FreeBSD archs are little/big endian? Thanks. >>>> >>> >>> i386 is little endian. Would expect ia64 to be the same. >>> >>> >> >> SPARC is big endian. Or at least it used to be..... >> >> Power4,5,6 are all big endian too if I'm not mistaken. >> >> Correct me if I'm wrong but anything based around the CISC >> architecture is big endian. > > As the original poster observed, PowerPC, Sparc and IA64 are all capable > of being used in either endian setting. > > I checked endian.h, and it looks as though FreeBSD uses Sparc as > big-endian, IA64 as little-endian, and PowerPC as whatever it picks up > from gcc (probably big-endian, since the architecture does funny things > with alignment in little-endian mode. > > My best advice, though, is to suggest that Mr. Farmer shouldn't assume > that the application will work anywhere without actually trying it. Well, the upstream author states in the documentation that there are endian problems and to use it only on little endian machines. I don't have any hardware that is non-i386/amd64 and about a year ago when I tried to cross build to powerpc in tinderbox it didn't work, so I can't really do that. --=20 Rob Farmer > > -- > Lowell Gilbert, embedded/networking software engineer, Boston area > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0http://be-well.ilk.org/~lowell/ >