On Mon, 10 May 2021 20:10:48 +0000
Charlene Wendling <juliana...@posteo.jp> wrote:

> __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.

ok gkoehler@

powerpc64 clang also defines __powerpc__, the macro in your diff, but
your diff is still correct.  powerpc64 (unlike powerpc) does define
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8, so it doesn't compile this code,
before or after your diff.

I can't build qtwebkit on powerpc right now because I am waiting for
my macppc to build other things.  I didn't look further to see
whether the code used __sync_* or __atomic_* or what.   --George

> 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"
> + 
> 


-- 
George Koehler <kern...@gmail.com>

Reply via email to