簡體   English   中英

在iOS模擬器上成功構建Skia,但無法在我的iPhone上運行

[英]Building skia on ios simulator successfully,but cannot run on my iphone

大家。 我已經完成了在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方法中,它說“在asm中無效了輸出約束'a'”。 它出什么問題了?? 任何人?

它打破的代碼正試圖為手臂芯片構建x86組件。 毫不奇怪,這將在設備上起作用。 它可以在模擬器上運行,因為模擬器在x86芯片上運行。 a約束是x86約束,指示返回eax:edx(IIRC)中的64位值。

您將需要使用適當的標志對其進行編譯,以使其通過臂代碼路徑。

你讀過這個嗎?

https://sites.google.com/site/skiadocs/user-documentation/quick-start-guides/how-to-check-out-and-build-skia-on-ios

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM