🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #312

defining endianness on mips processor

#312
From: meissner
Date: Mon, 31 Aug 1992 06:32
30 lines
1769 bytes
| 
| On the c compiler provided with the RISC os for their mips
| processor, there is an option to toggle between big and
| little endian.  cc (-EL/EB)  On our workstations we compile
| in big endian, and for our engineering platform we compile
| in little endian.
| 
| gcc does not apear to have such an option of its command line.
| There are #defines that you can use,  it seems, to say which 
| type of endianness you want, when you build gcc.
| 
| I realy don't want to have two gcc executables (one for big and
| one for little endian.)  I'd like a command line argument
| to be able to switch between the two.  Is that going to exist
| in a future gcc release, or is it posible to hack on the code
| to produce big/little endian as definable by the user?

GCC internally is not set up to be able to switch endianess at
runtime.  If you look in the sources, you will see a number of places
that use #ifdef's in the middle of expressions that control the
endianess.  Obviously, it could be done, but so far it hasn't been.

While you would still have to have two executables, you could switch
endianess via the -b <machine> switch and only have one driver program.

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

You are in a twisty little passage of standards, all conflicting.
Technical Details
Message-ID: <9208311432.AA06567@tiktok.osf.org>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!osf.ORG!meissner
References: meissner@osf.ORG

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Subject: defining endianness on mips processor
Message-ID: <9208311432.AA06567@tiktok.osf.org>
Sender: daemon@cis.ohio-state.edu
Organization: GNUs Not Usenet
References: meissner@osf.ORG
Distribution: gnu
Date: Mon, 31 Aug 1992 06:32:24 GMT
Lines: 30