summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2019-12-23 12:12:45 +0000
committerChandan Singh <csingh43@bloomberg.net>2019-12-23 12:19:24 +0000
commitf96536ecb3c6e3c1a76c10fb7161155c33174562 (patch)
tree4592d0ee3dea43b4ef2cffe4f5cbe7881f50872a
parent3930c84a9a5b18b2d99ccc77539a575f005e0642 (diff)
downloadbuildstream-chandan/ibm-7-platform.tar.gz
_platform/platform.py: Add alias for IBM AIX 7 powerpcchandan/ibm-7-platform
`uname -m` is unusable in case of IBM AIX 7 as it reports the serial number of the machine. As a workaround, special case it and use the reported processor identifier.
-rw-r--r--src/buildstream/_platform/platform.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/buildstream/_platform/platform.py b/src/buildstream/_platform/platform.py
index 848db509b..047c1490f 100644
--- a/src/buildstream/_platform/platform.py
+++ b/src/buildstream/_platform/platform.py
@@ -155,6 +155,7 @@ class Platform:
"i686": "x86-32",
"power-isa-be": "power-isa-be",
"power-isa-le": "power-isa-le",
+ "powerpc": "power-isa-be",
"powerpc64": "power-isa-be", # Used in GCC/LLVM
"powerpc64le": "power-isa-le", # Used in GCC/LLVM
"ppc64": "power-isa-be",
@@ -180,9 +181,16 @@ class Platform:
# (string): String representing the architecture
@staticmethod
def get_host_arch():
- # get the hardware identifier from uname
- uname_machine = platform.uname().machine
- return Platform.canonicalize_arch(uname_machine)
+ uname = platform.uname()
+
+ if uname.system.lower() == 'aix':
+ # IBM AIX systems reports their serial number as the machine
+ # hardware identifier. So, we need to look at the reported processor
+ # in this case.
+ return Platform.canonicalize_arch(uname.processor)
+ else:
+ # Otherwise, use the hardware identifier from uname
+ return Platform.canonicalize_arch(uname.machine)
# does_multiprocessing_start_require_pickling():
#