bestswifter / BSBacktraceLogger

记录线程的调用栈
GNU General Public License v3.0
977 stars 216 forks source link

ARM64e未适配 #15

Closed sthyuhao closed 4 years ago

sthyuhao commented 4 years ago

我这打静态库的时候出现编译失败的问题

sthyuhao commented 4 years ago

------------命令(xcodebuild build -workspace gen/App.xcworkspace -scheme XXX -configuration 'Debug' -sdk iphoneos -arch 'arm64e' SYMROOT='../../BuildTemp')执行错误------------

sthyuhao commented 4 years ago

/*

if __has_feature(ptrauth_calls)

define __DARWIN_OPAQUE_ARM_THREAD_STATE64 1

define __DARWIN_PTRAUTH_ARM_THREAD_STATE64 1

endif / __has_feature(ptrauth_calls) /

ifndef __DARWIN_OPAQUE_ARM_THREAD_STATE64

define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0

endif

else / defined(arm64) && defined(LP64) /

undef __DARWIN_OPAQUE_ARM_THREAD_STATE64

define __DARWIN_OPAQUE_ARM_THREAD_STATE64 0

endif / defined(arm64) && defined(LP64) /

库里的注释说明了在arm64e架构下需要开启_DARWIN_OPAQUE_ARM_THREAD_STATE64,开始天真的以为有arm64就会有arm64e。通过源码的调用方式修改一下属性就行了

`

uintptr_t bs_mach_framePointer(_STRUCT_MCONTEXT * const machineContext) {

#if __has_feature(ptrauth_calls)

    return machineContext->__ss.__opaque_fp;

#else

    return machineContext->__ss.__fp;

#endif

}

`