-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
macOS: Integrate codesigning and enable hardened runtime #8909
Conversation
mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_ANON | MAP_PRIVATE, -1, 0); | ||
int flags = MAP_ANON | MAP_PRIVATE; | ||
#ifdef __APPLE__ | ||
flags |= MAP_JIT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been available since Lion 10.7, I'm surprised that it is just being added now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The macOS version of Dolphin has been relatively unmaintained for a while, unfortunately.
Not sure if Dolphin still supports Sierra/High Sierra (10.12/10.13), but the README says it, so I figured I'd give a heads up: you may need to conditional the static inline int determine_macos_jit_flag()
{
static int jit_flag = -1;
if (jit_flag == -1)
{
struct utsname name;
uname(&name);
// Kernel version 18 = Mojave
jit_flag = (atoi(name.release) >= 18) ? MAP_JIT : 0;
}
return jit_flag;
} flags |= determine_macos_jit_flag(); |
@ryanmcgrath #9441 will probably supersede this PR, so I've forwarded your info there. Thanks for the heads up. |
Superseded by #9441! |
This PR integrates codesigning into the build system. It also enables the hardened runtime and adds the appropriate entitlements to DolphinQt. These are prerequisites to notarization.
To build:
Codesigning is disabled by default. In addition, the optional setting
MACOS_CODE_SIGNING_IDENTITY_UPDATER
can be set if the updater needs a different identity.The entitlement
com.apple.security.automation.apple-events
is activated because I noticedtccd
was raising an error about Dolphin attempting to use Apple Events. I couldn't spot any obvious usage of Apple Events in the codebase, so I'm not sure why it's complaining in the first place. Either way, I added the entitlement so functionality is not unintentionally broken.If this PR is merged, the next step would be to integrate notarization into the macOS buildbot if the project is willing to move forward with that. I can assist in any manner to get it up and running. I have already notarized some of my local Dolphin builds, and successfully tested them on macOS Catalina. Example binaries can be provided on request. (They have some personal information embedded in the app bundle, as I'm using my personal Apple Developer account, so I'd rather not have them be posted in a public forum.)