Skip to contentSkip to conversation

webkitgtk3: fix build failure with DEBUG_BUILD enabled

PATCH Superseded [email protected] 1 participant 2 messages Sep 18, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 webkitgtk3: fix build failure with DEBUG_BUILD enabled

From: Jiaying Song <[email protected]>

It fails to compile webkitgtk when debug build enabled:

| /path_to//tmp/work/core2-64-poky-linux/webkitgtk3/2.48.1/webkitgtk-2.48.1/Source/bmalloc/libpas/src/libpas/bmalloc_heap_config.h:82:36:
error: inlining failed in call to 'always_inline' 'pas_page_base* bmalloc_heap_config_page_header(uintptr_t)':
function not considered for inlining

|    82 | PAS_BASIC_HEAP_CONFIG_DECLARATIONS(bmalloc, BMALLOC);
|       |

Add a cmake variable WEBKIT_NO_INLINE_HINTS to disable gcc function attribute always_inline when debug build is enabled.

And adjust indent as well.

---
 ...uild-failure-with-DEBUG_BUILD-enable.patch | 129 ++++++++++++++++++
 ...o_configure-error-on-beaglebone-yoct.patch |  53 +++++++
 ...able-to-control-macro-__PAS_ALWAYS_I.patch |  74 ++++++++++
 .../webkitgtk/webkitgtk3_2.48.1.bb            |   4 +-
 4 files changed, 259 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/webkitgtk/0001-webkitgtk3-fix-build-failure-with-DEBUG_BUILD-enable.patch
 create mode 100644 meta-oe/recipes-support/webkitgtk/0002-webkitgtk3-fix-do_configure-error-on-beaglebone-yoct.patch
 create mode 100644 meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch
meta-oe/recipes-support/webkitgtk/0001-webkitgtk3-fix-build-failure-with-DEBUG_BUILD-enable.patch new file +129 -0
new file mode 100644
index 0000000000..d5c22f9621
@@ -0,0 +1,129 @@
+From 48c9ac56f9df4e3f31e4712dd5a305ec7afb9403 Mon Sep 17 00:00:00 2001
+From: Jiaying Song <[email protected]>
+Date: Thu, 18 Sep 2025 11:17:56 +0800
+Subject: [meta-oe][walnascar][PATCH 1/2] webkitgtk3: fix build failure with DEBUG_BUILD enabled
+
+It fails to compile webkitgtk when debug build enabled:
+
+| /path_to//tmp/work/core2-64-poky-linux/webkitgtk3/2.48.1/webkitgtk-2.48.1/Source/bmalloc/libpas/src/libpas/bmalloc_heap_config.h:82:36:
+  error: inlining failed in call to 'always_inline' 'pas_page_base* bmalloc_heap_config_page_header(uintptr_t)':
+  function not considered for inlining
+|    82 | PAS_BASIC_HEAP_CONFIG_DECLARATIONS(bmalloc, BMALLOC);
+|       |
+
+Add a cmake variable WEBKIT_NO_INLINE_HINTS to disable gcc function attribute `always_inline` when debug build is enabled.
+
+And adjust indent as well.
+
+Signed-off-by: Jiaying Song <[email protected]>
+---
+ ...able-to-control-macro-__PAS_ALWAYS_I.patch | 74 +++++++++++++++++++
+ .../webkitgtk/webkitgtk3_2.48.1.bb            |  4 +-
+ 2 files changed, 77 insertions(+), 1 deletion(-)
+ create mode 100644 meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch
+
+diff --git a/meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch b/meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch
+new file mode 100644
+index 0000000000..b1139b857e
+--- /dev/null
++++ b/meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch
+@@ -0,0 +1,74 @@
++From bbf661310448d430350eb2ad8c5869ace648dcf8 Mon Sep 17 00:00:00 2001
++From: Kai Kang <[email protected]>
++Date: Fri, 11 Aug 2023 14:20:48 +0800
++Subject: [PATCH] Add a variable to control macro
++ __PAS_ALWAYS_INLINE_BUT_NOT_INLINE
++ https://bugs.webkit.org/show_bug.cgi?id=260065
++
++Reviewed by NOBODY (OOPS!).
++
++It fails to compile webkitgtk with option `-Og` of gcc/g++:
++
++| In file included from Source/bmalloc/libpas/src/libpas/pas_heap_page_provider.h:30,
++|                  from Source/bmalloc/libpas/src/libpas/pas_bootstrap_heap_page_provider.h:29,
++|                  from Source/bmalloc/libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.h:29,
++|                  from Source/bmalloc/libpas/src/libpas/pas_basic_heap_page_caches.h:29,
++|                  from Source/bmalloc/libpas/src/libpas/pas_heap_config_utils.h:32,
++|                  from Source/bmalloc/libpas/src/libpas/bmalloc_heap_config.h:34,
++|                  from Source/bmalloc/libpas/src/libpas/bmalloc_heap_inlines.h:34,
++|                  from Source/bmalloc/bmalloc/bmalloc.h:39,
++|                  from Source/bmalloc/bmalloc/bmalloc.cpp:26:
++| In function 'pas_allocation_result pas_local_allocator_try_allocate(pas_local_allocator*, size_t, size_t, pas_heap_config, pas_allocator_counts*, pas_allocation_result_filter)',
++|     inlined from 'pas_allocation_result pas_try_allocate_common_impl_fast(pas_heap_config, pas_allocator_counts*, pas_allocation_result_filter, pas_local_allocator*, size_t, size_t)' at webkitgtk-2.40.2/Source/bmalloc/libpas/src/libpas/pas_try_allocate_common.h:85:46,
++|     inlined from 'pas_allocation_result bmalloc_try_allocate_with_alignment_impl_impl_fast(pas_local_allocator*, size_t, size_t)' at webkitgtk-2.40.2/Source/bmalloc/libpas/src/libpas/bmalloc_heap_inlines.h:59:1,
++|     inlined from 'pas_allocation_result pas_try_allocate_intrinsic_impl_casual_case(__pas_heap*, size_t, size_t, pas_intrinsic_heap_support*, pas_heap_config, pas_try_allocate_common_fast, pas_try_allocate_common_slow, pas_intrinsic_heap_designation_mode)' at webkitgtk-2.40.2/Source/bmalloc/libpas/src/libpas/pas_try_allocate_intrinsic.h:167:44,
++|     inlined from 'pas_allocation_result bmalloc_try_allocate_with_alignment_impl_casual_case(size_t, size_t)' at webkitgtk-2.40.2/Source/bmalloc/libpas/src/libpas/bmalloc_heap_inlines.h:59:1:
++| webkitgtk-2.40.2/Source/bmalloc/libpas/src/libpas/pas_allocation_result.h:76:1: error: inlining failed in call to 'always_inline' 'pas_allocation_result pas_allocation_result_identity(pas_allocation_result)': function not considered for inlining
++|    76 | pas_allocation_result_identity(pas_allocation_result result)
++|       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++
++Add an variable `WEBKIT_NO_INLINE_HINTS` to control macro
++__PAS_ALWAYS_INLINE_BUT_NOT_INLINE whether includes function attribute
++`always_inline`. It could set the variable to make compilation pass when
++gcc option `-Og` is used.
++
++* Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h:
++* Source/cmake/WebKitCompilerFlags.cmake:
++
++Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/16601]
++
++Signed-off-by: Kai Kang <[email protected]>
++Signed-off-by: Jiaying Song <[email protected]>
++---
++ Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h | 2 +-
++ Source/cmake/WebKitCompilerFlags.cmake              | 7 +++++++
++ 2 files changed, 8 insertions(+), 1 deletion(-)
++
++diff --git a/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h b/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
++index 5d5fb38c..a554f700 100644
++--- a/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
+++++ b/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
++@@ -44,7 +44,7 @@ __PAS_BEGIN_EXTERN_C;
++ #define __SUSPICIOUS__
++ #define __BROKEN__
++ 
++-#ifdef __OPTIMIZE__
+++#if defined(__OPTIMIZE__) && !defined(WEBKIT_NO_INLINE_HINTS)
++ #define __PAS_ALWAYS_INLINE_BUT_NOT_INLINE __attribute__((__always_inline__))
++ #else
++ #define __PAS_ALWAYS_INLINE_BUT_NOT_INLINE
++diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake
++index f5ec0a55..dfd741e7 100644
++--- a/Source/cmake/WebKitCompilerFlags.cmake
+++++ b/Source/cmake/WebKitCompilerFlags.cmake
++@@ -503,3 +503,10 @@ endif ()
++ 
++ # FIXME: Enable pre-compiled headers for all ports <https://webkit.org/b/139438>
++ set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON)
+++
+++# It fails to compile with `gcc -Og`
+++set(WEBKIT_NO_INLINE_HINTS OFF CACHE BOOL "Disable funtion attribute always_inline for WebKit")
+++
+++if (WEBKIT_NO_INLINE_HINTS)
+++    add_definitions(-DWEBKIT_NO_INLINE_HINTS)
+++endif ()
+diff --git a/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb b/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb
+index b03ed3cbb9..c3d2169102 100644
+--- a/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb
++++ b/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb
+@@ -21,6 +21,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz \
+            file://0001-Fix-build-errors-on-RISCV-https-bugs.webkit.org-show.patch \
+            file://fix-typo-denormaldisabler.patch \
+            file://fix-ftbfs-riscv64.patch \
++           file://0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch \
+            "
+ SRC_URI[sha256sum] = "98efdf21c4cdca0fe0b73ab5a8cb52093b5aa52d9b1b016a93f71dbfa1eb258f"
+ 
+@@ -99,7 +100,8 @@ EXTRA_OECMAKE = " \
+ 	-DUSE_GTK4=OFF \
+ 	${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
+ 	${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \
+-	-DENABLE_MINIBROWSER=ON \
++	${@oe.utils.vartrue('DEBUG_BUILD', '-DWEBKIT_NO_INLINE_HINTS=ON', '-DWEBKIT_NO_INLINE_HINTS=OFFF', d)} \
++        -DENABLE_MINIBROWSER=ON \
+ 	-DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
+ 		"
+ # pass -g1 to massively reduce the size of the debug symbols (4.3GB to 700M at time of writing)
+-- 
+2.34.1
+
meta-oe/recipes-support/webkitgtk/0002-webkitgtk3-fix-do_configure-error-on-beaglebone-yoct.patch new file +53 -0

53 lines not on this page · raw message

meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch new file +74 -0

74 lines not on this page · raw message

meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb +3 -1
index b03ed3cbb9..9f44dfa924 100644
@@ -21,6 +21,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz \
            file://0001-Fix-build-errors-on-RISCV-https-bugs.webkit.org-show.patch \
            file://fix-typo-denormaldisabler.patch \
            file://fix-ftbfs-riscv64.patch \
+           file://0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch \
            "
 SRC_URI[sha256sum] = "98efdf21c4cdca0fe0b73ab5a8cb52093b5aa52d9b1b016a93f71dbfa1eb258f"
 
@@ -99,7 +100,8 @@ EXTRA_OECMAKE = " \
 	-DUSE_GTK4=OFF \
 	${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
 	${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \
-	-DENABLE_MINIBROWSER=ON \
+	${@oe.utils.vartrue('DEBUG_BUILD', '-DWEBKIT_NO_INLINE_HINTS=ON', '-DWEBKIT_NO_INLINE_HINTS=OFF', d)} \
+        -DENABLE_MINIBROWSER=ON \
 	-DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
 		"
 # pass -g1 to massively reduce the size of the debug symbols (4.3GB to 700M at time of writing)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 2/2 webkitgtk3: fix do_configure error on beaglebone-yocto

From: Jiaying Song <[email protected]>

* According to latest comment [1] and the mentioned pull request [2], build an ENABLE(WEBASSEMBLY) && !ENABLE(JIT) configuration is supported, so original issue already fixed in current version, the EXTRA_OECMAKE setting is not needed anymore.

* This EXTRA_OECMAKE setting causes following configure error on beaglebone-yocto, remove the setting to let the configure process decide the configuration:
CMake Error at Source/cmake/WebKitFeatures.cmake:312 (message):
ENABLE_JIT conflicts with ENABLE_C_LOOP.You must disable one or the other.

[YOCTO #15254]

[1] https://github.com/WebKit/WebKit/pull/17447
[2] https://github.com/WebKit/WebKit/pull/17688

---
 .../recipes-support/webkitgtk/webkitgtk3_2.48.1.bb   | 12 ------------
 1 file changed, 12 deletions(-)
meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.1.bb +0 -12
index 9f44dfa924..c4347bb136 100644
@@ -126,18 +126,6 @@ EXTRA_OECMAKE:append:armv4 = " -DENABLE_JIT=OFF "
 EXTRA_OECMAKE:append:armv5 = " -DENABLE_JIT=OFF "
 EXTRA_OECMAKE:append:armv6 = " -DENABLE_JIT=OFF "
 
-# And for armv7* don't enable it for softfp, because after:
-# https://github.com/WebKit/WebKit/commit/a2ec4ef1997d6fafa6ffc607bffb54e76168a918
-# https://bugs.webkit.org/show_bug.cgi?id=242172
-# softfp armv7* fails because WEBASSEMBLY is left enabled by default and JIT gets
-# explicitly disabled causing:
-# http://errors.yoctoproject.org/Errors/Details/734587/
-# PR was sent upstream, but the end result is the same both JIT and WEBASSEMBLY disabled
-# https://github.com/WebKit/WebKit/pull/17447
-EXTRA_OECMAKE:append:armv7a = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
-EXTRA_OECMAKE:append:armv7r = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
-EXTRA_OECMAKE:append:armv7ve = " -DENABLE_JIT=${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', 'ON', 'OFF', d)}"
-
 # JIT does not work on RISCV
 EXTRA_OECMAKE:append:riscv32 = " -DENABLE_JIT=OFF"
 
Signature · 1 line
2.34.1