The error "call to undeclared function 'SecIdentityCreate'; ISO C99 and later do not support implicit function declarations" means the C file was compiled against a macOS SDK whose headers do not declare that function. Apple's Security framework has carried SecIdentityCreate since macOS 10.12, but its prototype is public only from the macOS 26 SDK, and GitHub's macOS runner builds with Xcode 16.4 and the macOS 15.5 SDK, while our Mac built with the 26.0 SDK. With an older SDKROOT and the same build cache, the build on our Mac still passed, because Go handed back the package it had compiled with the newer SDK. One extern prototype fixed the file, and a build with an older SDKROOT and an empty GOCACHE shows the error on a Mac before a push.
The release runner stopped at one call in a C file
The 0.6.0 pull request of KEIBIDROP adds a C file, pkg/transport/nwquic/shim.c, that runs QUIC through Apple's Network.framework, and the first CI run on 29 November 2026 stopped in that file in the macOS arm64 build. The runner was GitHub's macos-15-arm64 image, version 20261123.0558.1, on macOS 15.8.2, with the compiler from /Applications/Xcode_16.4.app. This is the job log, word for word:
# github.com/KeibiSoft/KeibiDrop/pkg/transport/nwquic
shim.c:512:25: error: call to undeclared function 'SecIdentityCreate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
shim.c:512:25: note: did you mean 'sec_identity_create'?
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h:218:1: note: 'sec_identity_create' declared here
shim.c:512:17: error: incompatible integer to pointer conversion initializing 'SecIdentityRef' (aka 'struct __SecIdentity *') with an expression of type 'int' [-Wint-conversion]
The second error follows from the first, because a C compiler that finds no prototype takes the call to return an int, and an int does not convert to a SecIdentityRef. The same file had compiled on our Mac all along. Marius described the project in his Pass the SALT talk like this:
"And it's one Go code base that compiles on all the platforms."
That stays true for the Go code, and the C files inside it compile against whatever SDK the building machine has, which is where the two machines differed.
The runner's SDK does not declare the function, and the 26 SDK does
We read each machine's SDK from its own output. The readme of the runner image lists Xcode 16.4 as the default, with the macOS 15.5 SDK, and the job log shows the compiler under Xcode_16.4.app. Our Mac is an Intel MacBook Pro on macOS 26.7.3, and it prints this:
$ xcodebuild -version
Xcode 26.0.1
Build version 17A400
$ xcrun --show-sdk-version
26.0
The 26.0 SDK on that Mac declares the function in Security.framework/Headers/SecIdentity.h and marks it available from macOS 10.12, while the 15.2 and 15.4 SDKs in /Library/Developer/CommandLineTools/SDKs/ do not declare it at all. So the function is old and only its public declaration is new, and that is enough to stop a build, because the compiler checks a call against the headers and never looks into the library. Apple's guide to SDK-based development says what happens next:
"If your code uses a symbol: Not defined in the base SDK (for example, a symbol from a newer OS), you get a compile-time error."
One extern prototype builds on both SDKs
The fix declares the prototype in shim.c itself, under a comment that says why it is there:
// SecIdentityCreate has been in Security.framework since macOS 10.12, and its
// prototype is public only from the macOS 26 SDK. An older SDK needs this one.
extern SecIdentityRef SecIdentityCreate(CFAllocatorRef allocator, SecCertificateRef certificate, SecKeyRef privateKey);
The declaration has the same types as the one in the 26 SDK's header, so both SDKs accept the file, and the macOS builds of the later CI runs of pull request 243 passed. On 30 November we also built the fixed package on our Mac with the 15.4 SDK and an empty build cache, and it compiled.
Go's build cache handed back the package built with the newer SDK
Setting SDKROOT to an older SDK is not enough on its own when the build cache already holds the package. We reproduced it on 30 November on an export of the pull request's first commit, building only the QUIC package three times in a row. In the table, each row is one build, with the SDK it named and the cache folder it used:
| Build | SDK | Build cache | Result |
|---|---|---|---|
| First | the default, 26.0 | folder A, empty at the start | builds |
| Second | SDKROOT=.../MacOSX15.4.sdk | folder A again | builds |
| Third | SDKROOT=.../MacOSX15.4.sdk | folder B, empty | fails with the runner's error |
The second and the third build differ only in the cache, so the second one passed because Go handed back the package from the first build, and a check that changes only SDKROOT reports a pass that the runner never gets.
Build with an older SDK and an empty cache before you push
Two variables make a Mac compile a cgo package the way the runner does: SDKROOT points at an SDK without the newer declarations, and GOCACHE points at an empty folder, so that nothing comes back from an earlier build.
ls /Library/Developer/CommandLineTools/SDKs/
SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX15.4.sdk \
GOCACHE="$(mktemp -d)" \
go build ./pkg/transport/nwquic/
The 15.4 SDK is the closest one to the runner's 15.5 that our Mac has, and neither of them declares the function. The platforms each build of the app runs on are listed in the docs: keibidrop.com/docs/reference/platform-support.html.
Limits. The check uses the closest SDK on our Mac, 15.4, where the runner has 15.5, so a declaration that is new in 15.5 fails here and passes there, and the check errs on the safe side.
An empty cache compiles every package again and takes longer than a cached build, so the check suits the step before a push.
The prototype is written by hand and has to stay equal to Apple's, and today the 26 SDK's header and the line in shim.c have the same types. The runner image also carries Xcode 26.0.1 to 26.3 (its readme, checked on 30 November 2026), and a job that selects one of them builds against a 26 SDK, where the line is not needed.
The SDK that a cgo build compiles against is a setting of the machine
Did MacOS or XCODE update break my CGO build?
It can, because cgo compiles the C parts against the headers of the active SDK, and an Xcode update changes which SDK is active. Compare xcrun --show-sdk-version on the machine that builds and on the one that fails, then build with SDKROOT set to the older SDK and an empty GOCACHE to see the failure on your own machine.
SDKROOT path for latest SDK
xcrun --show-sdk-path prints the path of the active SDK, and with Xcode 26.0.1 on our Mac that is /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk. The Command Line Tools keep versioned SDKs in /Library/Developer/CommandLineTools/SDKs/, and SDKROOT may name any of them.
What is the go build command?
In the words of go help build: "Build compiles the packages named by the import paths, along with their dependencies, but it does not install the results." For a package with C files it also runs the C compiler through cgo, and that compiler reads the SDK that SDKROOT or the active Xcode names.