summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkim <jkim@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-10 06:18:45 +0800
committerjkim <jkim@058c260c-8361-11dd-a0ac-aa2bafec7d09>2013-12-10 06:18:45 +0800
commit34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f (patch)
treea304bf7f4410d867e72d5edcafb83b1cf433f09e
parentda70533b083f0d876c390b546c2675eed645ba7e (diff)
downloadxorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar.gz
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar.bz2
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar.lz
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar.xz
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.tar.zst
xorg-devel-ports-34a247b3d0ba0ce63aa416bdcd456fcaa1310e4f.zip
- Use u_int instead of u_long for umtx. [1]
- Use mkostemp(3) instead of mktemp(3). - Remove test target. It may fail because the unit test is incomplete. Suggested by: jilles [1] git-svn-id: https://trillian.chruetertee.ch/svn/ports/trunk@1304 058c260c-8361-11dd-a0ac-aa2bafec7d09
-rw-r--r--x11/libxshmfence/Makefile3
-rw-r--r--x11/libxshmfence/files/patch-config.h.in16
-rw-r--r--x11/libxshmfence/files/patch-configure17
-rw-r--r--x11/libxshmfence/files/patch-src__xshmfence_alloc.c20
-rw-r--r--x11/libxshmfence/files/patch-src__xshmfence_futex.h63
-rw-r--r--x11/libxshmfence/files/patch-src__xshmfenceint.h10
6 files changed, 72 insertions, 57 deletions
diff --git a/x11/libxshmfence/Makefile b/x11/libxshmfence/Makefile
index dd0b6db..9a208a1 100644
--- a/x11/libxshmfence/Makefile
+++ b/x11/libxshmfence/Makefile
@@ -12,7 +12,4 @@ LICENSE= MIT
USE_XORG= xproto
XORG_CAT= lib
-test: build
- @cd ${WRKSRC} && ${MAKE} check
-
.include <bsd.port.mk>
diff --git a/x11/libxshmfence/files/patch-config.h.in b/x11/libxshmfence/files/patch-config.h.in
index ea96db2..bbb52e1 100644
--- a/x11/libxshmfence/files/patch-config.h.in
+++ b/x11/libxshmfence/files/patch-config.h.in
@@ -1,6 +1,16 @@
---- config.h.in.orig 2013-11-27 00:54:40.000000000 -0500
-+++ config.h.in 2013-12-05 16:28:18.000000000 -0500
-@@ -33,6 +33,9 @@
+--- config.h.in 2013-11-27 00:54:40.000000000 -0500
++++ config.h.in 2013-12-09 16:56:20.000000000 -0500
+@@ -12,6 +12,9 @@
+ /* Define to 1 if you have the <memory.h> header file. */
+ #undef HAVE_MEMORY_H
+
++/* Use mkostemp(3) */
++#undef HAVE_MKOSTEMP
++
+ /* Use pthread primitives */
+ #undef HAVE_PTHREAD
+
+@@ -33,6 +36,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
diff --git a/x11/libxshmfence/files/patch-configure b/x11/libxshmfence/files/patch-configure
index 16697e3..dda82c6 100644
--- a/x11/libxshmfence/files/patch-configure
+++ b/x11/libxshmfence/files/patch-configure
@@ -1,5 +1,5 @@
--- configure 2013-11-27 00:54:35.000000000 -0500
-+++ configure 2013-12-05 16:30:53.000000000 -0500
++++ configure 2013-12-09 15:03:55.000000000 -0500
@@ -17633,11 +17633,27 @@
ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default"
if test "x$ac_cv_header_linux_futex_h" = xyes; then :
@@ -28,3 +28,18 @@
fi
if test "x$FUTEX" = "xyes"; then
+@@ -17717,6 +17733,14 @@
+ fi
+
+
++ac_fn_c_check_func "$LINENO" "mkostemp" "ac_cv_func_mkostemp"
++if test "x$ac_cv_func_mkostemp" = xyes; then :
++
++$as_echo "#define HAVE_MKOSTEMP 1" >>confdefs.h
++
++fi
++
++
+
+ pkg_failed=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XPROTO" >&5
diff --git a/x11/libxshmfence/files/patch-src__xshmfence_alloc.c b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
new file mode 100644
index 0000000..df38300
--- /dev/null
+++ b/x11/libxshmfence/files/patch-src__xshmfence_alloc.c
@@ -0,0 +1,20 @@
+--- src/xshmfence_alloc.c 2013-11-20 17:13:08.000000000 -0500
++++ src/xshmfence_alloc.c 2013-12-09 16:06:17.000000000 -0500
+@@ -41,11 +41,15 @@
+ char template[] = SHMDIR "/shmfd-XXXXXX";
+ int fd;
+
+-#ifdef O_TMPFILE
++#if defined(O_CLOEXEC)
++#if defined(HAVE_MKOSTEMP)
++ fd = mkostemp(template, O_CLOEXEC);
++#elif defined(O_TMPFILE)
+ fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
+- if (fd < 0)
+ #endif
++ if (fd < 0)
+ {
++#endif
+ fd = mkstemp(template);
+ if (fd < 0)
+ return fd;
diff --git a/x11/libxshmfence/files/patch-src__xshmfence_futex.h b/x11/libxshmfence/files/patch-src__xshmfence_futex.h
index 32deb6a..5a859a9 100644
--- a/x11/libxshmfence/files/patch-src__xshmfence_futex.h
+++ b/x11/libxshmfence/files/patch-src__xshmfence_futex.h
@@ -1,5 +1,5 @@
---- src/xshmfence_futex.h.orig 2013-11-20 17:13:08.000000000 -0500
-+++ src/xshmfence_futex.h 2013-12-05 16:09:39.000000000 -0500
+--- src/xshmfence_futex.h 2013-11-20 17:13:08.000000000 -0500
++++ src/xshmfence_futex.h 2013-12-09 15:52:29.000000000 -0500
@@ -1,5 +1,6 @@
/*
* Copyright © 2013 Keith Packard
@@ -7,7 +7,7 @@
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
-@@ -24,37 +25,59 @@
+@@ -24,6 +25,27 @@
#define _XSHMFENCE_FUTEX_H_
#include <errno.h>
@@ -17,14 +17,17 @@
+#include <sys/types.h>
+#include <sys/umtx.h>
+
-+typedef u_long futex_type;
++static inline int sys_futex(void *addr, int op, int val)
++{
++ return _umtx_op(addr, op, val, NULL, NULL) == -1 ? errno : 0;
++}
+
-+static inline int futex_wake(futex_type *addr) {
-+ return umtx_wake(addr, INT_MAX);
++static inline int futex_wake(int32_t *addr) {
++ return sys_futex(addr, UMTX_OP_WAKE, INT_MAX);
+}
+
-+static inline int futex_wait(futex_type *addr, futex_type value) {
-+ return umtx_wait(addr, value, NULL);
++static inline int futex_wait(int32_t *addr, int32_t value) {
++ return sys_futex(addr, UMTX_OP_WAIT_UINT, value);
+}
+
+#else
@@ -32,23 +35,7 @@
#include <stdint.h>
#include <values.h>
#include <linux/futex.h>
- #include <sys/time.h>
- #include <sys/syscall.h>
-
-+typedef int32_t futex_type;
-+
- 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);
- }
-
--static inline int futex_wake(int32_t *addr) {
-+static inline int futex_wake(futex_type *addr) {
- return sys_futex(addr, FUTEX_WAKE, MAXINT, NULL, NULL, 0);
- }
-
--static inline int futex_wait(int32_t *addr, int32_t value) {
-+static inline int futex_wait(futex_type *addr, futex_type value) {
+@@ -43,6 +65,8 @@
return sys_futex(addr, FUTEX_WAIT, value, NULL, NULL, 0);
}
@@ -56,28 +43,4 @@
+
#define barrier() __asm__ __volatile__("": : :"memory")
--static inline void atomic_store(int32_t *f, int32_t v)
-+static inline void atomic_store(futex_type *f, futex_type v)
- {
- barrier();
- *f = v;
- barrier();
- }
-
--static inline int32_t atomic_fetch(int32_t *a)
-+static inline futex_type atomic_fetch(futex_type *a)
- {
-- int32_t v;
-+ futex_type v;
- barrier();
- v = *a;
- barrier();
-@@ -62,7 +85,7 @@
- }
-
- struct xshmfence {
-- int32_t v;
-+ futex_type v;
- };
-
- #define xshmfence_init(fd)
+ static inline void atomic_store(int32_t *f, int32_t v)
diff --git a/x11/libxshmfence/files/patch-src__xshmfenceint.h b/x11/libxshmfence/files/patch-src__xshmfenceint.h
new file mode 100644
index 0000000..bc8aead
--- /dev/null
+++ b/x11/libxshmfence/files/patch-src__xshmfenceint.h
@@ -0,0 +1,10 @@
+--- src/xshmfenceint.h 2013-11-20 17:14:05.000000000 -0500
++++ src/xshmfenceint.h 2013-12-09 15:14:36.000000000 -0500
+@@ -23,6 +23,7 @@
+ #ifndef _XSHMFENCEINT_H_
+ #define _XSHMFENCEINT_H_
+
++#include <fcntl.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <sys/mman.h>