public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Profile-enforced big-endian USE flag
@ 2017-06-27 22:44 James Le Cuirot
  2017-06-28 21:52 ` Mike Gilbert
  0 siblings, 1 reply; 11+ messages in thread
From: James Le Cuirot @ 2017-06-27 22:44 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2055 bytes --]

Hello devs,

I'm currently adding ppc64le to the list of platforms supported by
icedtea-bin before we lose gcj to save me fudging around later. This
addition presents a small problem.

I currently use the ARCH (e.g. amd64) and ABI (e.g. abi_x86_32) USE
flags to fetch the relevant tarballs. The trouble is that there is no
flag that decides the endianness. Both ppc64 and ppc64le share the
"ppc64" ARCH and ABI. The only differing element between the two
profiles is CHOST, which starts with powerpc64- and powerpc64le-
respectively.

This is sufficient when dealing with multilib-enabled source ebuilds.
As far as I know, there is no such as thing as a mixed endian system on
any architecture. They require different kernels. If a package doesn't
work on one endian type, it can simply be masked in that profile.

However, when dealing with binary ebuilds, you ideally want to split
the different platforms into separate tarballs to reduce the download
size. The platform-specific tarballs for icedtea-bin:8 currently weigh
around 55MB each. It would be polite not to double this for ppc64. You
can't use CHOST in SRC_URI so a new USE flag is the only way.

I am therefore proposing a new global big-endian flag. This could be
masked by default and unmasked + forced in the relevant profiles under
arch. I will apply this according to the mapping defined in tc-endian of
toolchain-funcs.eclass.

There is just one package already this flag, dev-haskell/skein. I don't
believe it would need to change though it might want to hard enable the
force-endianness option or at least enable it by default. On the other
hand, using tc-endian may be a better option here.

If we're broadly agreed then I will submit a patch for review.

On a side note, this problem also applies to soft vs hard float except
that these can be mixed under the same kernel. We don't have profiles
for these though and soft float seems to be a relic now anyway, at
least on ARM.

Cheers,
-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] Profile-enforced big-endian USE flag
  2017-06-27 22:44 [gentoo-dev] Profile-enforced big-endian USE flag James Le Cuirot
@ 2017-06-28 21:52 ` Mike Gilbert
  2017-06-28 22:29   ` James Le Cuirot
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Gilbert @ 2017-06-28 21:52 UTC (permalink / raw
  To: Gentoo Dev

On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:
> I am therefore proposing a new global big-endian flag. This could be
> masked by default and unmasked + forced in the relevant profiles under
> arch. I will apply this according to the mapping defined in tc-endian of
> toolchain-funcs.eclass.

A possible alternative would be to create a new USE_EXPAND variable
for this. That would allow for easier expansion in case we ever
support something other than big/little endian machines.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] Profile-enforced big-endian USE flag
  2017-06-28 21:52 ` Mike Gilbert
@ 2017-06-28 22:29   ` James Le Cuirot
  2017-06-28 23:20     ` Gordon Pettey
                       ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: James Le Cuirot @ 2017-06-28 22:29 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

On Wed, 28 Jun 2017 17:52:26 -0400
Mike Gilbert <floppym@gentoo.org> wrote:

> On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:
> > I am therefore proposing a new global big-endian flag. This could be
> > masked by default and unmasked + forced in the relevant profiles under
> > arch. I will apply this according to the mapping defined in tc-endian of
> > toolchain-funcs.eclass.  

I've just been putting the patch together. I made it slightly simpler
by masking *and* forcing it by default so that it only needs to be
unmasked were necessary.

> A possible alternative would be to create a new USE_EXPAND variable
> for this. That would allow for easier expansion in case we ever
> support something other than big/little endian machines.

