No member named '__fp' in 'struct __darwin_arm_thread_state64'
Platform
macOS
Installed
Swift Package Manager
Version
8.13.1
Steps to Reproduce
On macOS 13.5.2 using Xcode 15 running on an M1 processor Open you Swift app Use SPM to add sentry-cocoa to my macOS project. Only add the Sentry and Sentry-Dynamic Package Package. I'm not using Swift-UI. Compile the project
Expected Result
Project successfully compiles
Actual Result
Project fails to compile... This is a dupe of https://github.com/getsentry/sentry-cocoa/issues/3210, which was closed without being resolved.
Sentry SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:56:41 No member named '__fp' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:66:41 No member named '__sp' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:76:41 No member named '__pc' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:86:41 No member named '__lr' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:126:45 No member named '__fp' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:128:45 No member named '__lr' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:130:45 No member named '__sp' in 'struct __darwin_arm_thread_state64'
SourcePackages/checkouts/sentry-cocoa/Sources/SentryCrash/Recording/Tools/SentryCrashCPU_arm64.c:132:45 No member named '__pc' in 'struct __darwin_arm_thread_state64'
Are you willing to submit a PR?
I am willing but will likely not be able to.
Hello @adhamhf. You should not use Sentry and Sentry-Dynamic together. You choose "Sentry" if you want static linked, otherwise you choose "Sentry-Dynamic".
Can you test this and let us know if it fixes the problem?
@brustolin that did not fix the problem. Turns out I have to compile for arm64e and that is the problem. This architecture is different...
https://developer.apple.com/documentation/security/preparing_your_app_to_work_with_pointer_authentication
It's really easy to reproduce this problem.
- checkout sentry-cocoa
- Open the Sentry.xcworspace
- In the Sentry target change architectures to "arm64e" only
- build the target
- compile fails.
It's really easy to reproduce this problem.
That's what we need. We will investigate a fix for this! Thanks!!
It seems like the fix is to use these wrappers: https://github.com/apple-oss-distributions/xnu/blob/main/osfmk/mach/arm/thread_status.h#L127