diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-08-31 20:29:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-31 20:29:29 +0300 |
commit | 82ba2f1e0532686dd7408ea782181b172a291316 (patch) | |
tree | 6f084d763c20fc18723097336ee8ae811999ba5e /mesonbuild | |
parent | 10151d87380883b113aefb70681a548a50e37688 (diff) | |
parent | f073c3cfe16a81afbf31e85fd08603a8044c3ef1 (diff) | |
download | meson-82ba2f1e0532686dd7408ea782181b172a291316.zip meson-82ba2f1e0532686dd7408ea782181b172a291316.tar.gz meson-82ba2f1e0532686dd7408ea782181b172a291316.tar.bz2 |
Merge pull request #9193 from dcbaker/submit/aarch64-be
Handle aarch64_be as a cpu family
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/environment.py | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 4b3b6db..a509087 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -314,6 +314,9 @@ def detect_cpu_family(compilers: CompilersDict) -> str: trial = 'x86' elif trial == 'arm64': trial = 'aarch64' + elif trial.startswith('aarch64'): + # This can be `aarch64_be` + trial = 'aarch64' elif trial.startswith('arm') or trial.startswith('earm'): trial = 'arm' elif trial.startswith(('powerpc64', 'ppc64')): @@ -359,7 +362,7 @@ def detect_cpu_family(compilers: CompilersDict) -> str: return trial -def detect_cpu(compilers: CompilersDict): +def detect_cpu(compilers: CompilersDict) -> str: if mesonlib.is_windows(): trial = detect_windows_arch(compilers) elif mesonlib.is_freebsd() or mesonlib.is_netbsd() or mesonlib.is_openbsd() or mesonlib.is_aix(): @@ -373,10 +376,13 @@ def detect_cpu(compilers: CompilersDict): # Same check as above for cpu_family if any_compiler_has_define(compilers, '__i386__'): trial = 'i686' # All 64 bit cpus have at least this level of x86 support. - elif trial == 'aarch64': + elif trial.startswith('aarch64'): # Same check as above for cpu_family if any_compiler_has_define(compilers, '__arm__'): trial = 'arm' + else: + # for aarch64_be + trial = 'aarch64' elif trial.startswith('earm'): trial = 'arm' elif trial == 'e2k': @@ -387,20 +393,22 @@ def detect_cpu(compilers: CompilersDict): 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. return trial -def detect_system(): +def detect_system() -> str: if sys.platform == 'cygwin': return 'cygwin' return platform.system().lower() -def detect_msys2_arch(): - if 'MSYSTEM_CARCH' in os.environ: - return os.environ['MSYSTEM_CARCH'] - return None +def detect_msys2_arch() -> T.Optional[str]: + return os.environ.get('MSYSTEM_CARCH', None) def detect_machine_info(compilers: T.Optional[CompilersDict] = None) -> MachineInfo: """Detect the machine we're running on |