That way madness lies? Wikipedia talks about middle-endian as being the
catch all for other random orderings that have appeared over the years
but I don't think any of them were used on a system-wide basis. I can't
imagine Linux ever supporting such a thing. Unless you're talking about
dealing with soft vs hard float here too?

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] Profile-enforced big-endian USE flag
  2017-06-28 22:29   ` James Le Cuirot
@ 2017-06-28 23:20     ` Gordon Pettey
  2017-06-29  2:49     ` Mike Gilbert
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Gordon Pettey @ 2017-06-28 23:20 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1318 bytes --]

On Wed, Jun 28, 2017 at 5:29 PM, James Le Cuirot <chewi@gentoo.org> wrote:

> On Wed, 28 Jun 2017 17:52:26 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
>
> > On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org>
> wrote:
> > > I am therefore proposing a new global big-endian flag. This could be
> > > masked by default and unmasked + forced in the relevant profiles under
> > > arch. I will apply this according to the mapping defined in tc-endian
> of
> > > toolchain-funcs.eclass.
>
> I've just been putting the patch together. I made it slightly simpler
> by masking *and* forcing it by default so that it only needs to be
> unmasked were necessary.
>
> > A possible alternative would be to create a new USE_EXPAND variable
> > for this. That would allow for easier expansion in case we ever
> > support something other than big/little endian machines.
>
> That way madness lies? Wikipedia talks about middle-endian as being the
> catch all for other random orderings that have appeared over the years
> but I don't think any of them were used on a system-wide basis. I can't
> imagine Linux ever supporting such a thing. Unless you're talking about
> dealing with soft vs hard float here too?

So I can't ever expect support for littler-endian, giant-endian,
shrinking-endian, and chaos-endian?

[-- Attachment #2: Type: text/html, Size: 1866 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] Profile-enforced big-endian USE flag
  2017-06-28 22:29   ` James Le Cuirot
  2017-06-28 23:20     ` Gordon Pettey
@ 2017-06-29  2:49     ` Mike Gilbert
  2017-06-29 10:30     ` Joshua Kinard
  2017-06-29 21:19     ` [gentoo-dev] [PATCH] " James Le Cuirot
  3 siblings, 0 replies; 11+ messages in thread
From: Mike Gilbert @ 2017-06-29  2:49 UTC (permalink / raw
  To: Gentoo Dev

On Wed, Jun 28, 2017 at 6:29 PM, James Le Cuirot <chewi@gentoo.org> wrote:
> On Wed, 28 Jun 2017 17:52:26 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
>
>> On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:
>> > I am therefore proposing a new global big-endian flag. This could be
>> > masked by default and unmasked + forced in the relevant profiles under
>> > arch. I will apply this according to the mapping defined in tc-endian of
>> > toolchain-funcs.eclass.
>
> I've just been putting the patch together. I made it slightly simpler
> by masking *and* forcing it by default so that it only needs to be
> unmasked were necessary.
>
>> A possible alternative would be to create a new USE_EXPAND variable
>> for this. That would allow for easier expansion in case we ever
>> support something other than big/little endian machines.
>
> That way madness lies? Wikipedia talks about middle-endian as being the
> catch all for other random orderings that have appeared over the years
> but I don't think any of them were used on a system-wide basis. I can't
> imagine Linux ever supporting such a thing. Unless you're talking about
> dealing with soft vs hard float here too?

No, I'm not referring to anything specifically. Just wanted to point
out the possibility of having a multi-value variable instead of a
boolean.

If that seems very un-useful, please disregard.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] Profile-enforced big-endian USE flag
  2017-06-28 22:29   ` James Le Cuirot
  2017-06-28 23:20     ` Gordon Pettey
  2017-06-29  2:49     ` Mike Gilbert
@ 2017-06-29 10:30     ` Joshua Kinard
  2017-06-29 21:19     ` [gentoo-dev] [PATCH] " James Le Cuirot
  3 siblings, 0 replies; 11+ messages in thread
From: Joshua Kinard @ 2017-06-29 10:30 UTC (permalink / raw
  To: gentoo-dev

On 06/28/2017 18:29, James Le Cuirot wrote:
> On Wed, 28 Jun 2017 17:52:26 -0400
> Mike Gilbert <floppym@gentoo.org> wrote:
> 
>> On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:
>>> I am therefore proposing a new global big-endian flag. This could be
>>> masked by default and unmasked + forced in the relevant profiles under
>>> arch. I will apply this according to the mapping defined in tc-endian of
>>> toolchain-funcs.eclass.  
> 
> I've just been putting the patch together. I made it slightly simpler
> by masking *and* forcing it by default so that it only needs to be
> unmasked were necessary.
> 
>> A possible alternative would be to create a new USE_EXPAND variable
>> for this. That would allow for easier expansion in case we ever
>> support something other than big/little endian machines.
> 
> That way madness lies? Wikipedia talks about middle-endian as being the
> catch all for other random orderings that have appeared over the years
> but I don't think any of them were used on a system-wide basis. I can't
> imagine Linux ever supporting such a thing. Unless you're talking about
> dealing with soft vs hard float here too?

As far as I know, Linux only supports big-endian and little-endian systems,
along with supporting a fairly-wide variety of platforms and architectures,
beaten really only by NetBSD.  If NetBSD lacks anything for middle-endian, then
it's probably safe to ignore it.

That said, Wikipedia doesn't offer much on the nature of middle-endian (which
is called "PDP-endian"), except to state that "The ARM architecture can also
produce this format when writing a 32-bit word to an address 2 bytes from a
32-bit word alignment."
https://en.wikipedia.org/wiki/Endianness#Middle

And this resource:
http://unixpapa.com/incnote/byteorder.html

Recommends to ignore middle-endian, as it believes no processor was ever
implemented that stored integers in middle-endian format.

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
6144R/F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And our
lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] Profile-enforced big-endian USE flag
  2017-06-28 22:29   ` James Le Cuirot
                       ` (2 preceding siblings ...)
  2017-06-29 10:30     ` Joshua Kinard
