在ios模拟器上成功构建skia,但无法在我的iphone上运行
Posted
技术标签:
【中文标题】在ios模拟器上成功构建skia,但无法在我的iphone上运行【英文标题】:Building skia on ios simulator successfully,but cannot run on my iphone 【发布时间】:2013-02-16 03:48:41 【问题描述】:每个人。 我已经完成了在 ios 模拟器上运行的skia。但无法在我的 iphone 上运行。它停在这里。
#if defined(__x86_64__) || defined(_WIN64)
/* All x86_64 machines have SSE2, so don't even bother checking. */
static inline bool hasSSE2()
return true;
#else
#ifdef _MSC_VER
static inline void getcpuid(int info_type, int info[4])
__asm
mov eax, [info_type]
cpuid
mov edi, [info]
mov [edi], eax
mov [edi+4], ebx
mov [edi+8], ecx
mov [edi+12], edx
#else
static inline void getcpuid(int info_type, int info[4])
// We save and restore ebx, so this code can be compatible with -fPIC
asm volatile (
"pushl %%ebx \n\t"
"cpuid \n\t"
"movl %%ebx, %1 \n\t"
"popl %%ebx \n\t"
: "=a"(info[0]), "=r"(info[1]), "=c"(info[2]), "=d"(info[3])
: "a"(info_type)
);
#endif
static inline bool hasSSE2()
int cpu_info[4] = 0 ;
getcpuid(1, cpu_info);
return (cpu_info[3] & (1<<26)) != 0;
return true;
#endif
在 getcpuid 方法中,它说“invaild output constraint 'a' in asm”。 它出什么问题了?? 有人吗?
【问题讨论】:
【参考方案1】:其破解的代码是尝试为 arm 芯片构建 x86 程序集。不出所料,这不会在设备上工作。它可以在模拟器上运行,因为模拟器在 x86 芯片上运行。 a 约束是一个 x86 约束,表示在 eax:edx (IIRC) 中返回一个 64 位值。
您需要使用适当的标志对其进行编译,以使其通过 arm 代码路径。
你读过这个吗?
https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/how-to-check-out-and-build-skia-on-ios
【讨论】:
以上是关于在ios模拟器上成功构建skia,但无法在我的iphone上运行的主要内容,如果未能解决你的问题,请参考以下文章
iOS - 无法在设备上构建,但在 Xcode 4.6 上构建模拟器
为 iOS 模拟器构建,但链接框架“****.framework”是为 iOS 构建的