View | Details | Raw Unified | Return to bug 241335 | Differences between
and this patch

Collapse All | Expand All

(-)databases/mariadb104-server/Makefile (+4 lines)
Lines 179-184 Link Here
179
179
180
.include <bsd.port.pre.mk>
180
.include <bsd.port.pre.mk>
181
181
182
.if ${ARCH} == "i386"
183
EXTRA_PATCHES+=	${MASTERDIR}/files/extrapatch-MDEV-13728
184
.endif
185
182
.if ${ARCH} != amd64
186
.if ${ARCH} != amd64
183
PLIST_SUB+=	WSREP="@comment "
187
PLIST_SUB+=	WSREP="@comment "
184
.endif
188
.endif
(-)databases/mariadb104-server/files/extrapatch-MDEV-13728 (+119 lines)
Line 0 Link Here
1
--- include/my_atomic.h.orig
2
+++ include/my_atomic.h
3
@@ -113,6 +113,7 @@
4
 #elif defined(HAVE_GCC_C11_ATOMICS)
5
 #include "atomic/gcc_builtins.h"
6
 #endif
7
+#include "atomic/gcc_sync.h"
8
9
 #if SIZEOF_LONG == 4
10
 #define my_atomic_addlong(A,B) my_atomic_add32((int32*) (A), (B))
11
--- include/atomic/gcc_sync.h.orig
12
+++ include/atomic/gcc_sync.h
13
@@ -0,0 +1,106 @@
14
+#ifndef GCC_SYNC_INCLUDED
15
+#define GCC_SYNC_INCLUDED
16
+
17
+/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
18
+
19
+   This program is free software; you can redistribute it and/or modify
20
+   it under the terms of the GNU General Public License as published by
21
+   the Free Software Foundation; version 2 of the License.
22
+
23
+   This program is distributed in the hope that it will be useful,
24
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
+   GNU General Public License for more details.
27
+
28
+   You should have received a copy of the GNU General Public License
29
+   along with this program; if not, write to the Free Software
30
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
31
+
32
+/* Old GCC __sync builtins introduced in GCC 4.1 */
33
+
34
+static inline int my_atomic_cas32(int32 volatile *a, int32 *cmp, int32 set)
35
+{
36
+  int32 cmp_val= *cmp;
37
+  int32 sav= __sync_val_compare_and_swap(a, cmp_val, set);
38
+  int ret= (sav == cmp_val);
39
+  if (!ret)
40
+    *cmp = sav;
41
+  return ret;
42
+}
43
+
44
+static inline int my_atomic_cas64(int64 volatile *a, int64 *cmp, int64 set)
45
+{
46
+  int64 cmp_val= *cmp;
47
+  int64 sav= __sync_val_compare_and_swap(a, cmp_val, set);
48
+  int ret= (sav == cmp_val);
49
+  if (!ret)
50
+    *cmp = sav;
51
+  return ret;
52
+}
53
+
54
+static inline int my_atomic_casptr(void * volatile *a, void **cmp, void *set)
55
+{
56
+  void *cmp_val= *cmp;
57
+  void *sav= __sync_val_compare_and_swap(a, cmp_val, set);
58
+  int ret= (sav == cmp_val);
59
+  if (!ret)
60
+    *cmp = sav;
61
+  return ret;
62
+}
63
+
64
+static inline int32 my_atomic_add32(int32 volatile *a, int32 v)
65
+{
66
+  return __sync_fetch_and_add(a, v);
67
+}
68
+
69
+static inline int64 my_atomic_add64(int64 volatile *a, int64 v)
70
+{
71
+  return __sync_fetch_and_add(a, v);
72
+}
73
+
74
+static inline int32 my_atomic_fas32(int32 volatile *a, int32 v)
75
+{
76
+  return __sync_lock_test_and_set(a, v);
77
+}
78
+
79
+static inline int64 my_atomic_fas64(int64 volatile *a, int64 v)
80
+{
81
+  return __sync_lock_test_and_set(a, v);
82
+}
83
+
84
+static inline void * my_atomic_fasptr(void * volatile *a, void * v)
85
+{
86
+  return __sync_lock_test_and_set(a, v);
87
+}
88
+
89
+static inline int32 my_atomic_load32(int32 volatile *a)
90
+{
91
+  return __sync_fetch_and_or(a, 0);
92
+}
93
+
94
+static inline int64 my_atomic_load64(int64 volatile *a)
95
+{
96
+  return __sync_fetch_and_or(a, 0);
97
+}
98
+
99
+static inline void* my_atomic_loadptr(void * volatile *a)
100
+{
101
+  return __sync_fetch_and_or(a, 0);
102
+}
103
+
104
+static inline void my_atomic_store32(int32 volatile *a, int32 v)
105
+{
106
+  (void) __sync_lock_test_and_set(a, v);
107
+}
108
+
109
+static inline void my_atomic_store64(int64 volatile *a, int64 v)
110
+{
111
+  (void) __sync_lock_test_and_set(a, v);
112
+}
113
+
114
+static inline void my_atomic_storeptr(void * volatile *a, void *v)
115
+{
116
+  (void) __sync_lock_test_and_set(a, v);
117
+}
118
+
119
+#endif /* GCC_SYNC_INCLUDED */
(-)databases/mariadb104-client/Makefile (-2 lines)
Lines 6-13 Link Here
6
6
7
COMMENT=	Multithreaded SQL database (client)
7
COMMENT=	Multithreaded SQL database (client)
8
8
9
BROKEN_i386=	compile error: undeclared identifier 'my_atomic_add32'
10
11
MASTERDIR=	${.CURDIR}/../${PORTNAME}${PKGNAMESUFFIX:C/-client/-server/}
9
MASTERDIR=	${.CURDIR}/../${PORTNAME}${PKGNAMESUFFIX:C/-client/-server/}
12
10
13
FILESDIR=	${.CURDIR}/files
11
FILESDIR=	${.CURDIR}/files

Return to bug 241335