@ 2017-06-29 21:19     ` James Le Cuirot
  2017-06-29 21:37       ` Matt Turner
  2017-07-01  9:03       ` James Le Cuirot
  3 siblings, 2 replies; 11+ messages in thread
From: James Le Cuirot @ 2017-06-29 21:19 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 9216 bytes --]

On Wed, 28 Jun 2017 23:29:03 +0100
James Le Cuirot <chewi@gentoo.org> wrote:

> > On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:  
> > > I am therefore proposing a new global big-endian flag. This could be
> > > masked by default and unmasked + forced in the relevant profiles under
> > > arch. I will apply this according to the mapping defined in tc-endian of
> > > toolchain-funcs.eclass.    
> 
> I've just been putting the patch together. I made it slightly simpler
> by masking *and* forcing it by default so that it only needs to be
> unmasked were necessary.

Feedback seems positive so here is the patch. I'll apply it late next
week as I don't need it immediately and I will be away until then.

---

From e6aaee518b5e7eab735116a2ea57d538a8e26c19 Mon Sep 17 00:00:00 2001
From: James Le Cuirot <chewi@gentoo.org>
Date: Thu, 29 Jun 2017 22:11:49 +0100
Subject: [PATCH] profiles: Add profile-enforced global big-endian USE flag

The flag is forced and masked by default and then unmasked where
necessary. Note that there are some big endian host values listed in
tc-endian() that we do not have profiles for.
---
 profiles/arch/alpha/use.mask              | 4 ++++
 profiles/arch/arm64/big-endian/use.mask   | 6 ++++++
 profiles/arch/base/use.force              | 6 ++++++
 profiles/arch/base/use.mask               | 4 ++++
 profiles/arch/hppa/use.mask               | 4 ++++
 profiles/arch/m68k/use.mask               | 7 +++++++
 profiles/arch/mips/mipsel/use.mask        | 6 ++++++
 profiles/arch/mips/use.mask               | 4 ++++
 profiles/arch/powerpc/ppc64/64le/use.mask | 4 ++++
 profiles/arch/powerpc/use.mask            | 7 +++++++
 profiles/arch/s390/use.mask               | 7 +++++++
 profiles/arch/sparc/use.mask              | 4 ++++
 profiles/use.desc                         | 3 ++-
 13 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 profiles/arch/arm64/big-endian/use.mask
 create mode 100644 profiles/arch/base/use.force
 create mode 100644 profiles/arch/mips/mipsel/use.mask

diff --git a/profiles/arch/alpha/use.mask b/profiles/arch/alpha/use.mask
index d488fe8a09f4..b17afe9d9d4d 100644
--- a/profiles/arch/alpha/use.mask
+++ b/profiles/arch/alpha/use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2017 Gentoo Foundation.
 # Distributed under the terms of the GNU General Public License, v2
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 # Tobias Klausmann <klausman@gentoo.org> (03 March 2017)
 # There is no luajit support on alpha. Bugs #554376, #608322.
 luajit
diff --git a/profiles/arch/arm64/big-endian/use.mask b/profiles/arch/arm64/big-endian/use.mask
new file mode 100644
index 000000000000..0a4af0711f5c
--- /dev/null
+++ b/profiles/arch/arm64/big-endian/use.mask
@@ -0,0 +1,6 @@
+# Copyright 1999-2017 Gentoo Foundation.
+# Distributed under the terms of the GNU General Public License, v2
+
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
diff --git a/profiles/arch/base/use.force b/profiles/arch/base/use.force
new file mode 100644
index 000000000000..7f213b9dd017
--- /dev/null
+++ b/profiles/arch/base/use.force
@@ -0,0 +1,6 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Forced and masked by default. Unmask where necessary.
+big-endian
diff --git a/profiles/arch/base/use.mask b/profiles/arch/base/use.mask
index 1a4a39cefc13..2ea1fb3d89fa 100644
--- a/profiles/arch/base/use.mask
+++ b/profiles/arch/base/use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Forced and masked by default. Unmask where necessary.
+big-endian
+
 # Sven Wegener <swegener@gentoo.org> (31 May 2017)
 # libvirt is only supported on specific architectures
 libvirt
diff --git a/profiles/arch/hppa/use.mask b/profiles/arch/hppa/use.mask
index 7361e2c52af2..bd158162a449 100644
--- a/profiles/arch/hppa/use.mask
+++ b/profiles/arch/hppa/use.mask
@@ -3,6 +3,10 @@
 # NOTE: When masking a USE flag due to missing keywords, please file a keyword
 # request bug for the hppa arch.
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 # Andreas Sturmlechner <asturm@gentoo.org> (25 Feb 2017)
 # kwallet integration split from kde to distinct flag
 kwallet
diff --git a/profiles/arch/m68k/use.mask b/profiles/arch/m68k/use.mask
index aac0e46e97c2..646567111d56 100644
--- a/profiles/arch/m68k/use.mask
+++ b/profiles/arch/m68k/use.mask
@@ -1,6 +1,13 @@
+# Copyright 1999-2017 Gentoo Foundation.
+# Distributed under the terms of the GNU General Public License, v2
+
 # Unmask the flag which corresponds to ARCH.
 -m68k
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 hardened
 
 # Paul de Vrieze <pauldv@gentoo.org>
diff --git a/profiles/arch/mips/mipsel/use.mask b/profiles/arch/mips/mipsel/use.mask
new file mode 100644
index 000000000000..2a8cc7b0c76a
--- /dev/null
+++ b/profiles/arch/mips/mipsel/use.mask
@@ -0,0 +1,6 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Remask as this profile is little endian.
+big-endian
diff --git a/profiles/arch/mips/use.mask b/profiles/arch/mips/use.mask
index 09ac8ca4b2cc..6caff81617cb 100644
--- a/profiles/arch/mips/use.mask
+++ b/profiles/arch/mips/use.mask
@@ -4,6 +4,10 @@
 # Unmask the flag which corresponds to ARCH.
 -mips
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 # Mart Raudsepp <leio@gentoo.org> (27 May 2017)
 # media-libs/libmtp not tested
 mtp
diff --git a/profiles/arch/powerpc/ppc64/64le/use.mask b/profiles/arch/powerpc/ppc64/64le/use.mask
index 2419ed9b6428..b8ad07b24a5a 100644
--- a/profiles/arch/powerpc/ppc64/64le/use.mask
+++ b/profiles/arch/powerpc/ppc64/64le/use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Remask as this profile is little endian.
+big-endian
+
 # 2008/02/13 - Chris Gianelloni <wolf31o2@gentoo.org>
 # Mask multilib, since we cannot use it.
 multilib
diff --git a/profiles/arch/powerpc/use.mask b/profiles/arch/powerpc/use.mask
index 6f993c6628c0..02e97b16f06d 100644
--- a/profiles/arch/powerpc/use.mask
+++ b/profiles/arch/powerpc/use.mask
@@ -1,6 +1,13 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
 # PPC Specific use flags
 #
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Forced and masked by default. Unmask where necessary.
+big-endian
+
 # Matt Turner <mattst88@gentoo.org> (24 Mar 2017)
 # virtual/opencl is not keyworded
 opencl
diff --git a/profiles/arch/s390/use.mask b/profiles/arch/s390/use.mask
index 91dda10d0408..18637daa1445 100644
--- a/profiles/arch/s390/use.mask
+++ b/profiles/arch/s390/use.mask
@@ -1,9 +1,16 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
 # Unmask the flag which corresponds to ARCH.
 -s390
 
 # Unmask ABI flags for this arch.
 -abi_s390_32
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 # Stuff we don't want/not tested
 pbins
 R
diff --git a/profiles/arch/sparc/use.mask b/profiles/arch/sparc/use.mask
index be19f2f7ed54..0d3e7049cf28 100644
--- a/profiles/arch/sparc/use.mask
+++ b/profiles/arch/sparc/use.mask
@@ -6,6 +6,10 @@
 
 # This file contains a list of useflags that cannot be used on sparc.
 
+# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
+# Unmask as this profile is big endian.
+-big-endian
+
 # Andreas Sturmlechner <asturm@gentoo.org> (25 Feb 2017)
 # kwallet integration split from kde to distinct flag
 kwallet
diff --git a/profiles/use.desc b/profiles/use.desc
index 127c9935fa2a..9501b38fe33d 100644
--- a/profiles/use.desc
+++ b/profiles/use.desc
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Keep them sorted
@@ -30,6 +30,7 @@ bash-completion - Enable bash-completion support
 bcmath - Add support for libbcmath
 berkdb - Add support for sys-libs/db (Berkeley DB for MySQL)
 bidi - Enable bidirectional language support
+big-endian - Big-endian toolchain support
 bindist - Flag to enable or disable options for prebuilt (GRP) packages (eg. due to licensing issues)
 blas - Add support for the virtual/blas numerical library
 bluetooth - Enable Bluetooth Support
-- 
2.13.1


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] Profile-enforced big-endian USE flag
  2017-06-29 21:19     ` [gentoo-dev] [PATCH] " James Le Cuirot
