【问题标题】:Android on Asus Fonepad 7 report to be armeabi-v7a even if it's an X86Asus Fonepad 7 上的 Android 报告为 armeabi-v7a,即使它是 X86
【发布时间】:2015-06-13 13:41:18
【问题描述】:

在我的应用中,我从 Build.CPU_ABI 检查 CPU,如果 CPU 是 X86,请用户下载捆绑了 X86 库的正确包。

但是今天我得到了一个带有 Intel CPU 的 Asus Fonepad 7,但令人惊讶的是,Build.CPU_ABIarmeabi-v7a 而不是 X86 .我在某处读到,因为许多开发人员没有在他们的应用程序中捆绑 X86 本机库,所以华硕使用了 ARM-X86 翻译器,因此该应用程序认为是在 Arm 设备上运行.更令人惊讶的是,即使捆绑了 X86 库,它仍然会加载 Arm 库。

我相信代码翻译会显着降低性能。那么有什么方法可以确定真正的 CPU 拱门吗?然后强制加载 X86 库而不是 Arm?

-------- 编辑 --------

当我从包中删除 armeabi-v7a 文件夹时,**Build.CPU_ABI 变为 X86,现在它会加载 X86 代码。**

我查看了 /proc/cpuinfo,唯一清楚的是它包含一个 Intel CPU。如果 cpuinfo 中出现 intel 字样,那么将 CPU 视为 X86 是否安全?

唯一的选择是拥有两个不同的 APK,一个用于 arm,另一个用于 X86。因为如果所有二进制文件都在同一个 APK 文件中,无论如何都会加载 Arm 二进制文件!

这是/proc/cpuinfo的内容:

processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 90
model name  : Genuine Intel(R) CPU   4000  @ 1.00GHz
stepping    : 0
microcode   : 0x27
cpu MHz     : 1833.000
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 4
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dtherm tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips    : 1996.80
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 90
model name  : Genuine Intel(R) CPU   4000  @ 1.00GHz
stepping    : 0
microcode   : 0x27
cpu MHz     : 1833.000
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 4
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dtherm tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips    : 1996.80
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 90
model name  : Genuine Intel(R) CPU   4000  @ 1.00GHz
stepping    : 0
microcode   : 0x27
cpu MHz     : 1833.000
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 2
cpu cores   : 4
apicid      : 4
initial apicid  : 4
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dtherm tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips    : 1996.80
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 90
model name  : Genuine Intel(R) CPU   4000  @ 1.00GHz
stepping    : 0
microcode   : 0x27
cpu MHz     : 1833.000
cache size  : 1024 KB
physical id : 0
siblings    : 4
core id     : 3
cpu cores   : 4
apicid      : 6
initial apicid  : 6
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb dtherm tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips    : 1996.80
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

【问题讨论】:

    标签: android android-ndk


    【解决方案1】:

    你可以阅读 /proc/cpuinfo

    ➜  ~  adb shell
    shell@android:/ $ cat /proc/cpuinfo                                            
    Processor   : ARMv7 Processor rev 10 (v7l)
    

    【讨论】:

    • 请检查我的更新! cpuinfo 文件中唯一与 X86 cpu 相关的是 intel word。将任何在其 cpuinfo 文件中带有 intel 字词的设备视为 X86 cpu 是否安全?
    • @ChrisStratton 如何检查 cpuinfo 文件中是否不存在 ARMv7 字?
    • @Ali: 听起来不错(检查英特尔) - 但我会首先尝试您的设备是否仍然可以处理应用了更改的 x86 代码 - 也许他们破坏了这条路径,所以你不需要弄清楚首先是这个细节..
    • 当设备报告为 ARM 并加载 ARM 二进制文件时,如何检查设备是否可以处理 x86 代码,即使 X86 二进制文件已打包?
    • 试试看 - 我没有这样一个残缺的设备 - 甚至不会在意这样的糟糕表现 - 他们应该得到这个......-)
    【解决方案2】:
    getprop | grep -i cpu
    

    这会告诉你所有可用的 abis...getprop,一般来说,对于获取更多的 sysinfo 很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-23
      • 2017-06-06
      • 1970-01-01
      • 2019-11-25
      • 2019-11-11
      • 2021-12-28
      • 1970-01-01
      • 2012-08-26
      相关资源
      最近更新 更多