Commit 0d98abec authored by Greg Hackmann's avatar Greg Hackmann
Browse files

Test for /proc/cpuinfo backwards compatibility with legacy ARM NDK code



A previous version of the NDK statically linked code into 32-bit ARM
binaries that parsed the "Features" and "CPU architecture" fields in
/proc/cpuinfo.  To ensure compatibility with these existing binaries,
test that these fields are readable and reported in the expected format
when read by 32-bit ARM processes.

Specifically, when /proc/cpuinfo is read a 32-bit ARM process, the CPU
architecture must be an integer ("8") rather than a string ("AArch64").
The Features field must also be present, and an ARMv8+ devices must
include features that were once optional under ARMv7.

For all other processes, /proc/cpuinfo must be unchanged from the format
normally used by the kernel.

By design, these tests only guarantee the bare minimum needed to support
legacy NDK apps, and only for 32-bit ARM processes.  Applications must
not rely on /proc/cpuinfo as a stable interface and are strongly
encouraged to use the NDK cpu-features library instead.

Bug: 15940803

Change-Id: Ia926c19c987656f4fea397f913d116e7ef491629
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
parent 8c926b75
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment