pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/multimedia/x265



Module Name:    pkgsrc
Committed By:   he
Date:           Sat Jun 27 22:53:56 UTC 2026

Modified Files:
        pkgsrc/multimedia/x265: Makefile distinfo
Added Files:
        pkgsrc/multimedia/x265/patches: patch-common_threading.h

Log Message:
multimedia/x265: convert from using __sync* to __atomic* operations.

Also use mk/atomic64.mk.

Ref. https://gcc.gnu.org/wiki/Atomic/GCCMM.

Should fix PR#60371.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 pkgsrc/multimedia/x265/Makefile
cvs rdiff -u -r1.45 -r1.46 pkgsrc/multimedia/x265/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/multimedia/x265/patches/patch-common_threading.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/multimedia/x265/Makefile
diff -u pkgsrc/multimedia/x265/Makefile:1.46 pkgsrc/multimedia/x265/Makefile:1.47
--- pkgsrc/multimedia/x265/Makefile:1.46        Mon Apr 20 18:05:25 2026
+++ pkgsrc/multimedia/x265/Makefile     Sat Jun 27 22:53:56 2026
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.46 2026/04/20 18:05:25 adam Exp $
+# $NetBSD: Makefile,v 1.47 2026/06/27 22:53:56 he Exp $
 
 DISTNAME=      x265_4.2
 PKGNAME=       ${DISTNAME:S/_/-/}
+PKGREVISION=   1
 CATEGORIES=    multimedia
 MASTER_SITES=  https://bitbucket.org/multicoreware/x265_git/downloads/
 
@@ -39,4 +40,5 @@ CMAKE_CONFIGURE_ARGS+=        -DCMAKE_SYSTEM_PR
 .endif
 
 .include "../../devel/cmake/build.mk"
+.include "../../mk/atomic64.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/multimedia/x265/distinfo
diff -u pkgsrc/multimedia/x265/distinfo:1.45 pkgsrc/multimedia/x265/distinfo:1.46
--- pkgsrc/multimedia/x265/distinfo:1.45        Mon Apr 20 18:05:25 2026
+++ pkgsrc/multimedia/x265/distinfo     Sat Jun 27 22:53:56 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.45 2026/04/20 18:05:25 adam Exp $
+$NetBSD: distinfo,v 1.46 2026/06/27 22:53:56 he Exp $
 
 BLAKE2s (x265_4.2.tar.gz) = cb25b083232b66c93aa916ed714ff3f91a05473b58638179e8c504dcdc7ef5d0
 SHA512 (x265_4.2.tar.gz) = 0c4ded0388b79ecdfe28b7f48da095ecb12a7e1fc7cd92f8d35a850087de562081582de69846a7d64e03889d6b8da620b5fa084dac3ab8734a05552f68bf8623
@@ -8,6 +8,7 @@ SHA1 (patch-common_common.h) = eece838c7
 SHA1 (patch-common_cpu.cpp) = 9848fdb3664f3403f4c0c540fe77a41b4accb5ea
 SHA1 (patch-common_cpu.h) = 000f9b6e40a459db4e3428730c8a9f5eeb6d9449
 SHA1 (patch-common_quant.cpp) = 648e21479e7af9007e5aca1db86a7f1de50047ea
+SHA1 (patch-common_threading.h) = f25b8f99d5dc3c69bca67519f558eaef61042154
 SHA1 (patch-common_version.cpp) = b7deaf67279a391e79e1820078bfd248fb66759a
 SHA1 (patch-encoder_analysis.cpp) = c9661f34f73b03055273331065052f1f6bb41507
 SHA1 (patch-encoder_encoder.cpp) = 7305a5b065d02eb5f3824b1af1ab4a85a14cb4c4

Added files:

Index: pkgsrc/multimedia/x265/patches/patch-common_threading.h
diff -u /dev/null pkgsrc/multimedia/x265/patches/patch-common_threading.h:1.1
--- /dev/null   Sat Jun 27 22:53:56 2026
+++ pkgsrc/multimedia/x265/patches/patch-common_threading.h     Sat Jun 27 22:53:56 2026
@@ -0,0 +1,23 @@
+$NetBSD: patch-common_threading.h,v 1.1 2026/06/27 22:53:56 he Exp $
+
+Try with a variant where we replace __sync* with __atomic*.
+
+--- common/threading.h.orig    2026-04-19 08:29:17.000000000 +0200
++++ common/threading.h 2026-06-26 20:37:17.150566275 +0200
+@@ -81,11 +81,11 @@
+ #define BSF(id, x)            (id) = ((unsigned long)__builtin_ctz(x))
+ #define BSR64(id, x)          (id) = ((unsigned long)__builtin_clzll(x) ^ 63)
+ #define BSF64(id, x)          (id) = ((unsigned long)__builtin_ctzll(x))
+-#define ATOMIC_OR(ptr, mask)  __sync_fetch_and_or(ptr, mask)
+-#define ATOMIC_AND(ptr, mask) __sync_fetch_and_and(ptr, mask)
+-#define ATOMIC_INC(ptr)       __sync_add_and_fetch((volatile int32_t*)ptr, 1)
+-#define ATOMIC_DEC(ptr)       __sync_add_and_fetch((volatile int32_t*)ptr, -1)
+-#define ATOMIC_ADD(ptr, val)  __sync_fetch_and_add((volatile __typeof__(*(ptr))*)ptr, (__typeof__(*(ptr) + 0))(val))
++#define ATOMIC_OR(ptr, mask)  __atomic_fetch_or(ptr, mask, __ATOMIC_SEQ_CST)
++#define ATOMIC_AND(ptr, mask) __atomic_fetch_and(ptr, mask, __ATOMIC_SEQ_CST)
++#define ATOMIC_INC(ptr)       __atomic_add_fetch((volatile int32_t*)ptr, 1, __ATOMIC_SEQ_CST)
++#define ATOMIC_DEC(ptr)       __atomic_add_fetch((volatile int32_t*)ptr, -1, __ATOMIC_SEQ_CST)
++#define ATOMIC_ADD(ptr, val)  __atomic_fetch_add((volatile __typeof__(*(ptr))*)ptr, (__typeof__(*(ptr) + 0))(val), __ATOMIC_SEQ_CST)
+ #define GIVE_UP_TIME()        usleep(0)
+ 
+ #elif defined(_MSC_VER)       /* Windows atomic intrinsics */



Home | Main Index | Thread Index | Old Index