Skip to content

Commit

Permalink
Added Xcode 11 compatibility to plugin kexts on 10.14
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Oct 3, 2019
1 parent 5f4f032 commit fd5c446
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 3 deletions.
3 changes: 3 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
VirtualSMC Changelog
====================
#### v1.0.8
- Added Xcode 11 compatibility to plugin kexts on 10.14

#### v1.0.7
- Unified release archive names
- Added new ssio sensors
Expand Down
18 changes: 18 additions & 0 deletions Sensors/SMCBatteryManager/SMCBatteryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,21 @@ EXPORT extern "C" kern_return_t ADDPR(kern_stop)(kmod_info_t *, void *) {
// It is not safe to unload VirtualSMC plugins!
return KERN_FAILURE;
}

#ifdef __MAC_10_15

// macOS 10.15 adds Dispatch function to all OSObject instances and basically
// every header is now incompatible with 10.14 and earlier.
// Here we add a stub to permit older macOS versions to link.
// Note, this is done in both kern_util and plugin_start as plugins will not link
// to Lilu weak exports from vtable.

kern_return_t WEAKFUNC PRIVATE OSObject::Dispatch(const IORPC rpc) {
PANIC("util", "OSObject::Dispatch smcbat stub called");
}

kern_return_t WEAKFUNC PRIVATE OSMetaClassBase::Dispatch(const IORPC rpc) {
PANIC("util", "OSMetaClassBase::Dispatch smcbat stub called");
}

#endif
18 changes: 18 additions & 0 deletions Sensors/SMCLightSensor/SMCLightSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,21 @@ EXPORT extern "C" kern_return_t ADDPR(kern_stop)(kmod_info_t *, void *) {
// It is not safe to unload VirtualSMC plugins!
return KERN_FAILURE;
}

#ifdef __MAC_10_15

// macOS 10.15 adds Dispatch function to all OSObject instances and basically
// every header is now incompatible with 10.14 and earlier.
// Here we add a stub to permit older macOS versions to link.
// Note, this is done in both kern_util and plugin_start as plugins will not link
// to Lilu weak exports from vtable.

kern_return_t WEAKFUNC PRIVATE OSObject::Dispatch(const IORPC rpc) {
PANIC("util", "OSObject::Dispatch smclight stub called");
}

kern_return_t WEAKFUNC PRIVATE OSMetaClassBase::Dispatch(const IORPC rpc) {
PANIC("util", "OSMetaClassBase::Dispatch smclight stub called");
}

#endif
18 changes: 18 additions & 0 deletions Sensors/SMCProcessor/SMCProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,21 @@ EXPORT extern "C" kern_return_t ADDPR(kern_stop)(kmod_info_t *, void *) {
// It is not safe to unload VirtualSMC plugins!
return KERN_FAILURE;
}

#ifdef __MAC_10_15

// macOS 10.15 adds Dispatch function to all OSObject instances and basically
// every header is now incompatible with 10.14 and earlier.
// Here we add a stub to permit older macOS versions to link.
// Note, this is done in both kern_util and plugin_start as plugins will not link
// to Lilu weak exports from vtable.

kern_return_t WEAKFUNC PRIVATE OSObject::Dispatch(const IORPC rpc) {
PANIC("util", "OSObject::Dispatch smcproc stub called");
}

kern_return_t WEAKFUNC PRIVATE OSMetaClassBase::Dispatch(const IORPC rpc) {
PANIC("util", "OSMetaClassBase::Dispatch smcproc stub called");
}

#endif
18 changes: 18 additions & 0 deletions Sensors/SMCSuperIO/SMCSuperIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,21 @@ EXPORT extern "C" kern_return_t ADDPR(kern_stop)(kmod_info_t *, void *) {
// It is not safe to unload VirtualSMC plugins!
return KERN_FAILURE;
}

#ifdef __MAC_10_15

// macOS 10.15 adds Dispatch function to all OSObject instances and basically
// every header is now incompatible with 10.14 and earlier.
// Here we add a stub to permit older macOS versions to link.
// Note, this is done in both kern_util and plugin_start as plugins will not link
// to Lilu weak exports from vtable.

kern_return_t WEAKFUNC PRIVATE OSObject::Dispatch(const IORPC rpc) {
PANIC("util", "OSObject::Dispatch smcio stub called");
}

kern_return_t WEAKFUNC PRIVATE OSMetaClassBase::Dispatch(const IORPC rpc) {
PANIC("util", "OSMetaClassBase::Dispatch smcio stub called");
}

#endif
6 changes: 3 additions & 3 deletions VirtualSMC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MODULE_VERSION = 1.0.7;
MODULE_VERSION = 1.0.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VALID_ARCHS = x86_64;
Expand Down Expand Up @@ -1401,7 +1401,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MODULE_VERSION = 1.0.7;
MODULE_VERSION = 1.0.8;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
VALID_ARCHS = x86_64;
Expand Down Expand Up @@ -1948,7 +1948,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.8;
MODULE_VERSION = 1.0.7;
MODULE_VERSION = 1.0.8;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
VALID_ARCHS = x86_64;
Expand Down

0 comments on commit fd5c446

Please sign in to comment.