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

Collapse All | Expand All

(-)Makefile (-2 / +2 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	swi-pl
4
PORTNAME=	swi-pl
5
DISTVERSION=	8.2.0
5
DISTVERSION=	8.2.1
6
CATEGORIES=	lang
6
CATEGORIES=	lang
7
MASTER_SITES=	http://www.swi-prolog.org/download/stable/src/
7
MASTER_SITES=	http://www.swi-prolog.org/download/stable/src/
8
DISTNAME=	swipl-${DISTVERSION}
8
DISTNAME=	swipl-${DISTVERSION}
Lines 12-18 Link Here
12
12
13
LICENSE=	BSD2CLAUSE
13
LICENSE=	BSD2CLAUSE
14
14
15
BROKEN_i386=	fails to link: libswipl.so: undefined reference to __atomic_compare_exchange_8
16
BROKEN_mips=	fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
15
BROKEN_mips=	fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
17
BROKEN_mips64=	fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
16
BROKEN_mips64=	fails to link: libswipl.so: undefined reference to '__sync_sub_and_fetch_4'
18
17
Lines 32-37 Link Here
32
SHEBANG_LANG=	swipl
31
SHEBANG_LANG=	swipl
33
32
34
CMAKE_ARGS=	-DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=ON
33
CMAKE_ARGS=	-DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=ON
34
35
CMAKE_BUILD_TYPE=	Release
35
CMAKE_BUILD_TYPE=	Release
36
36
37
NOPRECIOUSMAKEVARS=	yes
37
NOPRECIOUSMAKEVARS=	yes
(-)distinfo (-2 / +2 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1587312848
1
TIMESTAMP = 1587312848
2
SHA256 (swipl-8.2.0.tar.gz) = d8c9f3adb9cd997a5fed7b5f5dbfe971d2defda969b9066ada158e4202c09c3c
2
SHA256 (swipl-8.2.1.tar.gz) = 331bc5093d72af0c9f18fc9ed83b88ef9ddec0c8d379e6c49fa43739c8bda2fb
3
SIZE (swipl-8.2.0.tar.gz) = 10955744
3
SIZE (swipl-8.2.1.tar.gz) = 10969688
(-)files/patch-packages_semweb_memory.h (+26 lines)
Line 0 Link Here
1
--- packages/semweb/memory.h.orig	2020-05-29 15:03:22 UTC
2
+++ packages/semweb/memory.h
3
@@ -85,14 +85,18 @@ MSB(unsigned int i)
4
 #define MEMORY_BARRIER()	__atomic_thread_fence(__ATOMIC_SEQ_CST)
5
 #define PREFETCH_FOR_WRITE(p)	__builtin_prefetch(p, 1, 0)
6
 #define PREFETCH_FOR_READ(p)	__builtin_prefetch(p, 0, 0)
7
-#define ATOMIC_ADD(ptr, v)	__atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST)
8
-#define ATOMIC_SUB(ptr, v)	__atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST)
9
+#define ATOMIC_ADD(ptr, v)  (sizeof(v) > sizeof(void *) \
10
+        ? __sync_add_and_fetch(ptr, v) \
11
+        : __atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST))
12
+#define ATOMIC_SUB(ptr, v) (sizeof(v) > sizeof(void *) \
13
+        ? __sync_sub_and_fetch(ptr, v) \
14
+        : __atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST))
15
 #define ATOMIC_INC(ptr)		ATOMIC_ADD(ptr, 1) /* ++(*ptr) */
16
 #define ATOMIC_DEC(ptr)		ATOMIC_SUB(ptr, 1) /* --(*ptr) */
17
 
18
-#define __COMPARE_AND_SWAP(at, from, to) \
19
-	__atomic_compare_exchange_n(at, &(from), to, FALSE, \
20
-				    __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
21
+#define __COMPARE_AND_SWAP(at, from, to) (sizeof(from) > sizeof(void *) \
22
+        ? __atomic_compare_exchange(at, &(from), &(to), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) \
23
+        : __atomic_compare_exchange_n(at, &(from), to, FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
24
 
25
 static inline int
26
 COMPARE_AND_SWAP_PTR(void *at, void *from, void *to)
(-)files/patch-packages_ssl_ssl4pl.c (+26 lines)
Line 0 Link Here
1
--- packages/ssl/ssl4pl.c.orig	2020-05-29 15:04:02 UTC
2
+++ packages/ssl/ssl4pl.c
3
@@ -268,13 +268,18 @@ typedef enum
4
 		 *	       ATOMIC		*
5
 		 *******************************/
6
 
7
-#define ATOMIC_ADD(ptr, v)	__atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST)
8
-#define ATOMIC_SUB(ptr, v)	__atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST)
9
+#define ATOMIC_ADD(ptr, v)  (sizeof(v) > sizeof(void *) \
10
+        ? __sync_add_and_fetch(ptr, v) \
11
+        : __atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST))
12
+#define ATOMIC_SUB(ptr, v) (sizeof(v) > sizeof(void *) \
13
+        ? __sync_sub_and_fetch(ptr, v) \
14
+        : __atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST))
15
 #define ATOMIC_INC(ptr)		ATOMIC_ADD(ptr, 1) /* ++(*ptr) */
16
 #define ATOMIC_DEC(ptr)		ATOMIC_SUB(ptr, 1) /* --(*ptr) */
17
-#define __COMPARE_AND_SWAP(at, from, to) \
18
-	__atomic_compare_exchange_n(at, &(from), to, FALSE, \
19
-				    __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
20
+
21
+#define __COMPARE_AND_SWAP(at, from, to) (sizeof(from) > sizeof(void *) \
22
+        ? __atomic_compare_exchange(at, &(from), &(to), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) \
23
+        : __atomic_compare_exchange_n(at, &(from), to, FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
24
 
25
 static inline int
26
 COMPARE_AND_SWAP_PTR(void *at, void *from, void *to)
(-)files/patch-src_os_pl-stream.h (+17 lines)
Line 0 Link Here
1
--- src/os/pl-stream.h.orig	2020-06-29 08:03:59 UTC
2
+++ src/os/pl-stream.h
3
@@ -40,8 +40,12 @@
4
 #include "SWI-Stream.h"
5
 
6
 #ifdef O_PLMT
7
-#define ATOMIC_ADD(ptr, v)	__atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST)
8
-#define ATOMIC_SUB(ptr, v)	__atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST)
9
+#define ATOMIC_ADD(ptr, v)  (sizeof(v) > sizeof(void *) \
10
+        ? __sync_add_and_fetch(ptr, v) \
11
+        : __atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST))
12
+#define ATOMIC_SUB(ptr, v) (sizeof(v) > sizeof(void *) \
13
+        ? __sync_sub_and_fetch(ptr, v) \
14
+        : __atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST))
15
 #define ATOMIC_INC(ptr)		ATOMIC_ADD(ptr, 1) /* ++(*ptr) */
16
 #define ATOMIC_DEC(ptr)		ATOMIC_SUB(ptr, 1) /* --(*ptr) */
17
 #else
(-)files/patch-src_pl-inline.h (+28 lines)
Line 0 Link Here
1
--- src/pl-inline.h.orig	2020-06-29 08:03:59 UTC
2
+++ src/pl-inline.h
3
@@ -124,16 +124,20 @@ __builtin_popcount(size_t sz)
4
 #endif
5
 
6
 #ifdef O_PLMT
7
-#define ATOMIC_ADD(ptr, v)	__atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST)
8
-#define ATOMIC_SUB(ptr, v)	__atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST)
9
+#define ATOMIC_ADD(ptr, v)  (sizeof(v) > sizeof(void *) \
10
+	? __sync_add_and_fetch(ptr, v) \
11
+	: __atomic_add_fetch(ptr, v, __ATOMIC_SEQ_CST))
12
+#define ATOMIC_SUB(ptr, v) (sizeof(v) > sizeof(void *) \
13
+        ? __sync_sub_and_fetch(ptr, v) \
14
+        : __atomic_sub_fetch(ptr, v, __ATOMIC_SEQ_CST))
15
 #define ATOMIC_INC(ptr)		ATOMIC_ADD(ptr, 1) /* ++(*ptr) */
16
 #define ATOMIC_DEC(ptr)		ATOMIC_SUB(ptr, 1) /* --(*ptr) */
17
 #define ATOMIC_OR(ptr, v)	__atomic_fetch_or(ptr, v, __ATOMIC_SEQ_CST)
18
 #define ATOMIC_AND(ptr, v)	__atomic_fetch_and(ptr, v, __ATOMIC_SEQ_CST)
19
 
20
-#define __COMPARE_AND_SWAP(at, from, to) \
21
-	__atomic_compare_exchange_n(at, &(from), to, FALSE, \
22
-				    __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
23
+#define __COMPARE_AND_SWAP(at, from, to) (sizeof(from) > sizeof(void *) \
24
+	? __atomic_compare_exchange(at, &(from), &(to), FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST) \
25
+	: __atomic_compare_exchange_n(at, &(from), to, FALSE, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
26
 
27
 static inline int
28
 COMPARE_AND_SWAP_PTR(void *at, void *from, void *to)
(-)pkg-plist (-1 / +1 lines)
Lines 420-426 Link Here
420
lib/swipl/lib/%%ARCH%%-%%OS%%/libedit4pl.so
420
lib/swipl/lib/%%ARCH%%-%%OS%%/libedit4pl.so
421
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so
421
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so
422
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so.8
422
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so.8
423
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so.8.2.0
423
lib/swipl/lib/%%ARCH%%-%%OS%%/libswipl.so.8.2.1
424
lib/swipl/lib/%%ARCH%%-%%OS%%/md54pl.so
424
lib/swipl/lib/%%ARCH%%-%%OS%%/md54pl.so
425
lib/swipl/lib/%%ARCH%%-%%OS%%/memfile.so
425
lib/swipl/lib/%%ARCH%%-%%OS%%/memfile.so
426
lib/swipl/lib/%%ARCH%%-%%OS%%/ntriples.so
426
lib/swipl/lib/%%ARCH%%-%%OS%%/ntriples.so

Return to bug 247743