Wednesday, March 31, 2021

[macppc] Unbreak www/webkitgtk4

Hi,

Building webkitgtk4 on macppc since 2.32 fails at the patching stage.

The powerpc specific patch has been upstreamed [0], so it's not needed
anymore. Also the ENABLE_GRAPHICS_CONTEXT_GL option is now
USE_OPENGL_OR_ES [1]

I needed an additional patch specific to archs where USE_OPENGL_OR_ES=OFF,
only powerpc for now, a recent commit breaks the build. See the patch
comment for more infos.

With the below diff, webkitgtk4 is built [3]. No REVISION bump is
needed since this version has never been built on powerpc and the
whole diff only impacts this arch.

As far as runtime goes, javascript runtime is mostly broken like it
used to be before 2.30. I tried to build it with OpenGL support,
but colors are still off.

Comments/feedback are welcome.

Charlène.


[0] https://trac.webkit.org/changeset/271220/webkit
[1] https://trac.webkit.org/changeset/273104/webkit
[2] https://trac.webkit.org/changeset/271171/webkit
[3] https://bin.charlenew.xyz/webkitgtk4.success.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/webkitgtk4/Makefile,v
retrieving revision 1.139
diff -u -p -u -p -r1.139 Makefile
--- Makefile 30 Mar 2021 14:52:14 -0000 1.139
+++ Makefile 31 Mar 2021 13:55:01 -0000
@@ -124,9 +124,8 @@ LDFLAGS += -Wl,--no-keep-memory

.if ${MACHINE_ARCH} == "powerpc"
# XXX fix colors being off, it would be nice to fix the code
-CONFIGURE_ARGS += -DENABLE_GRAPHICS_CONTEXT_GL=OFF
+CONFIGURE_ARGS += -DUSE_OPENGL_OR_ES=OFF
LDFLAGS += -Wl,--relax
-PATCH_LIST = patch-* powerpc-patch-*
.endif

post-extract:
Index: patches/patch-Source_WebKit_WebProcess_WebPage_CoordinatedGraphics_LayerTreeHost_h
===================================================================
RCS file: patches/patch-Source_WebKit_WebProcess_WebPage_CoordinatedGraphics_LayerTreeHost_h
diff -N patches/patch-Source_WebKit_WebProcess_WebPage_CoordinatedGraphics_LayerTreeHost_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_WebKit_WebProcess_WebPage_CoordinatedGraphics_LayerTreeHost_h 31 Mar 2021 13:55:01 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+
+Fix for:
+LayerTreeHost.h:216:28: error: out-of-line definition of 'forceRepaintAsync'
+does not match any declaration in 'WebKit::LayerTreeHost'
+LayerTreeHost.h:82:28: note: type of 1st parameter of member declaration does
+not match definition ('CompletionHandler<void ()> &&' vs
+'CompletionHandler<void ()> &')
+
+LayerTreeHost::forceRepaintAsync used to be a bool method, but is now void.
+It only impacts powerpc where OpenGL is disabled.
+
+That error has been introduced by:
+https://trac.webkit.org/changeset/271171/webkit/trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp
+
+Index: Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
+--- Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h.orig
++++ Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.h
+@@ -213,7 +213,7 @@ inline void LayerTreeHost::setRootCompositingLayer(Web
+ inline void LayerTreeHost::setViewOverlayRootLayer(WebCore::GraphicsLayer*) { }
+ inline void LayerTreeHost::scrollNonCompositedContents(const WebCore::IntRect&) { }
+ inline void LayerTreeHost::forceRepaint() { }
+-inline bool LayerTreeHost::forceRepaintAsync(CompletionHandler<void()>&) { return false; }
++inline void LayerTreeHost::forceRepaintAsync(CompletionHandler<void()>&&) { }
+ inline void LayerTreeHost::sizeDidChange(const WebCore::IntSize&) { }
+ inline void LayerTreeHost::pauseRendering() { }
+ inline void LayerTreeHost::resumeRendering() { }
Index: patches/powerpc-patch-Source_JavaScriptCore_llint_LowLevelInterpreter32_64_asm
===================================================================
RCS file: patches/powerpc-patch-Source_JavaScriptCore_llint_LowLevelInterpreter32_64_asm
diff -N patches/powerpc-patch-Source_JavaScriptCore_llint_LowLevelInterpreter32_64_asm
--- patches/powerpc-patch-Source_JavaScriptCore_llint_LowLevelInterpreter32_64_asm 11 Nov 2020 21:27:03 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,58 +0,0 @@
-$OpenBSD: powerpc-patch-Source_JavaScriptCore_llint_LowLevelInterpreter32_64_asm,v 1.1 2020/11/11 21:27:03 cwen Exp $
-
-Fix Javascript runtime on powerpc, from
-https://bugs.webkit.org/show_bug.cgi?id=211592
-
-Index: Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
---- Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm.orig
-+++ Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
-@@ -1552,13 +1552,21 @@ llintOpWithMetadata(op_put_by_id, OpPutById, macro (si
- loadp StructureChain::m_vector[t3], t3
- assert(macro (ok) btpnz t3, ok end)
-
-- loadp Structure::m_prototype[t2], t2
-+ if JSVALUE64
-+ loadp Structure::m_prototype[t2], t2
-+ else
-+ loadp Structure::m_prototype + PayloadOffset[t2], t2
-+ end
- btpz t2, .opPutByIdTransitionChainDone
- .opPutByIdTransitionChainLoop:
- loadp [t3], t1
- bineq t1, JSCell::m_structureID[t2], .opPutByIdSlow
- addp 4, t3
-- loadp Structure::m_prototype[t1], t2
-+ if JSVALUE64
-+ loadp Structure::m_prototype[t1], t2
-+ else
-+ loadp Structure::m_prototype + PayloadOffset[t1], t2
-+ end
- btpnz t2, .opPutByIdTransitionChainLoop
-
- .opPutByIdTransitionChainDone:
-@@ -2182,7 +2190,11 @@ end)
-
-
- op(llint_throw_from_slow_path_trampoline, macro()
-- loadp Callee[cfr], t1
-+ if JSVALUE64
-+ loadp Callee[cfr], t1
-+ else
-+ loadp Callee + PayloadOffset[cfr], t1
-+ end
- convertCalleeToVM(t1)
- copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(t1, t2)
-
-@@ -2191,7 +2203,11 @@ op(llint_throw_from_slow_path_trampoline, macro()
- # When throwing from the interpreter (i.e. throwing from LLIntSlowPaths), so
- # the throw target is not necessarily interpreted code, we come to here.
- # This essentially emulates the JIT's throwing protocol.
-- loadp Callee[cfr], t1
-+ if JSVALUE64
-+ loadp Callee[cfr], t1
-+ else
-+ loadp Callee + PayloadOffset[cfr], t1
-+ end
- convertCalleeToVM(t1)
- jmp VM::targetMachinePCForThrow[t1]
- end)

No comments:

Post a Comment