[gnome-build-meta/mcatanzaro/webkit2gtk-4.1: 3/4] webkitgtk.bst: disable bmalloc and JIT during build




commit 9ed7e11a724fbc3fb0c9cfad905656b385e7aabd
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Jun 18 10:21:49 2021 -0500

    webkitgtk.bst: disable bmalloc and JIT during build
    
    We recently upgraded our aarch64 CI runner, and now it is running
    CentOS. This is a problem because RHEL and CentOS on aarch64 use a 64 KB
    page size, unlike all other distros, which use 4 KB. The mismatch in
    expected page size between the container and the host is causing
    problems for gobject-introspection. gi-scanner runs during the build and
    calls every get_type() function, which winds up initializing WebKit and
    bmalloc. But bmalloc requires the system page size is 16 KB or less.
    
    The normal solution for this is to use the -DUSE_64KB_PAGE_BLOCK=ON
    option, which exists specifically to make WebKit not crash on aarch64
    CentOS and RHEL. It shouldn't be used elsewhere because (a) 64 KB page
    blocks are 16x bigger than the usual 4 KB page blocks, which is bad for
    performance and memory usage on embedded devices, and (b) disabling
    bmalloc causes all of WebKit's heap security features. So that would be
    a last resort.
    
    Fortunately, we only need to disable bmalloc during the build itself.
    The WebKitGTK that we've built will work just fine as long as it's not
    itself run on CentOS or RHEL.

 elements/sdk/webkitgtk.bst | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/elements/sdk/webkitgtk.bst b/elements/sdk/webkitgtk.bst
index eaef6b55..17aff998 100644
--- a/elements/sdk/webkitgtk.bst
+++ b/elements/sdk/webkitgtk.bst
@@ -61,6 +61,16 @@ variables:
     environment:
       CFLAGS: '%{flags_arm} -g1'
       CXXFLAGS: '%{flags_arm} -g1'
+# Our aarch64 CI runner uses CentOS, which uses 64 KB page sizes, but we do not
+# want to support large pages in WebKit as this requires disabling both JIT and
+# bmalloc, including all heap security features. As a workaround until the CI
+# runner is switched from CentOS to a more-compatible OS, we can disable these
+# features only during the build process, so that gobject-introspection does not
+# crash during the build.
+- arch == "aarch64":
+    environment:
+      JavaScriptCoreUseJIT: '0'
+      Malloc: '1'
 
 public:
   cpe:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]