Fix selection of bpf syscall number with COMPAT_UTS_MACHINE.

If the python interpreter is 64-bit but was launched from a 32-bit
environment (this can happen if it is run from a chroot or container),
then 'uname -m' and python's os.uname()[4] will return 'i686' instead of
x86_64 for questionable compatibility reasons. This breaks the
assumption in the bpf.py test that 'uname -m' reliably returns the
personality of the python interpreter, which determines the syscall number
to use for bpf.

Harden the assumptions made by the test by qualifying the architecture
test with the bitness of the python interpreter. We can then correctly
determine when to use the 64-bit syscall number.

This change has only been tested on x86. The ARM part of the change is
very likely to be correct, and cannot make things worse, but I did not
have a device with a 64-bit kernel and 32-bit userspace available to
test.

Bug: 79532682
Test: ./all_tests.sh ran to completion on cuttlefish
Change-Id: I1e9e62ba22344db121e83e97906bc1dcbcb51386
Signed-off-by: Alistair Strachan <astrachan@google.com>
1 file changed
tree: f99588ad69587fc132dedd4e18707609181c856a
  1. devicetree/
  2. net/
  3. Android.bp