Timo Aaltonen pushed to branch upstream-unstable at X Strike Force / lib / libxshmfence
Commits: 9723b888 by Alan Coopersmith at 2023-03-08T14:49:08-08:00 configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOL AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008, so it's time to rely on it. Clears autoconf warnings: configure.ac:13: warning: The macro `AC_PROG_LIBTOOL' is obsolete. configure.ac:13: You should run autoupdate. aclocal.m4:3465: AC_PROG_LIBTOOL is expanded from... configure.ac:13: the top level libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> - - - - - 0c5b1907 by Alan Coopersmith at 2023-03-08T14:50:43-08:00 configure: replace deprecated AC_HELP_STRING with AS_HELP_STRING Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> - - - - - 042a1cf3 by Alan Coopersmith at 2023-12-02T12:26:28-08:00 configure: replace deprecated AC_TRY_COMPILE with AC_COMPILE_IFELSE Clears autoconf warnings: configure.ac:127: warning: The macro 'AC_TRY_COMPILE' is obsolete. configure.ac:127: You should run autoupdate. ./lib/autoconf/general.m4:2845: AC_TRY_COMPILE is expanded from... configure.ac:127: the top level Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> - - - - - 4fca45a7 by Thomas Devoogdt at 2024-04-05T10:45:15+02:00 src/xshmfence_futex.h: fix build on 32-bit architectures using 64-bit time_t Fix the following build failure on 32-bit architectures using 64-bit time_t (e.g. riscv32): xshmfence_futex.h: In function 'sys_futex': xshmfence_futex.h:58:24: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'? 58 | return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); | ^~~~~~~~~ | sys_futex Similar to: https://gitlab.freedesktop.org/mesa/mesa/-/commit/7d87478124061915582412ba410759afe863d679 Fixes: https://gitlab.com/buildroot.org/buildroot/-/commit/e39ad96136a8c340b3aea6b036024e28f14584f3 Signed-off-by: Thomas Devoogdt <tho...@devoogdt.com> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxshmfence/-/merge_requests/8> - - - - - 3aaf46a2 by Asahi Lina at 2024-10-22T22:28:19+09:00 alloc: Allow disabling memfd usage at runtime with XSHMFENCE_NO_MEMFD=1 For thin VMs used for compatibility reasons, it is desirable to directly proxy the X11 protocol between an application running in a VM and an X server running on the host. We can proxy futex wakeups with some watcher code, but we need the futex memory itself to be shared. This works when /dev/shm is mounted with virtiofs with DAX, but cannot work for memfds. Add a XSHMFENCE_NO_MEMFD environment variable that, when set, disables the memfd codepath and falls back to /dev/shm. Signed-off-by: Asahi Lina <l...@asahilina.net> Part-of: <https://gitlab.freedesktop.org/xorg/lib/libxshmfence/-/merge_requests/9> - - - - - 89f06474 by Alan Coopersmith at 2024-12-13T18:00:57-08:00 libxshmfence 1.3.3 Signed-off-by: Alan Coopersmith <alan.coopersm...@oracle.com> - - - - - 3 changed files: - configure.ac - src/xshmfence_alloc.c - src/xshmfence_futex.h Changes: ===================================== configure.ac ===================================== @@ -23,19 +23,23 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.60]) -AC_INIT([libxshmfence], [1.3.2], +AC_INIT([libxshmfence], [1.3.3], [https://gitlab.freedesktop.org/xorg/lib/libxshmfence/-/issues], [libxshmfence]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_MACRO_DIRS([m4]) +# Set common system defines for POSIX extensions, such as _GNU_SOURCE +# Must be called before any macros that run the compiler (like LT_INIT +# or XORG_DEFAULT_OPTIONS) to avoid autoconf errors. AC_USE_SYSTEM_EXTENSIONS # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-xz]) # Initialize libtool -AC_PROG_LIBTOOL +LT_INIT # Require xorg-macros: XORG_DEFAULT_OPTIONS, XORG_WITH_LINT m4_ifndef([XORG_MACROS_VERSION], @@ -100,7 +104,7 @@ AC_CHECK_DECLS([__NR_memfd_create], [], [], [[#include <asm/unistd.h>]]) AC_CHECK_HEADERS([sys/memfd.h], [AC_DEFINE([HAVE_MEMFD_H], 1, [Has sys/memfd.h header])]) -AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]), +AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]), [SYMBOL_VISIBILITY=$enableval], [SYMBOL_VISIBILITY=auto]) @@ -120,15 +124,15 @@ if test x$SYMBOL_VISIBILITY != xno; then fi fi if test x$have_visibility != xno; then - AC_TRY_COMPILE( - [#include <X11/Xfuncproto.h> + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [[#include <X11/Xfuncproto.h> extern _X_HIDDEN int hidden_int; extern _X_EXPORT int public_int; extern _X_HIDDEN int hidden_int_func(void); - extern _X_EXPORT int public_int_func(void);], - [], - have_visibility=yes, - have_visibility=no) + extern _X_EXPORT int public_int_func(void);]], + [[]])], + [have_visibility=yes], + [have_visibility=no]) fi AC_MSG_RESULT([$have_visibility]) if test x$have_visibility != xno; then ===================================== src/xshmfence_alloc.c ===================================== @@ -69,13 +69,22 @@ int xshmfence_alloc_shm(void) { char template[] = SHMDIR "/shmfd-XXXXXX"; - int fd; + int fd = -1; #ifndef HAVE_MKOSTEMP int flags; #endif #if HAVE_MEMFD_CREATE - fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING); + static int disable_memfd = -1; + + if (disable_memfd == -1) { + const char *val = getenv("XSHMFENCE_NO_MEMFD"); + disable_memfd = val ? !!atoi(val) : 0; + } + + if (disable_memfd <= 0) + fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING); + if (fd < 0) #endif #ifdef SHM_ANON ===================================== src/xshmfence_futex.h ===================================== @@ -53,6 +53,10 @@ static inline int futex_wait(int32_t *addr, int32_t value) { #include <sys/time.h> #include <sys/syscall.h> +#ifndef SYS_futex +#define SYS_futex SYS_futex_time64 +#endif + static inline long sys_futex(void *addr1, int op, int val1, struct timespec *timeout, void *addr2, int val3) { return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3); View it on GitLab: https://salsa.debian.org/xorg-team/lib/libxshmfence/-/compare/edbb7d9e5f3912fe521f0cfe5ae416bb9ca83633...89f064748554e11832a3ec783945e1f4c7fe846e -- View it on GitLab: https://salsa.debian.org/xorg-team/lib/libxshmfence/-/compare/edbb7d9e5f3912fe521f0cfe5ae416bb9ca83633...89f064748554e11832a3ec783945e1f4c7fe846e You're receiving this email because of your account on salsa.debian.org.