diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2025-08-25 19:52:21 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-25 19:52:21 +1000 |
| commit | d89d8a7909d27dba72999c3c6c8f7d3e65486d31 (patch) | |
| tree | 45b49855347b0721ac9935cb48e2d1002bb5c6fc | |
| parent | c38bbf5dfee9d375cc465d15ee045326d0068c3a (diff) | |
| parent | 2f1b6d19f180764b06a9daef88e9046d447f7055 (diff) | |
| download | rust-d89d8a7909d27dba72999c3c6c8f7d3e65486d31.tar.gz rust-d89d8a7909d27dba72999c3c6c8f7d3e65486d31.zip | |
Rollup merge of #145794 - he32:bootstrap-netbsd-fix, r=Kobzol
bootstrap.py: Improve CPU detection on NetBSD ...and add some adaptation of detection for some arm variants.
| -rw-r--r-- | src/bootstrap/bootstrap.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 40e08361a0f..2ece53eb0cc 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -312,6 +312,12 @@ def default_build_triple(verbose): kernel, cputype, processor = uname.decode(default_encoding).split(maxsplit=2) + # ON NetBSD, use `uname -p` to set the CPU type + if kernel == "NetBSD": + cputype = ( + subprocess.check_output(["uname", "-p"]).strip().decode(default_encoding) + ) + # The goal here is to come up with the same triple as LLVM would, # at least for the subset of platforms we're willing to target. kerneltype_mapper = { @@ -433,10 +439,16 @@ def default_build_triple(verbose): kernel = "linux-androideabi" else: kernel += "eabihf" - elif cputype in {"armv7l", "armv8l"}: + elif cputype in {"armv6hf", "earmv6hf"}: + cputype = "armv6" + if kernel == "unknown-netbsd": + kernel += "-eabihf" + elif cputype in {"armv7l", "earmv7hf", "armv8l"}: cputype = "armv7" if kernel == "linux-android": kernel = "linux-androideabi" + elif kernel == "unknown-netbsd": + kernel += "-eabihf" else: kernel += "eabihf" elif cputype == "mips": |
