Skip to content

Commit b0977d2

Browse files
authored
Unrolled build for #145794
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.
2 parents ee361e8 + 2f1b6d1 commit b0977d2

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/bootstrap/bootstrap.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ def default_build_triple(verbose):
312312

313313
kernel, cputype, processor = uname.decode(default_encoding).split(maxsplit=2)
314314

315+
# ON NetBSD, use `uname -p` to set the CPU type
316+
if kernel == "NetBSD":
317+
cputype = (
318+
subprocess.check_output(["uname", "-p"]).strip().decode(default_encoding)
319+
)
320+
315321
# The goal here is to come up with the same triple as LLVM would,
316322
# at least for the subset of platforms we're willing to target.
317323
kerneltype_mapper = {
@@ -433,10 +439,16 @@ def default_build_triple(verbose):
433439
kernel = "linux-androideabi"
434440
else:
435441
kernel += "eabihf"
436-
elif cputype in {"armv7l", "armv8l"}:
442+
elif cputype in {"armv6hf", "earmv6hf"}:
443+
cputype = "armv6"
444+
if kernel == "unknown-netbsd":
445+
kernel += "-eabihf"
446+
elif cputype in {"armv7l", "earmv7hf", "armv8l"}:
437447
cputype = "armv7"
438448
if kernel == "linux-android":
439449
kernel = "linux-androideabi"
450+
elif kernel == "unknown-netbsd":
451+
kernel += "-eabihf"
440452
else:
441453
kernel += "eabihf"
442454
elif cputype == "mips":

0 commit comments

Comments
 (0)