@ 2017-06-29 21:37       ` Matt Turner
  2017-06-29 21:52         ` James Le Cuirot
  2017-07-01  9:03       ` James Le Cuirot
  1 sibling, 1 reply; 11+ messages in thread
From: Matt Turner @ 2017-06-29 21:37 UTC (permalink / raw
  To: gentoo development

On Thu, Jun 29, 2017 at 2:19 PM, James Le Cuirot <chewi@gentoo.org> wrote:
> On Wed, 28 Jun 2017 23:29:03 +0100
> James Le Cuirot <chewi@gentoo.org> wrote:
>
>> > On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:
>> > > I am therefore proposing a new global big-endian flag. This could be
>> > > masked by default and unmasked + forced in the relevant profiles under
>> > > arch. I will apply this according to the mapping defined in tc-endian of
>> > > toolchain-funcs.eclass.
>>
>> I've just been putting the patch together. I made it slightly simpler
>> by masking *and* forcing it by default so that it only needs to be
>> unmasked were necessary.
>
> Feedback seems positive so here is the patch. I'll apply it late next
> week as I don't need it immediately and I will be away until then.
>
> ---
>
> From e6aaee518b5e7eab735116a2ea57d538a8e26c19 Mon Sep 17 00:00:00 2001
> From: James Le Cuirot <chewi@gentoo.org>
> Date: Thu, 29 Jun 2017 22:11:49 +0100
> Subject: [PATCH] profiles: Add profile-enforced global big-endian USE flag
>
> The flag is forced and masked by default and then unmasked where
> necessary. Note that there are some big endian host values listed in
> tc-endian() that we do not have profiles for.
> ---
>  profiles/arch/alpha/use.mask              | 4 ++++
>  profiles/arch/arm64/big-endian/use.mask   | 6 ++++++
>  profiles/arch/base/use.force              | 6 ++++++
>  profiles/arch/base/use.mask               | 4 ++++
>  profiles/arch/hppa/use.mask               | 4 ++++
>  profiles/arch/m68k/use.mask               | 7 +++++++
>  profiles/arch/mips/mipsel/use.mask        | 6 ++++++
>  profiles/arch/mips/use.mask               | 4 ++++
>  profiles/arch/powerpc/ppc64/64le/use.mask | 4 ++++
>  profiles/arch/powerpc/use.mask            | 7 +++++++
>  profiles/arch/s390/use.mask               | 7 +++++++
>  profiles/arch/sparc/use.mask              | 4 ++++
>  profiles/use.desc                         | 3 ++-
>  13 files changed, 65 insertions(+), 1 deletion(-)
>  create mode 100644 profiles/arch/arm64/big-endian/use.mask
>  create mode 100644 profiles/arch/base/use.force
>  create mode 100644 profiles/arch/mips/mipsel/use.mask
>
> diff --git a/profiles/arch/alpha/use.mask b/profiles/arch/alpha/use.mask
> index d488fe8a09f4..b17afe9d9d4d 100644
> --- a/profiles/arch/alpha/use.mask
> +++ b/profiles/arch/alpha/use.mask
> @@ -1,6 +1,10 @@
>  # Copyright 1999-2017 Gentoo Foundation.
>  # Distributed under the terms of the GNU General Public License, v2
>
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Unmask as this profile is big endian.
> +-big-endian

No. Alpha is little endian.

> +
>  # Tobias Klausmann <klausman@gentoo.org> (03 March 2017)
>  # There is no luajit support on alpha. Bugs #554376, #608322.
>  luajit
> diff --git a/profiles/arch/arm64/big-endian/use.mask b/profiles/arch/arm64/big-endian/use.mask
> new file mode 100644
> index 000000000000..0a4af0711f5c
> --- /dev/null
> +++ b/profiles/arch/arm64/big-endian/use.mask
> @@ -0,0 +1,6 @@
> +# Copyright 1999-2017 Gentoo Foundation.
> +# Distributed under the terms of the GNU General Public License, v2
> +
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Unmask as this profile is big endian.
> +-big-endian
> diff --git a/profiles/arch/base/use.force b/profiles/arch/base/use.force
> new file mode 100644
> index 000000000000..7f213b9dd017
> --- /dev/null
> +++ b/profiles/arch/base/use.force
> @@ -0,0 +1,6 @@
> +# Copyright 1999-2017 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Forced and masked by default. Unmask where necessary.
> +big-endian
> diff --git a/profiles/arch/base/use.mask b/profiles/arch/base/use.mask
> index 1a4a39cefc13..2ea1fb3d89fa 100644
> --- a/profiles/arch/base/use.mask
> +++ b/profiles/arch/base/use.mask
> @@ -1,6 +1,10 @@
>  # Copyright 1999-2017 Gentoo Foundation
>  # Distributed under the terms of the GNU General Public License v2
>
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Forced and masked by default. Unmask where necessary.
> +big-endian
> +
>  # Sven Wegener <swegener@gentoo.org> (31 May 2017)
>  # libvirt is only supported on specific architectures
>  libvirt
> diff --git a/profiles/arch/hppa/use.mask b/profiles/arch/hppa/use.mask
> index 7361e2c52af2..bd158162a449 100644
> --- a/profiles/arch/hppa/use.mask
> +++ b/profiles/arch/hppa/use.mask
> @@ -3,6 +3,10 @@
>  # NOTE: When masking a USE flag due to missing keywords, please file a keyword
>  # request bug for the hppa arch.
>
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Unmask as this profile is big endian.
> +-big-endian
> +
>  # Andreas Sturmlechner <asturm@gentoo.org> (25 Feb 2017)
>  # kwallet integration split from kde to distinct flag
>  kwallet
> diff --git a/profiles/arch/m68k/use.mask b/profiles/arch/m68k/use.mask
> index aac0e46e97c2..646567111d56 100644
> --- a/profiles/arch/m68k/use.mask
> +++ b/profiles/arch/m68k/use.mask
> @@ -1,6 +1,13 @@
> +# Copyright 1999-2017 Gentoo Foundation.
> +# Distributed under the terms of the GNU General Public License, v2
> +
>  # Unmask the flag which corresponds to ARCH.
>  -m68k
>
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Unmask as this profile is big endian.
> +-big-endian
> +
>  hardened
>
>  # Paul de Vrieze <pauldv@gentoo.org>
> diff --git a/profiles/arch/mips/mipsel/use.mask b/profiles/arch/mips/mipsel/use.mask
> new file mode 100644
> index 000000000000..2a8cc7b0c76a
> --- /dev/null
> +++ b/profiles/arch/mips/mipsel/use.mask
> @@ -0,0 +1,6 @@
> +# Copyright 1999-2017 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Remask as this profile is little endian.
> +big-endian
> diff --git a/profiles/arch/mips/use.mask b/profiles/arch/mips/use.mask
> index 09ac8ca4b2cc..6caff81617cb 100644
> --- a/profiles/arch/mips/use.mask
> +++ b/profiles/arch/mips/use.mask
> @@ -4,6 +4,10 @@
>  # Unmask the flag which corresponds to ARCH.
>  -mips
>
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Unmask as this profile is big endian.
> +-big-endian

I'm not sure if this one is correct. arch/mips/mipsel's 'parent' file
contains '..'

I think if you re-mask big-endian in arch/mips/mipsel it'll work, and
that seems like the best way to solve it.

Other than that, the rest looks correct.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] Profile-enforced big-endian USE flag
  2017-06-29 21:37       ` Matt Turner
@ 2017-06-29 21:52         ` James Le Cuirot
  2017-07-01  8:04           ` Tobias Klausmann
  0 siblings, 1 reply; 11+ messages in thread
From: James Le Cuirot @ 2017-06-29 21:52 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 2695 bytes --]

On Thu, 29 Jun 2017 14:37:49 -0700
Matt Turner <mattst88@gentoo.org> wrote:

> On Thu, Jun 29, 2017 at 2:19 PM, James Le Cuirot <chewi@gentoo.org> wrote:
> > On Wed, 28 Jun 2017 23:29:03 +0100
> > James Le Cuirot <chewi@gentoo.org> wrote:
> >  
> >> > On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:  
> >> > > I am therefore proposing a new global big-endian flag. This could be
> >> > > masked by default and unmasked + forced in the relevant profiles under
> >> > > arch. I will apply this according to the mapping defined in tc-endian of
> >> > > toolchain-funcs.eclass.  
> >>
> >> I've just been putting the patch together. I made it slightly simpler
> >> by masking *and* forcing it by default so that it only needs to be
> >> unmasked were necessary.  
> >
> > Feedback seems positive so here is the patch. I'll apply it late next
> > week as I don't need it immediately and I will be away until then.
> >
> > ---
> >
> > diff --git a/profiles/arch/alpha/use.mask b/profiles/arch/alpha/use.mask
> > index d488fe8a09f4..b17afe9d9d4d 100644
> > --- a/profiles/arch/alpha/use.mask
> > +++ b/profiles/arch/alpha/use.mask
> > @@ -1,6 +1,10 @@
> >  # Copyright 1999-2017 Gentoo Foundation.
> >  # Distributed under the terms of the GNU General Public License, v2
> >
> > +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> > +# Unmask as this profile is big endian.
> > +-big-endian  
> 
> No. Alpha is little endian.

