Hi, 

qtwebkit does not build in the current macppc bulk, the first with
clang-11:

> ../Source/WTF/wtf/Atomics.cpp:63:9: error: definition of builtin function 
> '__sync_add_and_fetch_8'
> int64_t __sync_add_and_fetch_8(int64_t volatile* addend, int64_t value)
> ../Source/WTF/wtf/Atomics.cpp:68:9: error: definition of builtin function 
> '__sync_sub_and_fetch_8'
> int64_t __sync_sub_and_fetch_8(int64_t volatile* addend, int64_t value)

__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 is not defined on powerpc because
there is no instruction on that arch for that. Nonetheless we
can use 8 byte __sync_* operators [0].

This code addresses issues with old gcc versions that are not used on
macppc anymore. This has been removed from the latest qtwebkit
developments [1]. As such i've simply excluded powerpc from that.

With the below diff i can successfully build qtwebkit on macppc [2],
as expected it has no impact on amd64.

Comments/feedback are welcome,

Charlène.


[0] https://marc.info/?l=openbsd-cvs&m=159131001523468&w=2
[1] https://github.com/qtwebkit/qtwebkit/tree/qtwebkit-dev-wip/Source/WTF/wtf
[2] https://bin.charlenew.xyz/qtwebkit.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/qt5/qtwebkit/Makefile,v
retrieving revision 1.31
diff -u -p -u -p -r1.31 Makefile
--- Makefile    8 May 2021 14:58:43 -0000       1.31
+++ Makefile    10 May 2021 13:35:03 -0000
@@ -15,7 +15,7 @@ PKGNAME =             qtwebkit-${VERSION}
 PKGSPEC =              qtwebkit->=${VERSION}v0
 
 EPOCH =                        0
-REVISION =             3
+REVISION =             4
 
 
 SHARED_LIBS +=  Qt5WebKit               3.1 # 5.9
Index: patches/patch-Source_WTF_wtf_Atomics_cpp
===================================================================
RCS file: patches/patch-Source_WTF_wtf_Atomics_cpp
diff -N patches/patch-Source_WTF_wtf_Atomics_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_WTF_wtf_Atomics_cpp    10 May 2021 13:35:03 -0000
@@ -0,0 +1,17 @@
+$OpenBSD$
+
+powerpc fix: don't redefine 64-bits __sync_* built-ins operators
+
+Index: Source/WTF/wtf/Atomics.cpp
+--- Source/WTF/wtf/Atomics.cpp.orig
++++ Source/WTF/wtf/Atomics.cpp
+@@ -32,7 +32,8 @@
+ // (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56296). GCC >= 4.8 will 
support __atomic_* builtin
+ // functions for this purpose for all the GCC targets, but for current 
compilers we have to include
+ // our own implementation.
+-#if COMPILER(GCC_OR_CLANG) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) && 
USE(PTHREADS)
++#if !defined(__powerpc__) \
++    && COMPILER(GCC_OR_CLANG) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) 
&& USE(PTHREADS)
+ 
+ #include "ThreadingPrimitives.h"
+ 

Reply via email to