diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-12-05 22:23:50 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-05 19:39:01 +0200 |
commit | 0b3a607fd8629493f0cab499a6f3e873d7d09773 (patch) | |
tree | 0333661e71d3d5611c4ea087091753271af898db | |
parent | 579b5bba120c92fe319b278f6faf795045d44e0c (diff) | |
download | meson-0b3a607fd8629493f0cab499a6f3e873d7d09773.zip meson-0b3a607fd8629493f0cab499a6f3e873d7d09773.tar.gz meson-0b3a607fd8629493f0cab499a6f3e873d7d09773.tar.bz2 |
Correctly detect 32-bit arm userland on 64-bit arm
This is the same case as 32-bit x86 on x86_64.
Closes https://github.com/mesonbuild/meson/issues/4586
-rw-r--r-- | mesonbuild/environment.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index fa357d8..2ccd31e 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -252,13 +252,17 @@ def detect_cpu_family(compilers): elif trial in ('amd64', 'x64'): trial = 'x86_64' - # On Linux (and maybe others) there can be any mixture of 32/64 bit - # code in the kernel, Python, system etc. The only reliable way - # to know is to check the compiler defines. + # On Linux (and maybe others) there can be any mixture of 32/64 bit code in + # the kernel, Python, system, 32-bit chroot on 64-bit host, etc. The only + # reliable way to know is to check the compiler defines. if trial == 'x86_64': if any_compiler_has_define(compilers, '__i386__'): trial = 'x86' - # Add more quirks here as bugs are reported. + elif trial == 'aarch64': + if any_compiler_has_define(compilers, '__arm__'): + trial = 'arm' + # Add more quirks here as bugs are reported. Keep in sync with detect_cpu() + # below. if trial not in known_cpu_families: mlog.warning('Unknown CPU family {!r}, please report this at ' @@ -278,10 +282,15 @@ def detect_cpu(compilers): # 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': + # Same check as above for cpu_family + if any_compiler_has_define(compilers, '__arm__'): + trial = 'arm' elif trial == 'e2k': # Make more precise CPU detection for Elbrus platform. trial = platform.processor().lower() - # Add more quirks here as bugs are reported. + # Add more quirks here as bugs are reported. Keep in sync with + # detect_cpu_family() above. return trial def detect_system(): |