aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-30 10:38:47 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-08-30 10:38:47 -0700
commit78f8a286d06eb31f361d616098e59c0cfee2a911 (patch)
tree063717ba9e244ec0e4b95971e3dab35d02f89578
parentb8cdae70033843e054ab6580fdeec1c08693c645 (diff)
downloadmeson-78f8a286d06eb31f361d616098e59c0cfee2a911.zip
meson-78f8a286d06eb31f361d616098e59c0cfee2a911.tar.gz
meson-78f8a286d06eb31f361d616098e59c0cfee2a911.tar.bz2
environment: add ppc -> ppc64 for aix to detect_cpu
This seems like an oversight, that we'd replace ppc with ppc64 on AIX for the cpu_family, but not for the specific cpu.
-rw-r--r--mesonbuild/environment.py4
-rw-r--r--unittests/internaltests.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 5a9a587..3ad150d 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -387,6 +387,10 @@ def detect_cpu(compilers: CompilersDict) -> str:
trial = 'mips'
else:
trial = 'mips64'
+ elif trial == 'ppc':
+ # AIX always returns powerpc, check here for 64-bit
+ if any_compiler_has_define(compilers, '__64BIT__'):
+ trial = 'ppc64'
# Add more quirks here as bugs are reported. Keep in sync with
# detect_cpu_family() above.
diff --git a/unittests/internaltests.py b/unittests/internaltests.py
index ad86062..de2badb 100644
--- a/unittests/internaltests.py
+++ b/unittests/internaltests.py
@@ -1509,7 +1509,7 @@ class InternalTests(unittest.TestCase):
self.assertEqual(actual, expected)
with mock.patch('mesonbuild.environment.any_compiler_has_define', mock.Mock(return_value=True)):
- for test, expected in [('x86_64', 'i686'), ('aarch64', 'arm')]:
+ for test, expected in [('x86_64', 'i686'), ('aarch64', 'arm'), ('ppc', 'ppc64')]:
with self.subTest(test, has_define=True), mock_trial(test):
actual = mesonbuild.environment.detect_cpu({})
self.assertEqual(actual, expected)