Build fails on the latest MacOS 15.4. Probably some changes to IOKit
/Users/tkchk/Git/pcm/src/MacMSRDriver/PcmMsr/PcmMsr.cpp:5:10: fatal error: 'IOKit/IOLib.h' file not found 5 | #include <IOKit/IOLib.h> | ^~~~~~~~~~~~~~~
Yeah, unfortunately, github doesn't provide free runners with MacOS 15 on x86 architecture, so you can't test the build on the recent MacOS.
yes, this is unfortunate..
on MacOS 14.7.5 fails as well. I've tried to symlink the file as they do here: https://github.com/karalabe/usb/issues/18
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Versions/A/Headers /System/Library/Frameworks/IOKit.framework
but operation is not permitted due to SIP restrictions.
My Mac is an intel based one so it's stuck on MacOS 14 but let me know if I can help trying things
I have an intel-based MBP running MacOS 15.4.1. It looks like this IOLib.h file it is asking for is located under the Kernal and DriverKit directories:
❯ pwd
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
❯ find . -name IOLib.h
./DriverKit.framework/Versions/A/Headers/IOLib.h
./Kernel.framework/Versions/A/Headers/IOKit/IOLib.h
same in 14.7.5
✝ System/Library/Frameworks pwd
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks
✝ System/Library/Frameworks find . -name IOLib.h
./DriverKit.framework/Versions/A/Headers/IOLib.h
./Kernel.framework/Versions/A/Headers/IOKit/IOLib.h
Solution: Use https://github.com/acidanthera/MacKernelSDK
target_include_directories(PcmMsrDriver PRIVATE
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/Kernel.framework/PrivateHeaders
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/Kernel.framework/Headers
+ /Users/yangyang/Workspace/Env/MacKernelSDK/Headers
)
I followed @yynag comment and successfully compiled the binaries but I'm unable to load the kexts.
-- Installing: /Library/Extensions/PcmMsrDriver.kext
-- Installing: /Library/Extensions/PcmMsrDriver.kext/Contents
-- Installing: /Library/Extensions/PcmMsrDriver.kext/Contents/MacOS
-- Installing: /Library/Extensions/PcmMsrDriver.kext/Contents/MacOS/PcmMsrDriver
-- Installing: /Library/Extensions/PcmMsrDriver.kext/Contents/Info.plist
Error Domain=KMErrorDomain Code=29 "Authenticating extension failed: Kext com.intel.driver.PcmMsr v1 in executable kext bundle com.intel.driver.PcmMsr at /private/var/db/KernelExtensionManagement/Staging/com.intel.driver.PcmMsr.J01a0L/PcmMsrDriver.kext:
Authenticating extension failed: Bad code signature" UserInfo={NSLocalizedDescription=Authenticating extension failed: Kext com.intel.driver.PcmMsr v1 in executable kext bundle com.intel.driver.PcmMsr at /private/var/db/KernelExtensionManagement/Staging/com.intel.driver.PcmMsr.J01a0L/PcmMsrDriver.kext:
Authenticating extension failed: Bad code signature}