Wikipedia says it is bi. tc-native() reports alpha* as big so I guess
that's the only variant we support? Then again, this page says it is
usually little. Is tc-native() wrong?

https://kernelnewbies.org/EndianIssues

> > --- /dev/null
> > +++ b/profiles/arch/mips/mipsel/use.mask
> > @@ -0,0 +1,6 @@
> > +# Copyright 1999-2017 Gentoo Foundation
> > +# Distributed under the terms of the GNU General Public License v2
> > +
> > +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> > +# Remask as this profile is little endian.
> > +big-endian
> > diff --git a/profiles/arch/mips/use.mask b/profiles/arch/mips/use.mask
> > index 09ac8ca4b2cc..6caff81617cb 100644
> > --- a/profiles/arch/mips/use.mask
> > +++ b/profiles/arch/mips/use.mask
> > @@ -4,6 +4,10 @@
> >  # Unmask the flag which corresponds to ARCH.
> >  -mips
> >
> > +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> > +# Unmask as this profile is big endian.
> > +-big-endian  
> 
> I'm not sure if this one is correct. arch/mips/mipsel's 'parent' file
> contains '..'
> 
> I think if you re-mask big-endian in arch/mips/mipsel it'll work, and
> that seems like the best way to solve it.

That's what I did?

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] Profile-enforced big-endian USE flag
  2017-06-29 21:52         ` James Le Cuirot
@ 2017-07-01  8:04           ` Tobias Klausmann
  0 siblings, 0 replies; 11+ messages in thread
