From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7A589138334 for ; Sat, 19 Oct 2019 23:25:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BFB57E0874; Sat, 19 Oct 2019 23:25:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9881FE0874 for ; Sat, 19 Oct 2019 23:25:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 41A8034C03A for ; Sat, 19 Oct 2019 23:25:30 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2063C828 for ; Sat, 19 Oct 2019 23:25:28 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1571526776.0c5789c8b629ec3b0a38b9632fdc58a66ac168db.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/arch/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/arch/powerpc.py catalyst/arch/sparc.py catalyst/arch/x86.py X-VCS-Directories: catalyst/arch/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 0c5789c8b629ec3b0a38b9632fdc58a66ac168db X-VCS-Branch: master Date: Sat, 19 Oct 2019 23:25:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f6cbe853-b635-4d62-9ab0-4a79c2182a23 X-Archives-Hash: d7fb99bc183e66f0d68516cd7e227125 commit: 0c5789c8b629ec3b0a38b9632fdc58a66ac168db Author: Matt Turner gentoo org> AuthorDate: Sat Oct 19 23:12:56 2019 +0000 Commit: Matt Turner gentoo 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 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