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