$NetBSD: patch-src_bootstrap_bootstrap.py,v 1.18 2023/05/03 22:39:09 he Exp $ Use `uname -p` on NetBSD, as that is reliable and sensible there. Handle earmv[67]hf for NetBSD. --- src/bootstrap/bootstrap.py.orig 2022-09-19 14:07:21.000000000 +0000 +++ src/bootstrap/bootstrap.py @@ -245,6 +245,11 @@ def default_build_triple(verbose): 'OpenBSD': 'unknown-openbsd' } + # For NetBSD, use `uname -p`, as there it is reliable & sensible + if ostype == 'NetBSD': + cputype = subprocess.check_output( + ['uname', '-p']).strip().decode(default_encoding) + # Consider the direct transformation first and then the special cases if ostype in ostype_mapper: ostype = ostype_mapper[ostype] @@ -298,6 +303,7 @@ def default_build_triple(verbose): cputype_mapper = { 'BePC': 'i686', 'aarch64': 'aarch64', + 'aarch64eb': 'aarch64', 'amd64': 'x86_64', 'arm64': 'aarch64', 'i386': 'i686', @@ -336,10 +342,16 @@ def default_build_triple(verbose): ostype = 'linux-androideabi' else: ostype += 'eabihf' - elif cputype in {'armv7l', 'armv8l'}: + elif cputype in {'armv6hf', 'earmv6hf'}: + cputype = 'armv6' + if ostype == 'unknown-netbsd': + ostype += '-eabihf' + elif cputype in {'armv7l', 'armv8l', 'earmv7hf'}: cputype = 'armv7' if ostype == 'linux-android': ostype = 'linux-androideabi' + elif ostype == 'unknown-netbsd': + ostype += '-eabihf' else: ostype += 'eabihf' elif cputype == 'mips':