public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/arch/
Date: Sat, 19 Oct 2019 23:25:28 +0000 (UTC)	[thread overview]
Message-ID: <1571526776.0c5789c8b629ec3b0a38b9632fdc58a66ac168db.mattst88@gentoo> (raw)

commit:     0c5789c8b629ec3b0a38b9632fdc58a66ac168db
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 19 23:12:56 2019 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sat Oct 19 23:12:56 2019 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0c5789c8

arch: Use platform.machine() instead of "buildarch"

In stagebase.py, machinemap contains a mapping of subarches to the name
of the module they're loaded from. For example:

	{
		'g3': 'powerpc',
		'g4': 'powerpc',
		'g5': 'powerpc',
		...
	}

machinemap[subarch] is assigned to self.settings["buildarch"], so it is
always equal to the name of the arch module in use.

ppc.py and ppc64.py were merged into powerpc.py (and similarly sparc.py
and sparc64.py into sparc.py) in commit 4db65217ed36 ("Merged ppc.py and
ppc64.py into powerpc.py and merged sparc.py and sparc64.py into
sparc.py, so we have a cleaner set of arch files.") in 2008, leaving
these checks against self.settings["buildarch"] always evaluating to
false.

amd64/x86 are unaffected since they still exist as separate .py files,
but x86.py is modified for consistency.

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/arch/powerpc.py | 3 ++-
 catalyst/arch/sparc.py   | 3 ++-
 catalyst/arch/x86.py     | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/catalyst/arch/powerpc.py b/catalyst/arch/powerpc.py
index 59a6d625..548df44b 100644
--- a/catalyst/arch/powerpc.py
+++ b/catalyst/arch/powerpc.py
@@ -1,3 +1,4 @@
+import platform
 
 from catalyst import builder
 
@@ -6,7 +7,7 @@ class generic_ppc(builder.generic):
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
 		self.settings["CHOST"]="powerpc-unknown-linux-gnu"
-		if self.settings["buildarch"]=="ppc64":
+		if platform.machine() == 'ppc64':
 			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 

diff --git a/catalyst/arch/sparc.py b/catalyst/arch/sparc.py
index d0ce8c65..782d8916 100644
--- a/catalyst/arch/sparc.py
+++ b/catalyst/arch/sparc.py
@@ -1,3 +1,4 @@
+import platform
 
 from catalyst import builder
 
@@ -5,7 +6,7 @@ class generic_sparc(builder.generic):
 	"abstract base class for all sparc builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		if self.settings["buildarch"]=="sparc64":
+		if platform.machine() == 'sparc64':
 			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 

diff --git a/catalyst/arch/x86.py b/catalyst/arch/x86.py
index 3e369370..e00b2684 100644
--- a/catalyst/arch/x86.py
+++ b/catalyst/arch/x86.py
@@ -1,3 +1,4 @@
+import platform
 
 from catalyst import builder
 
@@ -5,7 +6,7 @@ class generic_x86(builder.generic):
 	"abstract base class for all x86 builders"
 	def __init__(self,myspec):
 		builder.generic.__init__(self,myspec)
-		if self.settings["buildarch"]=="amd64":
+		if platform.machine() == 'x86_64':
 			self.setarch('linux32')
 			self.settings["crosscompile"] = False
 


             reply	other threads:[~2019-10-19 23:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19 23:25 Matt Turner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-14 18:29 [gentoo-commits] proj/catalyst:master commit in: catalyst/arch/ Matt Turner
2020-04-14 18:29 Matt Turner
2020-04-14 18:29 Matt Turner
2020-04-14 18:29 Matt Turner
2020-04-14 18:29 Matt Turner
2020-04-11 20:27 Matt Turner
2020-04-11 20:27 Matt Turner
2020-04-11 20:27 Matt Turner
2020-04-11 20:27 Matt Turner
2020-04-11 20:27 Matt Turner
2020-03-31 18:38 Matt Turner
2020-03-29 17:48 Matt Turner
2019-10-20  0:00 Matt Turner
2019-08-30  3:08 Matt Turner
2019-08-26 16:48 Matt Turner
2019-04-24 22:39 Matt Turner
2016-04-21  5:37 Mike Frysinger
2015-09-22 22:38 Anthony G. Basile
2015-09-09 16:21 Richard Farina
2015-08-31 17:51 Richard Farina
2015-05-24  0:08 Brian Dolbec
2014-04-02 20:09 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-04-02 20:09 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec
2014-03-22 22:25 [gentoo-commits] proj/catalyst:pending " Brian Dolbec
2014-03-02 22:55 ` [gentoo-commits] proj/catalyst:master " Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571526776.0c5789c8b629ec3b0a38b9632fdc58a66ac168db.mattst88@gentoo \
    --to=mattst88@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox