Commits:
-
f290f394
by Peter Hutterer at 2017-01-26T11:59:25+10:00
autogen.sh: use exec instead of waiting for configure to finish
Syncs the invocation of configure with the one from the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
-
e242a02f
by Emil Velikov at 2017-01-26T11:59:25+10:00
autogen.sh: use quoted string variables
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent
fall-outs, when they contain space.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-
db7966be
by Mihail Konev at 2017-01-26T13:52:49+10:00
autogen: add default patch prefix
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
-
1f194603
by Adam Jackson at 2017-12-14T14:31:17-05:00
configure: Nerf a thing
Signed-off-by: Adam Jackson <ajax@redhat.com>
-
0b550a4e
by Ross Burton at 2018-01-29T14:34:45-05:00
configure.ac: call AC_USE_SYSTEM_EXTENSIONS
With glibc 2.27 memfd_create() is inside a _GNU_SOURCE guard, so call
AC_USE_SYSTEM_EXTENSIONS to get this defined.
Signed-off-by: Ross Burton <ross.burton@intel.com>
-
517f2174
by Adam Jackson at 2018-01-29T14:36:04-05:00
Revert "configure: Nerf a thing"
Definitely didn't mean to push this.
This reverts commit 1f194603cb927352c42798bead29c8ac3a680d02.
-
30d946bc
by Michał Górny at 2018-02-22T10:37:42-08:00
Fix missing <limits.h> include for HAVE_UMTX branch of futex
This fixes build on Gentoo/FreeBSD which failed due to undefined
'INT_MAX'.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
-
f38b2e73
by Matt Turner at 2018-02-26T09:26:06-08:00
libxshmfence 1.3
Signed-off-by: Matt Turner <mattst88@gmail.com>
-
40f80ca0
by Alan Coopersmith at 2018-11-19T23:08:58-08:00
Update README for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
87a66f2e
by Alan Coopersmith at 2018-12-07T19:50:56-08:00
Update configure.ac bug URL for gitlab migration
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
51d4b7ea
by Jan Beich at 2019-08-03T21:54:26+00:00
alloc: prefer atomic close-on-exec without O_TMPFILE as well
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
-
946f99b9
by Jan Beich at 2019-08-03T21:54:26+00:00
alloc: prefer SHM_ANON on FreeBSD a la memfd_create
Signed-off-by: Jan Beich <jbeich@FreeBSD.org>
-
48446b16
by Alan Coopersmith at 2022-07-17T18:02:46-07:00
Build xz tarballs instead of bzip2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
7aa043ac
by Alan Coopersmith at 2022-07-17T18:03:52-07:00
Fix spelling/wording issues
Found by using:
codespell --builtin clear,rare,usage,informal,code,names
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
bff067ed
by Alan Coopersmith at 2022-07-17T18:05:30-07:00
gitlab CI: add a basic build test
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
43749ba6
by Alan Coopersmith at 2022-10-18T09:38:22-07:00
libxshmfence 1.3.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-
7df37ab0
by Matt Turner at 2022-11-29T12:08:54-05:00
configure: Use AC_SYS_LARGEFILE to enable large file support
Signed-off-by: Matt Turner <mattst88@gmail.com>
-
edbb7d9e
by Matt Turner at 2022-12-08T10:40:04-05:00
libxshmfence 1.3.2
Signed-off-by: Matt Turner <mattst88@gmail.com>
7 changed files:
Changes:
.gitlab-ci.yml
|
1
|
+# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
|
|
2
|
+#
|
|
3
|
+# This CI uses the freedesktop.org ci-templates.
|
|
4
|
+# Please see the ci-templates documentation for details:
|
|
5
|
+# https://freedesktop.pages.freedesktop.org/ci-templates/
|
|
6
|
+
|
|
7
|
+.templates_sha: &template_sha 34f4ade99434043f88e164933f570301fd18b125 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+include:
|
|
11
|
+ # Arch container builder template
|
|
12
|
+ - project: 'freedesktop/ci-templates'
|
|
13
|
+ ref: *template_sha
|
|
14
|
+ file: '/templates/arch.yml'
|
|
15
|
+ - project: 'freedesktop/ci-templates'
|
|
16
|
+ ref: *template_sha
|
|
17
|
+ file: '/templates/ci-fairy.yml'
|
|
18
|
+ - template: Security/SAST.gitlab-ci.yml
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+stages:
|
|
22
|
+ - prep # prep work like rebuilding the container images if there is a change
|
|
23
|
+ - build # for actually building and testing things in a container
|
|
24
|
+ - test
|
|
25
|
+ - deploy
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+variables:
|
|
29
|
+ FDO_UPSTREAM_REPO: 'xorg/lib/libxshmfence'
|
|
30
|
+ # The tag should be updated each time the list of packages is updated.
|
|
31
|
+ # Changing a tag forces the associated image to be rebuilt.
|
|
32
|
+ # Note: the tag has no meaning, we use a date format purely for readability
|
|
33
|
+ FDO_DISTRIBUTION_TAG: '2022-07-17.0'
|
|
34
|
+ FDO_DISTRIBUTION_PACKAGES: 'git gcc pkgconf autoconf automake libtool make xorg-util-macros xorgproto'
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+#
|
|
38
|
+# Verify that commit messages are as expected
|
|
39
|
+#
|
|
40
|
+check-commits:
|
|
41
|
+ extends:
|
|
42
|
+ - .fdo.ci-fairy
|
|
43
|
+ stage: prep
|
|
44
|
+ script:
|
|
45
|
+ - ci-fairy check-commits --junit-xml=results.xml
|
|
46
|
+ except:
|
|
47
|
+ - master@xorg/lib/libxshmfence
|
|
48
|
+ variables:
|
|
49
|
+ GIT_DEPTH: 100
|
|
50
|
+ artifacts:
|
|
51
|
+ reports:
|
|
52
|
+ junit: results.xml
|
|
53
|
+
|
|
54
|
+#
|
|
55
|
+# Verify that the merge request has the allow-collaboration checkbox ticked
|
|
56
|
+#
|
|
57
|
+check-merge-request:
|
|
58
|
+ extends:
|
|
59
|
+ - .fdo.ci-fairy
|
|
60
|
+ stage: deploy
|
|
61
|
+ script:
|
|
62
|
+ - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
|
|
63
|
+ artifacts:
|
|
64
|
+ when: on_failure
|
|
65
|
+ reports:
|
|
66
|
+ junit: results.xml
|
|
67
|
+ allow_failure: true
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+#
|
|
71
|
+# Build a container with the given tag and the packages pre-installed.
|
|
72
|
+# This only happens if/when the tag changes, otherwise the existing image is
|
|
73
|
+# re-used.
|
|
74
|
+#
|
|
75
|
+container-prep:
|
|
76
|
+ extends:
|
|
77
|
+ - .fdo.container-build@arch
|
|
78
|
+ stage: prep
|
|
79
|
+ variables:
|
|
80
|
+ GIT_STRATEGY: none
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+#
|
|
84
|
+# The default build, runs on the image built above.
|
|
85
|
+#
|
|
86
|
+build:
|
|
87
|
+ stage: build
|
|
88
|
+ extends:
|
|
89
|
+ - .fdo.distribution-image@arch
|
|
90
|
+ script:
|
|
91
|
+ - autoreconf -ivf
|
|
92
|
+ - mkdir _builddir
|
|
93
|
+ - pushd _builddir > /dev/null
|
|
94
|
+ - ../configure --disable-silent-rules
|
|
95
|
+ - make
|
|
96
|
+ - make check
|
|
97
|
+ - make distcheck
|
|
98
|
+ - popd > /dev/null |
Makefile.am
... |
... |
@@ -25,7 +25,7 @@ SUBDIRS = src test |
25
|
25
|
pkgconfigdir = $(libdir)/pkgconfig
|
26
|
26
|
pkgconfig_DATA = xshmfence.pc
|
27
|
27
|
|
28
|
|
-EXTRA_DIST = xshmfence.pc.in ChangeLog
|
|
28
|
+EXTRA_DIST = xshmfence.pc.in ChangeLog README.md
|
29
|
29
|
MAINTAINERCLEANFILES = ChangeLog
|
30
|
30
|
|
31
|
31
|
.PHONY: ChangeLog
|
README
→
README.md
1
|
1
|
libxshmfence - Shared memory 'SyncFence' synchronization primitive
|
|
2
|
+------------------------------------------------------------------
|
2
|
3
|
|
3
|
4
|
This library offers a CPU-based synchronization primitive compatible
|
4
|
5
|
with the X SyncFence objects that can be shared between processes
|
... |
... |
@@ -14,23 +15,15 @@ There are two underlying implementations: |
14
|
15
|
All questions regarding this software should be directed at the
|
15
|
16
|
Xorg mailing list:
|
16
|
17
|
|
17
|
|
- http://lists.freedesktop.org/mailman/listinfo/xorg
|
|
18
|
+ https://lists.x.org/mailman/listinfo/xorg
|
18
|
19
|
|
19
|
|
-Please submit bug reports to the Xorg bugzilla:
|
|
20
|
+The primary development code repository can be found at:
|
20
|
21
|
|
21
|
|
- https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
|
|
22
|
+ https://gitlab.freedesktop.org/xorg/lib/libxshmfence
|
22
|
23
|
|
23
|
|
-The master development code repository can be found at:
|
24
|
|
-
|
25
|
|
- git://anongit.freedesktop.org/git/xorg/lib/libxshmfence
|
26
|
|
-
|
27
|
|
- http://cgit.freedesktop.org/xorg/lib/libxshmfence
|
|
24
|
+Please submit bug reports and requests to merge patches there.
|
28
|
25
|
|
29
|
26
|
For patch submission instructions, see:
|
30
|
27
|
|
31
|
|
- http://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
32
|
|
-
|
33
|
|
-For more information on the git code manager, see:
|
34
|
|
-
|
35
|
|
- http://wiki.x.org/wiki/GitPage
|
|
28
|
+ https://www.x.org/wiki/Development/Documentation/SubmittingPatches
|
36
|
29
|
|
autogen.sh
1
|
1
|
#! /bin/sh
|
2
|
2
|
|
3
|
|
-srcdir=`dirname $0`
|
|
3
|
+srcdir=`dirname "$0"`
|
4
|
4
|
test -z "$srcdir" && srcdir=.
|
5
|
5
|
|
6
|
6
|
ORIGDIR=`pwd`
|
7
|
|
-cd $srcdir
|
|
7
|
+cd "$srcdir"
|
8
|
8
|
|
9
|
9
|
autoreconf -v --install || exit 1
|
10
|
|
-cd $ORIGDIR || exit $?
|
|
10
|
+cd "$ORIGDIR" || exit $?
|
|
11
|
+
|
|
12
|
+git config --local --get format.subjectPrefix >/dev/null 2>&1 ||
|
|
13
|
+ git config --local format.subjectPrefix "PATCH libxshmfence"
|
11
|
14
|
|
12
|
15
|
if test -z "$NOCONFIGURE"; then
|
13
|
|
- $srcdir/configure "$@"
|
|
16
|
+ exec "$srcdir"/configure "$@"
|
14
|
17
|
fi |
configure.ac
... |
... |
@@ -23,13 +23,16 @@ dnl |
23
|
23
|
dnl Process this file with autoconf to create configure.
|
24
|
24
|
|
25
|
25
|
AC_PREREQ([2.60])
|
26
|
|
-AC_INIT([libxshmfence], [1.2],
|
27
|
|
- [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libxshmfence])
|
|
26
|
+AC_INIT([libxshmfence], [1.3.2],
|
|
27
|
+ [https://gitlab.freedesktop.org/xorg/lib/libxshmfence/-/issues],
|
|
28
|
+ [libxshmfence])
|
28
|
29
|
AC_CONFIG_SRCDIR([Makefile.am])
|
29
|
30
|
AC_CONFIG_HEADERS([config.h])
|
30
|
31
|
|
|
32
|
+AC_USE_SYSTEM_EXTENSIONS
|
|
33
|
+
|
31
|
34
|
# Initialize Automake
|
32
|
|
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
|
35
|
+AM_INIT_AUTOMAKE([foreign dist-xz])
|
33
|
36
|
|
34
|
37
|
# Initialize libtool
|
35
|
38
|
AC_PROG_LIBTOOL
|
... |
... |
@@ -44,9 +47,11 @@ dnl Allow checking code with lint, sparse, etc. |
44
|
47
|
XORG_WITH_LINT
|
45
|
48
|
LINT_FLAGS="${LINT_FLAGS} ${FONTENC_CFLAGS}"
|
46
|
49
|
|
47
|
|
-
|
|
50
|
+# Checks for typedefs, structures, and compiler characteristics.
|
|
51
|
+AC_SYS_LARGEFILE
|
|
52
|
+
|
48
|
53
|
dnl
|
49
|
|
-dnl Locate a suitable tmp file system for creating shared memeory files
|
|
54
|
+dnl Locate a suitable tmp file system for creating shared memory files
|
50
|
55
|
dnl
|
51
|
56
|
|
52
|
57
|
AC_ARG_ENABLE(futex, AS_HELP_STRING([--enable-futex], [Enable futexes (default: auto)]),
|
... |
... |
@@ -89,7 +94,7 @@ AC_SUBST([XPROTO_CFLAGS]) |
89
|
94
|
|
90
|
95
|
CFLAGS="$CFLAGS $XPROTO_CFLAGS"
|
91
|
96
|
|
92
|
|
-AC_CHECK_FUNCS(memfd_create)
|
|
97
|
+AC_CHECK_FUNCS(memfd_create mkostemp)
|
93
|
98
|
|
94
|
99
|
AC_CHECK_DECLS([__NR_memfd_create], [], [], [[#include <asm/unistd.h>]])
|
95
|
100
|
|
src/xshmfence_alloc.c
... |
... |
@@ -26,6 +26,8 @@ |
26
|
26
|
|
27
|
27
|
#include "xshmfenceint.h"
|
28
|
28
|
|
|
29
|
+#include <fcntl.h>
|
|
30
|
+
|
29
|
31
|
#if !HAVE_MEMFD_CREATE
|
30
|
32
|
#if HAVE_DECL___NR_MEMFD_CREATE
|
31
|
33
|
#include <asm/unistd.h>
|
... |
... |
@@ -68,10 +70,17 @@ xshmfence_alloc_shm(void) |
68
|
70
|
{
|
69
|
71
|
char template[] = SHMDIR "/shmfd-XXXXXX";
|
70
|
72
|
int fd;
|
|
73
|
+#ifndef HAVE_MKOSTEMP
|
|
74
|
+ int flags;
|
|
75
|
+#endif
|
71
|
76
|
|
72
|
77
|
#if HAVE_MEMFD_CREATE
|
73
|
78
|
fd = memfd_create("xshmfence", MFD_CLOEXEC|MFD_ALLOW_SEALING);
|
74
|
79
|
if (fd < 0)
|
|
80
|
+#endif
|
|
81
|
+#ifdef SHM_ANON
|
|
82
|
+ fd = shm_open(SHM_ANON, O_RDWR|O_CLOEXEC, 0600);
|
|
83
|
+ if (fd < 0)
|
75
|
84
|
#endif
|
76
|
85
|
{
|
77
|
86
|
#ifdef O_TMPFILE
|
... |
... |
@@ -79,10 +88,21 @@ xshmfence_alloc_shm(void) |
79
|
88
|
if (fd < 0)
|
80
|
89
|
#endif
|
81
|
90
|
{
|
|
91
|
+#ifdef HAVE_MKOSTEMP
|
|
92
|
+ fd = mkostemp(template, O_CLOEXEC);
|
|
93
|
+#else
|
82
|
94
|
fd = mkstemp(template);
|
|
95
|
+#endif
|
83
|
96
|
if (fd < 0)
|
84
|
97
|
return fd;
|
85
|
98
|
unlink(template);
|
|
99
|
+#ifndef HAVE_MKOSTEMP
|
|
100
|
+ flags = fcntl(fd, F_GETFD);
|
|
101
|
+ if (flags != -1) {
|
|
102
|
+ flags |= FD_CLOEXEC;
|
|
103
|
+ fcntl(fd, F_SETFD, &flags);
|
|
104
|
+ }
|
|
105
|
+#endif
|
86
|
106
|
}
|
87
|
107
|
}
|
88
|
108
|
if (ftruncate(fd, sizeof (struct xshmfence)) < 0) {
|
src/xshmfence_futex.h
... |
... |
@@ -30,6 +30,7 @@ |
30
|
30
|
|
31
|
31
|
#include <sys/types.h>
|
32
|
32
|
#include <sys/umtx.h>
|
|
33
|
+#include <limits.h>
|
33
|
34
|
|
34
|
35
|
static inline int sys_futex(void *addr, int op, int32_t val)
|
35
|
36
|
{
|
|