Skip to content
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

Build libretro core for tvOS #1360

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

warmenhoven
Copy link
Contributor

No description provided.

@@ -60,7 +60,7 @@ void CEeExecutor::AddExceptionHandler()
sigemptyset(&sigAction.sa_mask);
int result = sigaction(SIGSEGV, &sigAction, nullptr);
assert(result >= 0);
#elif defined(__APPLE__)
#elif defined(__APPLE__) && !TARGET_OS_TV
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there really no way to use the mach_* functions on tvOS? Without the exception handler, it's probably gonna cause unexpected issues due to JIT code mismatch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me do some more research and get back to you. Those calls have deliberately been made unavailable on tvOS but let me see if there are alternatives.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both mach_msg and mach_msg_override are unavailable to tvOS. It seems that ppsspp just uses the standard posix signal() handling, which seems to work here as well. I've updated the PR. Thank you for asking me to take another look!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Humm, I've tried the signal based exception handling and I'm not quite sure it works on Apple platforms. I've tried it on macOS and the signal doesn't get processed correctly and the emulator will just shut down. You can try FF10, I think that one will cause some exceptions to be triggered and the emulator will crash.

I think you're probably better off defining DISABLE_PROTECTION or going back to your previous version which removed the mach_* calls (also make sure to remove mprotect).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let me experiment more. tvOS is quite a bit different from macOS (and slightly different from iOS in subtle ways, though it is considered an iOS variant).

@warmenhoven warmenhoven marked this pull request as draft March 11, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants