Gentoo Archives: gentoo-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Profile-enforced big-endian USE flag
Date: Thu, 29 Jun 2017 10:30:44
Message-Id: 521e5c98-7412-3069-2940-577b6d653b29@gentoo.org
In Reply to: Re: [gentoo-dev] Profile-enforced big-endian USE flag by James Le Cuirot
1 On 06/28/2017 18:29, James Le Cuirot wrote:
2 > On Wed, 28 Jun 2017 17:52:26 -0400
3 > Mike Gilbert <floppym@g.o> wrote:
4 >
5 >> On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@g.o> wrote:
6 >>> I am therefore proposing a new global big-endian flag. This could be
7 >>> masked by default and unmasked + forced in the relevant profiles under
8 >>> arch. I will apply this according to the mapping defined in tc-endian of
9 >>> toolchain-funcs.eclass.
10 >
11 > I've just been putting the patch together. I made it slightly simpler
12 > by masking *and* forcing it by default so that it only needs to be
13 > unmasked were necessary.
14 >
15 >> A possible alternative would be to create a new USE_EXPAND variable
16 >> for this. That would allow for easier expansion in case we ever
17 >> support something other than big/little endian machines.
18 >
19 > That way madness lies? Wikipedia talks about middle-endian as being the
20 > catch all for other random orderings that have appeared over the years
21 > but I don't think any of them were used on a system-wide basis. I can't
22 > imagine Linux ever supporting such a thing. Unless you're talking about
23 > dealing with soft vs hard float here too?
24
25 As far as I know, Linux only supports big-endian and little-endian systems,
26 along with supporting a fairly-wide variety of platforms and architectures,
27 beaten really only by NetBSD. If NetBSD lacks anything for middle-endian, then
28 it's probably safe to ignore it.
29
30 That said, Wikipedia doesn't offer much on the nature of middle-endian (which
31 is called "PDP-endian"), except to state that "The ARM architecture can also
32 produce this format when writing a 32-bit word to an address 2 bytes from a
33 32-bit word alignment."
34 https://en.wikipedia.org/wiki/Endianness#Middle
35
36 And this resource:
37 http://unixpapa.com/incnote/byteorder.html
38
39 Recommends to ignore middle-endian, as it believes no processor was ever
40 implemented that stored integers in middle-endian format.
41
42 --
43 Joshua Kinard
44 Gentoo/MIPS
45 kumba@g.o
46 6144R/F5C6C943 2015-04-27
47 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
48
49 "The past tempts us, the present confuses us, the future frightens us. And our
50 lives slip away, moment by moment, lost in that vast, terrible in-between."
51
52 --Emperor Turhan, Centauri Republic