glib: Do not use `futex_time64` syscall

which is forbidden by seccomp rule.
This commit is contained in:
Tee KOBAYASHI 2022-12-26 16:29:17 +09:00 committed by xtkoba
parent 506669b5a2
commit fb785b4473
4 changed files with 39 additions and 0 deletions

View File

@ -4,6 +4,7 @@ TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="@termux"
_MAJOR_VERSION=2.74
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.4
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://ftp.gnome.org/pub/gnome/sources/glib/${_MAJOR_VERSION}/glib-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=0e82da5ea129b4444227c7e4a9e598f7288d1994bf63f129c44b90cfd2432172
TERMUX_PKG_DEPENDS="libffi, libiconv, pcre2, libandroid-support, zlib"

View File

@ -0,0 +1,11 @@
--- a/glib/gthread-posix.c
+++ b/glib/gthread-posix.c
@@ -1647,7 +1647,7 @@
sampled = cond->i[0];
g_mutex_unlock (mutex);
-#ifdef __NR_futex_time64
+#if defined __NR_futex_time64 && !defined __ANDROID__
{
struct
{

View File

@ -11,3 +11,21 @@
#ifndef FUTEX_WAIT_PRIVATE
#define FUTEX_WAIT_PRIVATE FUTEX_WAIT
#define FUTEX_WAKE_PRIVATE FUTEX_WAKE
@@ -60,7 +60,7 @@
* This must not be called with a timeout parameter as that differs
* in size between the two syscall variants!
*/
-#if defined(__NR_futex) && defined(__NR_futex_time64)
+#if defined(__NR_futex) && defined(__NR_futex_time64) && !defined(__ANDROID__)
#define g_futex_simple(uaddr, futex_op, ...) \
G_STMT_START \
{ \
@@ -69,7 +69,7 @@
syscall (__NR_futex, uaddr, (gsize) futex_op, __VA_ARGS__); \
} \
G_STMT_END
-#elif defined(__NR_futex_time64)
+#elif defined(__NR_futex_time64) && !defined(__ANDROID__)
#define g_futex_simple(uaddr, futex_op, ...) \
G_STMT_START \
{ \

View File

@ -16,6 +16,15 @@
'inotify_init1',
'issetugid',
'kevent',
@@ -900,7 +898,7 @@
int main (int argc, char ** argv) {
syscall (__NR_futex_time64, NULL, FUTEX_WAKE, FUTEX_WAIT);
return 0;
- }''', name : 'futex(2) system call')
+ }''', name : 'futex(2) system call') and host_system != 'android'
glib_conf.set('HAVE_FUTEX_TIME64', 1)
endif
@@ -907,7 +905,7 @@
syscall (SYS_pidfd_open, 0, 0);
waitid (P_PIDFD, 0, &child_info, WEXITED | WNOHANG);