-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
___str*_chk symbol(s) not found in any library kext #1
Comments
macOS 10.13+ kernel added If you encountered above compile issue, it certainly indicates that your Command Line Tools version is byond current macOS version, so there're symbol-mismatch. FIX: please visit More Downloads for Apple Developers and download correct version of Command Line Tools matchs your macOS version In my case, I installed the brew(which it installed a bit high version of Command Line Tools) in macOS 10.12(16G29). Check |
HOWTO reproduce above missing symbol bug:
#include <string.h>
#include <libkern/libkern.h>
void foobar(const char *s)
{
char t[1024];
strlcpy(t, s, strlen(s) >> 1); /* Uses str*() family function */
printf(KEXTNAME_S ": %s\n", t);
}
If you put the There must be something wrong with multiple-file compilation... FYI: $ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.6
BuildVersion: 16G29
$ clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
I have a faint suspicious that there are some "critical" compile/load flags missing in Makefile |
Final solution: As you check #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_13
/* older deployment target */
#elif defined(KASAN) || (defined (_FORTIFY_SOURCE) && _FORTIFY_SOURCE == 0)
/* FORTIFY_SOURCE disabled */
#else /* _chk macros */
#if __has_builtin(__builtin___memcpy_chk)
/*
* TL;DL
*/
#endif /* _chk macros */
#ifdef __cplusplus You'll find that the control flow goes into the Thus you can use some dirty wordaround to dismiss Solutions:
Solution 3 is not applicable, the macro __MAC_OS_X_VERSION_MIN_REQUIRED is use by
see: |
Make kext output snippet:
The text was updated successfully, but these errors were encountered: