Error compiling Golang for Apple Silicon

Following this guide https://github.com/golang/go/wiki/GoArm#apple-silicon to build a Go binary for Apple Silicon.

I am building in macOS Catalina 10.15.7 with Xcode 12.1 I get the following error messages:
Code Block In file included from _cgo_export.c:3:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/stdlib.h:66:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/wait.h:109:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/sys/signal.h:146:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/machine/_mcontext.h:31:2: error: architecture not supported
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Anyone has any recommendations about building a Go binary for Apple Silicon?
I am learning to build things on my new M1 MacBook Pro (MacBookPro17,1) after about 15 years of porting software on Mac PPC and x86_64, almost exclusively scientific code via MacPorts and GNU AutoTools.

So I've used Xcode, but I am very rusty at it.

However... I think I know what's wrong here.

The Apple Silicon Macs require macOS Big Sur or later. I think.

So for cross-compiling a project for Apple's aarch64, you will need to build against the new OS version:

macOS Deployment Target: 11.0 or later

Previous developer tools referred to macOS 10.16, but I do not see that as an SDK in the current version of Xcode.

Error compiling Golang for Apple Silicon
 
 
Q