cmd/buildlet: add support for new macOS versioning

With the release of macOS 11.0 (Big Sur), the hostname for hosts need
to accomodate multiple architectures. The operating system version is
now noted in the major portion instead of the minor portion of the
version. This change creates the appropriate hostname in the buildlet.

Updates golang/go#40762
Updates golang/go#45088

Change-Id: I943f0c481442a892bb5793283c527b8400a5be9c
Reviewed-on: https://go-review.googlesource.com/c/build/+/293829
Trust: Carlos Amedee <carlos@golang.org>
Run-TryBot: Carlos Amedee <carlos@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/cmd/buildlet/buildlet.go b/cmd/buildlet/buildlet.go
index bc1f7a7..7a7a563 100644
--- a/cmd/buildlet/buildlet.go
+++ b/cmd/buildlet/buildlet.go
@@ -1688,7 +1688,20 @@
 		log.Fatalf("unsupported sw_vers version %q", version)
 	}
 	major, minor := m[1], m[2] // "10", "12"
-	*reverseType = fmt.Sprintf("host-darwin-%s_%s", major, minor)
+
+	// As of macOS 11.0 (Big Sur), the major digits are used to indicate the version of
+	// macOS. This version also introduced support for multiple architectures. This
+	// takes into account the need to distinguish between versions and architectures for
+	// the later versions.
+	mj, err := strconv.Atoi(major)
+	if err != nil {
+		log.Fatalf("unable to parse major version %q", major)
+	}
+	if mj >= 11 {
+		*reverseType = fmt.Sprintf("host-darwin-%s-%s_%s", runtime.GOARCH, major, "0")
+	} else {
+		*reverseType = fmt.Sprintf("host-darwin-%s_%s", major, minor)
+	}
 	*coordinator = "farmer.golang.org:443"
 
 	// guestName is set by cmd/makemac to something like