util: avoid calling kcmp on Android

On some combinations of Android version and kernel version, calling kcmp
results in seccomp killing the process.

As there doesn't seem to be a way to query for that in advance, skip
this check altogether on Android.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20180>
This commit is contained in:
Eric Engestrom
2023-02-01 17:58:02 +00:00
committed by Marge Bot
parent 0d6c240fcc
commit a72035f9c5
3 changed files with 16 additions and 1 deletions

View File

@@ -851,6 +851,16 @@ if with_platform_android
]
endif
# On Android, seccomp kills the process on kernels without
# CONFIG_KCMP/CONFIG_CHECKPOINT_RESTORE if it attemps to use KCMP.
# Since we can't detect that, err on the side of caution and disable
# KCMP by default on Android.
if get_option('allow-kcmp') \
.disable_auto_if(with_platform_android) \
.allowed()
pre_args += '-DALLOW_KCMP'
endif
prog_python = import('python').find_installation('python3')
has_mako = run_command(
prog_python, '-c',