From: Tobias Klausmann @ 2017-07-01  8:04 UTC (permalink / raw
  To: gentoo-dev

Hi! 

On Thu, 29 Jun 2017, James Le Cuirot wrote:
> > No. Alpha is little endian.
> 
> Wikipedia says it is bi. tc-native() reports alpha* as big so I guess
> that's the only variant we support? Then again, this page says it is
> usually little. Is tc-native() wrong?
> 
> https://kernelnewbies.org/EndianIssues

For the purposes of explanation, let's distinguish
Alpha-the-processor from Alpha-the-systems here.

Yes, the AtP can be switched between big- and little-endianess.

AtS can't. That is, once built, hardware-wise, it has to be
either, but can never switch. Even the firmware has to be
different between LE and BE systems.

There are a lot of LE Alpha systems, in essence, everything that
was ever sold as an Alpha system by DEC, Compaq, HP and sundry
others (like Samsung, who made the UP1500 and related systems).
As a guideline: if it ever ran True64, OSF/1 or digital alpha
UNIX, it is little-endian.

The machines that run Alpha CPUs in big-endian mode are
exclusively Cray supercomputers like the Cray T3D and T3E series.

Linux only ever supported parts of the former group (e.g. the
high-end Alpha server GS1280 series from Compaq is definitely not,
despite running in little-endian mode). The big endian Crays were
never even close to be supported.

tl;dr: Alpha is little-endian only for (our) practical purposes.

Regards,
Tobias

PS: There may be obscure one-off or developer boards for Alphas
which can switch, but the tl;dr still stands.


-- 
Sent from aboard the Culture ship
	GSV (Range Class) Ethics Gradient


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-dev] [PATCH] Profile-enforced big-endian USE flag
  2017-06-29 21:19     ` [gentoo-dev] [PATCH] " James Le Cuirot
  2017-06-29 21:37       ` Matt Turner
@ 2017-07-01  9:03       ` James Le Cuirot
  1 sibling, 0 replies; 11+ messages in thread
From: James Le Cuirot @ 2017-07-01  9:03 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

On Thu, 29 Jun 2017 22:19:58 +0100
James Le Cuirot <chewi@gentoo.org> wrote:

> On Wed, 28 Jun 2017 23:29:03 +0100
> James Le Cuirot <chewi@gentoo.org> wrote:
> 
> > > On Tue, Jun 27, 2017 at 6:44 PM, James Le Cuirot <chewi@gentoo.org> wrote:    
> > > > I am therefore proposing a new global big-endian flag. This could be
> > > > masked by default and unmasked + forced in the relevant profiles under
> > > > arch. I will apply this according to the mapping defined in tc-endian of
> > > > toolchain-funcs.eclass.      
> > 
> > I've just been putting the patch together. I made it slightly simpler
> > by masking *and* forcing it by default so that it only needs to be
> > unmasked were necessary.  
> 
> Feedback seems positive so here is the patch. I'll apply it late next
> week as I don't need it immediately and I will be away until then.
> 
> ---
> 
> diff --git a/profiles/arch/powerpc/use.mask b/profiles/arch/powerpc/use.mask
> index 6f993c6628c0..02e97b16f06d 100644
> --- a/profiles/arch/powerpc/use.mask
> +++ b/profiles/arch/powerpc/use.mask
> @@ -1,6 +1,13 @@
> +# Copyright 1999-2017 Gentoo Foundation
> +# Distributed under the terms of the GNU General Public License v2
> +
>  # PPC Specific use flags
>  #
>  
> +# James Le Cuirot <chewi@gentoo.org> (29 Jun 2017)
> +# Forced and masked by default. Unmask where necessary.
> +big-endian
> +
>  # Matt Turner <mattst88@gentoo.org> (24 Mar 2017)
>  # virtual/opencl is not keyworded
>  opencl

Just noticed a copy/pasta fail here. Obviously should be -big-endian.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-07-01  9:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-27 22:44 [gentoo-dev] Profile-enforced big-endian USE flag James Le Cuirot
2017-06-28 21:52 ` Mike Gilbert
2017-06-28 22:29   ` James Le Cuirot
2017-06-28 23:20     ` Gordon Pettey
2017-06-29  2:49     ` Mike Gilbert
2017-06-29 10:30     ` Joshua Kinard
2017-06-29 21:19     ` [gentoo-dev] [PATCH] " James Le Cuirot
2017-06-29 21:37       ` Matt Turner
2017-06-29 21:52         ` James Le Cuirot
2017-07-01  8:04           ` Tobias Klausmann
2017-07-01  9:03       ` James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox