summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/webkitgtk/webkitgtk3/0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch74
-rw-r--r--meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.3.bb2
2 files changed, 76 insertions, 0 deletions
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 @@
1From bbf661310448d430350eb2ad8c5869ace648dcf8 Mon Sep 17 00:00:00 2001
2From: Kai Kang <kai.kang@windriver.com>
3Date: Fri, 11 Aug 2023 14:20:48 +0800
4Subject: [PATCH] Add a variable to control macro
5 __PAS_ALWAYS_INLINE_BUT_NOT_INLINE
6 https://bugs.webkit.org/show_bug.cgi?id=260065
7
8Reviewed by NOBODY (OOPS!).
9
10It fails to compile webkitgtk with option `-Og` of gcc/g++:
11
12| In file included from Source/bmalloc/libpas/src/libpas/pas_heap_page_provider.h:30,
13| from Source/bmalloc/libpas/src/libpas/pas_bootstrap_heap_page_provider.h:29,
14| from Source/bmalloc/libpas/src/libpas/pas_large_heap_physical_page_sharing_cache.h:29,
15| from Source/bmalloc/libpas/src/libpas/pas_basic_heap_page_caches.h:29,
16| from Source/bmalloc/libpas/src/libpas/pas_heap_config_utils.h:32,
17| from Source/bmalloc/libpas/src/libpas/bmalloc_heap_config.h:34,
18| from Source/bmalloc/libpas/src/libpas/bmalloc_heap_inlines.h:34,
19| from Source/bmalloc/bmalloc/bmalloc.h:39,
20| from Source/bmalloc/bmalloc/bmalloc.cpp:26:
21| 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)',
22| 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,
23| 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,
24| 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,
25| 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:
26| 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
27| 76 | pas_allocation_result_identity(pas_allocation_result result)
28| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
30Add an variable `WEBKIT_NO_INLINE_HINTS` to control macro
31__PAS_ALWAYS_INLINE_BUT_NOT_INLINE whether includes function attribute
32`always_inline`. It could set the variable to make compilation pass when
33gcc option `-Og` is used.
34
35* Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h:
36* Source/cmake/WebKitCompilerFlags.cmake:
37
38Upstream-Status: Submitted [https://github.com/WebKit/WebKit/pull/16601]
39
40Signed-off-by: Kai Kang <kai.kang@windriver.com>
41Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
42---
43 Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h | 2 +-
44 Source/cmake/WebKitCompilerFlags.cmake | 7 +++++++
45 2 files changed, 8 insertions(+), 1 deletion(-)
46
47diff --git a/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h b/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
48index 5d5fb38c..a554f700 100644
49--- a/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
50+++ b/Source/bmalloc/libpas/src/libpas/pas_utils_prefix.h
51@@ -44,7 +44,7 @@ __PAS_BEGIN_EXTERN_C;
52 #define __SUSPICIOUS__
53 #define __BROKEN__
54
55-#ifdef __OPTIMIZE__
56+#if defined(__OPTIMIZE__) && !defined(WEBKIT_NO_INLINE_HINTS)
57 #define __PAS_ALWAYS_INLINE_BUT_NOT_INLINE __attribute__((__always_inline__))
58 #else
59 #define __PAS_ALWAYS_INLINE_BUT_NOT_INLINE
60diff --git a/Source/cmake/WebKitCompilerFlags.cmake b/Source/cmake/WebKitCompilerFlags.cmake
61index f5ec0a55..dfd741e7 100644
62--- a/Source/cmake/WebKitCompilerFlags.cmake
63+++ b/Source/cmake/WebKitCompilerFlags.cmake
64@@ -503,3 +503,10 @@ endif ()
65
66 # FIXME: Enable pre-compiled headers for all ports <https://webkit.org/b/139438>
67 set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON)
68+
69+# It fails to compile with `gcc -Og`
70+set(WEBKIT_NO_INLINE_HINTS OFF CACHE BOOL "Disable funtion attribute always_inline for WebKit")
71+
72+if (WEBKIT_NO_INLINE_HINTS)
73+ add_definitions(-DWEBKIT_NO_INLINE_HINTS)
74+endif ()
diff --git a/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.3.bb b/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.3.bb
index aa82831b81..b4f7518620 100644
--- a/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.3.bb
+++ b/meta-oe/recipes-support/webkitgtk/webkitgtk3_2.48.3.bb
@@ -20,6 +20,7 @@ SRC_URI = "https://www.webkitgtk.org/releases/webkitgtk-${PV}.tar.xz \
20 file://sys_futex.patch \ 20 file://sys_futex.patch \
21 file://0001-Fix-build-errors-on-RISCV-https-bugs.webkit.org-show.patch \ 21 file://0001-Fix-build-errors-on-RISCV-https-bugs.webkit.org-show.patch \
22 file://fix-ftbfs-riscv64.patch \ 22 file://fix-ftbfs-riscv64.patch \
23 file://0001-CMake-Add-a-variable-to-control-macro-__PAS_ALWAYS_I.patch \
23 " 24 "
24SRC_URI[sha256sum] = "d4dc5970f0fc6a529ff7fd67bcbfab2bbb5e91be789b2e9279640b3217a782c3" 25SRC_URI[sha256sum] = "d4dc5970f0fc6a529ff7fd67bcbfab2bbb5e91be789b2e9279640b3217a782c3"
25 26
@@ -98,6 +99,7 @@ EXTRA_OECMAKE = " \
98 -DUSE_GTK4=OFF \ 99 -DUSE_GTK4=OFF \
99 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \ 100 ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
100 ${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \ 101 ${@bb.utils.contains('GIDOCGEN_ENABLED', 'True', '-DENABLE_DOCUMENTATION=ON', '-DENABLE_DOCUMENTATION=OFF', d)} \
102 ${@oe.utils.vartrue('DEBUG_BUILD', '-DWEBKIT_NO_INLINE_HINTS=ON', '-DWEBKIT_NO_INLINE_HINTS=OFFF', d)} \
101 -DENABLE_MINIBROWSER=ON \ 103 -DENABLE_MINIBROWSER=ON \
102 -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \ 104 -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
103 " 105 "