Let's say that a kernel extension Xcode project is set to build with a target deployment of 10.9 and is built using Xcode 10.x on macOS Mojave.
Let's say that in the project there is a header and a source that does this:
somefile.h
#include <sys/types.h>
#include <sys/kern_control.h>
extern void doSomething(void);
somefile.c
#include "file.h"
#include <libkern/libkern.h>
void doSomething(void)
{
struct kern_ctl_reg tKernelControlStruct;
strlcpy(tKernelControlStruct.ctl_name,"inc.acme.coyote.evil", MAX_KCTL_NAME);
}
o At build time strlcpy is replaced by __builtin___strlcpy_chk. Which is not the expected outcome. Which causes issues on 10.9 since the *_strlcpy_chk symbol does not exist.
o In the string.h header of the Kernel framework, strlcpy is supposed to be replaced when the min OS required is 10.13.
From what I'm observing the __MAC_OS_X_VERSION_MIN_REQUIRED macro is not defined. Shouldn't it be?
Question:
How do you make sure it is defined?