From 45bcbd99a5479658e0f97ecc3e3ed83ecbe47712 Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sat, 23 Aug 2025 19:15:46 +0000 Subject: [PATCH 1/3] bootstrap.py: Improve CPU detection on NetBSD, ...and add adaptation of detection for some arm variants. --- src/bootstrap/bootstrap.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 40e08361a0f1e..e14433dd2305a 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -312,6 +312,11 @@ 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 +438,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": From 3a2392bb082924449c87d28f5d3d8a60f309c9bf Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sat, 23 Aug 2025 21:40:19 +0000 Subject: [PATCH 2/3] bootstrap.py: follow up tidy output from CI. I thought tidy would be more allergic to 80-coloumn overflow, but so be it. --- src/bootstrap/bootstrap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index e14433dd2305a..b4af159ab8eae 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -314,8 +314,9 @@ def default_build_triple(verbose): # ON NetBSD, use `uname -p` to set the CPU type if kernel == 'NetBSD': - cputype = subprocess.check_output( - ['uname', '-p']).strip().decode(default_encoding) + 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. From 2f1b6d19f180764b06a9daef88e9046d447f7055 Mon Sep 17 00:00:00 2001 From: Havard Eidnes Date: Sun, 24 Aug 2025 09:39:33 +0000 Subject: [PATCH 3/3] bootstrap.py: follow up more 'tidy' insistence (string quotes). --- src/bootstrap/bootstrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index b4af159ab8eae..2ece53eb0cc99 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -313,9 +313,9 @@ 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': + if kernel == "NetBSD": cputype = ( - subprocess.check_output(['uname', '-p']).strip().decode(default_encoding) + subprocess.check_output(["uname", "-p"]).strip().decode(default_encoding) ) # The goal here is to come up with the same triple as LLVM would,