summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-05-05 17:18:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-09 23:30:15 +0100
commit99445990caa21c7ad076fc086eb8a759f2a69aae (patch)
tree8a40b0c338dc6e2e6ad6ee9046c47cb289f2593a /meta
parent39932f22fa0710897c82e807e699beaf985b419a (diff)
downloadpoky-99445990caa21c7ad076fc086eb8a759f2a69aae.tar.gz
webkitgtk: update 2.30.6 -> 2.32.0
Drop 0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch (merged upstream). Rebase other patches. (From OE-Core rev: f64e9ba5f0d48e34d7022bf74bd9765f9e8a792c) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/0001-Enable-THREADS_PREFER_PTHREAD_FLAG.patch14
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch77
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/49a19c49c6de8af74e521f36cb43e6c1ec2e391c.patch155
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/include_xutil.patch18
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch24
-rw-r--r--meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch20
-rw-r--r--meta/recipes-sato/webkit/webkitgtk_2.32.0.bb (renamed from meta/recipes-sato/webkit/webkitgtk_2.30.6.bb)5
7 files changed, 210 insertions, 103 deletions
diff --git a/meta/recipes-sato/webkit/webkitgtk/0001-Enable-THREADS_PREFER_PTHREAD_FLAG.patch b/meta/recipes-sato/webkit/webkitgtk/0001-Enable-THREADS_PREFER_PTHREAD_FLAG.patch
index ca7b1bca48..fd062e0f74 100644
--- a/meta/recipes-sato/webkit/webkitgtk/0001-Enable-THREADS_PREFER_PTHREAD_FLAG.patch
+++ b/meta/recipes-sato/webkit/webkitgtk/0001-Enable-THREADS_PREFER_PTHREAD_FLAG.patch
@@ -1,4 +1,4 @@
1From b145ab4273c59f4f908cdaff9e267241bd970e93 Mon Sep 17 00:00:00 2001 1From 3ab2b8aa49c92a68610eef14be1fbf535109b0fb Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 3 Feb 2020 17:06:27 -0800 3Date: Mon, 3 Feb 2020 17:06:27 -0800
4Subject: [PATCH] Enable THREADS_PREFER_PTHREAD_FLAG 4Subject: [PATCH] Enable THREADS_PREFER_PTHREAD_FLAG
@@ -20,19 +20,19 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
20 2 files changed, 2 insertions(+) 20 2 files changed, 2 insertions(+)
21 21
22diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake 22diff --git a/Source/cmake/OptionsGTK.cmake b/Source/cmake/OptionsGTK.cmake
23index 8732e935..9b4fbae7 100644 23index 9eb44f1c..a24fdd0d 100644
24--- a/Source/cmake/OptionsGTK.cmake 24--- a/Source/cmake/OptionsGTK.cmake
25+++ b/Source/cmake/OptionsGTK.cmake 25+++ b/Source/cmake/OptionsGTK.cmake
26@@ -32,6 +32,7 @@ set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string") 26@@ -6,6 +6,7 @@ WEBKIT_OPTION_BEGIN()
27 if (USER_AGENT_BRANDING) 27 SET_PROJECT_VERSION(2 32 0)
28 add_definitions(-DUSER_AGENT_BRANDING="${USER_AGENT_BRANDING}") 28
29 endif () 29 set(USER_AGENT_BRANDING "" CACHE STRING "Branding to add to user agent string")
30+set(THREADS_PREFER_PTHREAD_FLAG ON) 30+set(THREADS_PREFER_PTHREAD_FLAG ON)
31 31
32 find_package(Cairo 1.14.0 REQUIRED) 32 find_package(Cairo 1.14.0 REQUIRED)
33 find_package(Fontconfig 2.8.0 REQUIRED) 33 find_package(Fontconfig 2.8.0 REQUIRED)
34diff --git a/Source/cmake/OptionsJSCOnly.cmake b/Source/cmake/OptionsJSCOnly.cmake 34diff --git a/Source/cmake/OptionsJSCOnly.cmake b/Source/cmake/OptionsJSCOnly.cmake
35index 316c6240..2f712602 100644 35index 10664400..d9aca95a 100644
36--- a/Source/cmake/OptionsJSCOnly.cmake 36--- a/Source/cmake/OptionsJSCOnly.cmake
37+++ b/Source/cmake/OptionsJSCOnly.cmake 37+++ b/Source/cmake/OptionsJSCOnly.cmake
38@@ -1,3 +1,4 @@ 38@@ -1,3 +1,4 @@
diff --git a/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch b/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch
deleted file mode 100644
index 68195f8464..0000000000
--- a/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch
+++ /dev/null
@@ -1,77 +0,0 @@
1From 40520b0de69d8ca8e659248f5ffe641f33cc6dee Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 Mar 2021 14:16:58 -0800
4Subject: [PATCH] Extend atomics check to include 1-byte CAS test
5
6Rename ATOMIC_INT64_REQUIRES_LIBATOMIC to ATOMICS_REQUIRE_LIBATOMIC so
7it can reflect broader range which is now checked
8
9Rename ATOMIC_INT64_IS_BUILTIN to ATOMICS_ARE_BUILTIN
10
11Upstream-Status: Accepted [https://bugs.webkit.org/attachment.cgi?bugid=222959]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 Source/JavaScriptCore/CMakeLists.txt | 2 +-
15 Source/WebKit/CMakeLists.txt | 2 +-
16 Source/cmake/WebKitCompilerFlags.cmake | 15 ++++++++++-----
17 3 files changed, 12 insertions(+), 7 deletions(-)
18
19--- a/Source/JavaScriptCore/CMakeLists.txt
20+++ b/Source/JavaScriptCore/CMakeLists.txt
21@@ -129,7 +129,7 @@ if (USE_CAPSTONE)
22 list(APPEND JavaScriptCore_LIBRARIES capstone)
23 endif ()
24
25-if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
26+if (ATOMICS_REQUIRE_LIBATOMIC)
27 list(APPEND JavaScriptCore_LIBRARIES atomic)
28 endif ()
29
30--- a/Source/WebKit/CMakeLists.txt
31+++ b/Source/WebKit/CMakeLists.txt
32@@ -337,7 +337,7 @@ if (USE_LIBWEBRTC)
33 list(APPEND WebKit_LIBRARIES webrtc)
34 endif ()
35
36-if (ATOMIC_INT64_REQUIRES_LIBATOMIC)
37+if (ATOMICS_REQUIRE_LIBATOMIC)
38 list(APPEND WebKit_PRIVATE_LIBRARIES atomic)
39 endif ()
40
41--- a/Source/cmake/WebKitCompilerFlags.cmake
42+++ b/Source/cmake/WebKitCompilerFlags.cmake
43@@ -280,12 +280,17 @@ endif ()
44 if (COMPILER_IS_GCC_OR_CLANG)
45 set(ATOMIC_TEST_SOURCE "
46 #include <atomic>
47- int main() { std::atomic<int64_t> i(0); i++; return 0; }
48+ int main() {
49+ std::atomic<int64_t> i(0);
50+ std::atomic<int8_t> j(0);
51+ i++; j++;
52+ return 0;
53+ }
54 ")
55- check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN)
56- if (NOT ATOMIC_INT64_IS_BUILTIN)
57+ check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_ARE_BUILTIN)
58+ if (NOT ATOMICS_ARE_BUILTIN)
59 set(CMAKE_REQUIRED_LIBRARIES atomic)
60- check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_REQUIRES_LIBATOMIC)
61+ check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_REQUIRE_LIBATOMIC)
62 unset(CMAKE_REQUIRED_LIBRARIES)
63 endif ()
64 endif ()
65--- a/Source/WTF/wtf/CMakeLists.txt
66+++ b/Source/WTF/wtf/CMakeLists.txt
67@@ -529,6 +529,10 @@ list(APPEND WTF_LIBRARIES
68 ICU::uc
69 )
70
71+if (ATOMICS_REQUIRE_LIBATOMIC)
72+ list(APPEND WTF_LIBRARIES atomic)
73+endif ()
74+
75 set(WTF_INTERFACE_LIBRARIES WTF)
76 set(WTF_INTERFACE_INCLUDE_DIRECTORIES ${WTF_FRAMEWORK_HEADERS_DIR})
77 set(WTF_INTERFACE_DEPENDENCIES WTF_CopyHeaders)
diff --git a/meta/recipes-sato/webkit/webkitgtk/49a19c49c6de8af74e521f36cb43e6c1ec2e391c.patch b/meta/recipes-sato/webkit/webkitgtk/49a19c49c6de8af74e521f36cb43e6c1ec2e391c.patch
new file mode 100644
index 0000000000..ef70361c55
--- /dev/null
+++ b/meta/recipes-sato/webkit/webkitgtk/49a19c49c6de8af74e521f36cb43e6c1ec2e391c.patch
@@ -0,0 +1,155 @@
1From 49a19c49c6de8af74e521f36cb43e6c1ec2e391c Mon Sep 17 00:00:00 2001
2From: Ross Kirsling <ross.kirsling@sony.com>
3Date: Tue, 13 Apr 2021 02:04:15 +0000
4Subject: [PATCH] ICU 69 deprecates ubrk_safeClone in favor of ubrk_clone
5 https://bugs.webkit.org/show_bug.cgi?id=224093
6
7Reviewed by Yusuke Suzuki.
8
9In a shining example of "disappointing library practices", ICU 69 deprecates ubrk_safeClone in favor of
10a new *draft* API ubrk_clone, meaning that no function with this functionality is exposed by default.
11
12This patch introduces a function cloneUBreakIterator to abstract over this change; however, since we need to:
13
14 1. confine the effects of disabling U_HIDE_DRAFT_API to a non-unified implementation file
15 2. still be able to include ubrk.h from IntlSegmenter.h to instantiate ICUDeleter<ubrk_close> (*not* `clone`!)
16
17...the new helper function is introduced in a *headerless* implementation file, IntlWorkaround.cpp.
18
19* JavaScriptCore.xcodeproj/project.pbxproj:
20* Sources.txt:
21* runtime/IntlSegmenter.cpp:
22(JSC::IntlSegmenter::segment const):
23* runtime/IntlSegmenter.h:
24* runtime/IntlSegments.cpp:
25(JSC::IntlSegments::createSegmentIterator):
26* runtime/IntlWorkaround.cpp: Added.
27(JSC::cloneUBreakIterator):
28
29
30Canonical link: https://commits.webkit.org/236421@main
31git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275856 268f45cc-cd09-0410-ab3c-d52691b4dbfc
32
33Upstream-Status: Backport
34Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
35---
36 Source/JavaScriptCore/ChangeLog | 27 ++++++++++
37 .../JavaScriptCore.xcodeproj/project.pbxproj | 16 +++---
38 Source/JavaScriptCore/Sources.txt | 1 +
39 .../JavaScriptCore/runtime/IntlSegmenter.cpp | 2 +-
40 Source/JavaScriptCore/runtime/IntlSegmenter.h | 4 ++
41 .../JavaScriptCore/runtime/IntlSegments.cpp | 2 +-
42 .../JavaScriptCore/runtime/IntlWorkaround.cpp | 53 +++++++++++++++++++
43 7 files changed, 97 insertions(+), 8 deletions(-)
44 create mode 100644 Source/JavaScriptCore/runtime/IntlWorkaround.cpp
45
46diff --git a/Source/JavaScriptCore/Sources.txt b/Source/JavaScriptCore/Sources.txt
47index 28b5b83632b9..b6492dfdcb75 100644
48--- a/Source/JavaScriptCore/Sources.txt
49+++ b/Source/JavaScriptCore/Sources.txt
50@@ -849,6 +849,7 @@ runtime/IntlSegmenterConstructor.cpp
51 runtime/IntlSegmenterPrototype.cpp
52 runtime/IntlSegments.cpp
53 runtime/IntlSegmentsPrototype.cpp
54+runtime/IntlWorkaround.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect to this file.
55 runtime/IteratorOperations.cpp
56 runtime/IteratorPrototype.cpp
57 runtime/JSArray.cpp
58diff --git a/Source/JavaScriptCore/runtime/IntlSegmenter.cpp b/Source/JavaScriptCore/runtime/IntlSegmenter.cpp
59index 2ad74f94bbe8..93c9b2032847 100644
60--- a/Source/JavaScriptCore/runtime/IntlSegmenter.cpp
61+++ b/Source/JavaScriptCore/runtime/IntlSegmenter.cpp
62@@ -125,7 +125,7 @@ JSValue IntlSegmenter::segment(JSGlobalObject* globalObject, JSValue stringValue
63 auto upconvertedCharacters = Box<Vector<UChar>>::create(string.charactersWithoutNullTermination());
64
65 UErrorCode status = U_ZERO_ERROR;
66- auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));
67+ auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status));
68 if (U_FAILURE(status)) {
69 throwTypeError(globalObject, scope, "failed to initialize Segments"_s);
70 return { };
71diff --git a/Source/JavaScriptCore/runtime/IntlSegmenter.h b/Source/JavaScriptCore/runtime/IntlSegmenter.h
72index cd0f426c4897..a5239575a9f3 100644
73--- a/Source/JavaScriptCore/runtime/IntlSegmenter.h
74+++ b/Source/JavaScriptCore/runtime/IntlSegmenter.h
75@@ -75,4 +75,8 @@ class IntlSegmenter final : public JSNonFinalObject {
76 Granularity m_granularity { Granularity::Grapheme };
77 };
78
79+// Abstraction to call ubrk_safeClone or ubrk_clone depending on ICU version.
80+// This is implemented in IntlWorkaround.cpp in order to confine draft API visibility.
81+UBreakIterator* cloneUBreakIterator(const UBreakIterator*, UErrorCode*);
82+
83 } // namespace JSC
84diff --git a/Source/JavaScriptCore/runtime/IntlSegments.cpp b/Source/JavaScriptCore/runtime/IntlSegments.cpp
85index b6aba32fb822..8b81791e4133 100644
86--- a/Source/JavaScriptCore/runtime/IntlSegments.cpp
87+++ b/Source/JavaScriptCore/runtime/IntlSegments.cpp
88@@ -100,7 +100,7 @@ JSObject* IntlSegments::createSegmentIterator(JSGlobalObject* globalObject)
89 auto scope = DECLARE_THROW_SCOPE(vm);
90
91 UErrorCode status = U_ZERO_ERROR;
92- auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));
93+ auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status));
94 if (U_FAILURE(status)) {
95 throwTypeError(globalObject, scope, "failed to initialize SegmentIterator"_s);
96 return nullptr;
97diff --git a/Source/JavaScriptCore/runtime/IntlWorkaround.cpp b/Source/JavaScriptCore/runtime/IntlWorkaround.cpp
98new file mode 100644
99index 000000000000..8d820857ec22
100--- /dev/null
101+++ b/Source/JavaScriptCore/runtime/IntlWorkaround.cpp
102@@ -0,0 +1,53 @@
103+/*
104+ * Copyright (C) 2021 Sony Interactive Entertainment Inc.
105+ *
106+ * Redistribution and use in source and binary forms, with or without
107+ * modification, are permitted provided that the following conditions
108+ * are met:
109+ * 1. Redistributions of source code must retain the above copyright
110+ * notice, this list of conditions and the following disclaimer.
111+ * 2. Redistributions in binary form must reproduce the above copyright
112+ * notice, this list of conditions and the following disclaimer in the
113+ * documentation and/or other materials provided with the distribution.
114+ *
115+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
116+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
117+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
118+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
119+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
120+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
121+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
122+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
123+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
124+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
125+ * THE POSSIBILITY OF SUCH DAMAGE.
126+ */
127+
128+#include "config.h"
129+
130+#include <unicode/uvernum.h>
131+
132+// ICU 69 introduces draft API ubrk_clone and deprecates ubrk_safeClone.
133+#if U_ICU_VERSION_MAJOR_NUM >= 69
134+#define HAVE_ICU_UBRK_CLONE 1
135+#endif
136+
137+#if defined(U_HIDE_DRAFT_API)
138+#undef U_HIDE_DRAFT_API
139+#endif
140+#include <unicode/ubrk.h>
141+
142+namespace JSC {
143+
144+UBreakIterator* cloneUBreakIterator(const UBreakIterator*, UErrorCode*);
145+
146+UBreakIterator* cloneUBreakIterator(const UBreakIterator* iterator, UErrorCode* status)
147+{
148+#if HAVE(ICU_UBRK_CLONE)
149+ return ubrk_clone(iterator, status);
150+#else
151+ return ubrk_safeClone(iterator, nullptr, nullptr, status);
152+#endif
153+}
154+
155+} // namespace JSC
diff --git a/meta/recipes-sato/webkit/webkitgtk/include_xutil.patch b/meta/recipes-sato/webkit/webkitgtk/include_xutil.patch
index f770b381ce..ffe1b74be3 100644
--- a/meta/recipes-sato/webkit/webkitgtk/include_xutil.patch
+++ b/meta/recipes-sato/webkit/webkitgtk/include_xutil.patch
@@ -1,3 +1,8 @@
1From d95f46e149226f634830e76cc1f4f8e3ee04ff5a Mon Sep 17 00:00:00 2001
2From: Martin Jansa <Martin.Jansa@gmail.com>
3Date: Fri, 6 Nov 2020 04:38:13 +0100
4Subject: [PATCH] webkitgtk: fix build with x11 enabled
5
1Since 6Since
2https://github.com/WebKit/webkit/commit/acd3f32cd43c363be032f93ede3aa10c4ee97fa4 7https://github.com/WebKit/webkit/commit/acd3f32cd43c363be032f93ede3aa10c4ee97fa4
3it uses XVisualInfo which is defined in Xutil.h 8it uses XVisualInfo which is defined in Xutil.h
@@ -11,9 +16,14 @@ webkitgtk-2.30.2/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp:132
11Upstream-Status: Pending 16Upstream-Status: Pending
12Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> 17Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
13 18
14diff -uNr webkitgtk-2.30.2.orig/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp webkitgtk-2.30.2/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp 19---
15--- webkitgtk-2.30.2.orig/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp 2020-08-12 09:17:55.000000000 +0000 20 Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp | 1 +
16+++ webkitgtk-2.30.2/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp 2020-11-06 03:11:40.379913528 +0000 21 1 file changed, 1 insertion(+)
22
23diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
24index 2d66b9cd..424fb5a1 100644
25--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
26+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
17@@ -30,6 +30,7 @@ 27@@ -30,6 +30,7 @@
18 28
19 #if PLATFORM(X11) 29 #if PLATFORM(X11)
@@ -21,4 +31,4 @@ diff -uNr webkitgtk-2.30.2.orig/Source/WebCore/platform/graphics/x11/PlatformDis
21+#include <X11/Xutil.h> 31+#include <X11/Xutil.h>
22 #include <X11/extensions/Xcomposite.h> 32 #include <X11/extensions/Xcomposite.h>
23 #if PLATFORM(GTK) 33 #if PLATFORM(GTK)
24 #include <X11/extensions/Xdamage.h> 34 #include <X11/Xutil.h>
diff --git a/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch b/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch
index 5033de4196..e4b5818358 100644
--- a/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch
+++ b/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch
@@ -1,4 +1,7 @@
1reduce thread stack and heap usage for javascriptcore on musl 1From 5c82d20a00749e9106db78cdd23a09609dd3511c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 17 Mar 2021 13:24:57 -0700
4Subject: [PATCH] reduce thread stack and heap usage for javascriptcore on musl
2 5
3default sizes for musl are smaller compared to glibc, this matches 6default sizes for musl are smaller compared to glibc, this matches
4to musl defaults, avoid stack overflow crashes in jscore 7to musl defaults, avoid stack overflow crashes in jscore
@@ -16,9 +19,16 @@ glibc in OE remains same
16Upstream-Status: Accepted 19Upstream-Status: Accepted
17Signed-off-by: Khem Raj <raj.khem@gmail.com> 20Signed-off-by: Khem Raj <raj.khem@gmail.com>
18 21
22---
23 Source/JavaScriptCore/runtime/OptionsList.h | 20 ++++++++++++++++----
24 Source/WTF/wtf/Threading.h | 4 ++++
25 2 files changed, 20 insertions(+), 4 deletions(-)
26
27diff --git a/Source/JavaScriptCore/runtime/OptionsList.h b/Source/JavaScriptCore/runtime/OptionsList.h
28index bc1cedb9..a6209742 100644
19--- a/Source/JavaScriptCore/runtime/OptionsList.h 29--- a/Source/JavaScriptCore/runtime/OptionsList.h
20+++ b/Source/JavaScriptCore/runtime/OptionsList.h 30+++ b/Source/JavaScriptCore/runtime/OptionsList.h
21@@ -75,6 +75,18 @@ constexpr bool enableWebAssemblyStreamin 31@@ -71,6 +71,18 @@ JS_EXPORT_PRIVATE bool canUseJITCage();
22 // On instantiation of the first VM instance, the Options will be write protected 32 // On instantiation of the first VM instance, the Options will be write protected
23 // and cannot be modified thereafter. 33 // and cannot be modified thereafter.
24 34
@@ -37,7 +47,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
37 #define FOR_EACH_JSC_OPTION(v) \ 47 #define FOR_EACH_JSC_OPTION(v) \
38 v(Bool, useKernTCSM, defaultTCSMValue(), Normal, "Note: this needs to go before other options since they depend on this value.") \ 48 v(Bool, useKernTCSM, defaultTCSMValue(), Normal, "Note: this needs to go before other options since they depend on this value.") \
39 v(Bool, validateOptions, false, Normal, "crashes if mis-typed JSC options were passed to the VM") \ 49 v(Bool, validateOptions, false, Normal, "crashes if mis-typed JSC options were passed to the VM") \
40@@ -90,9 +102,9 @@ constexpr bool enableWebAssemblyStreamin 50@@ -86,9 +98,9 @@ JS_EXPORT_PRIVATE bool canUseJITCage();
41 \ 51 \
42 v(Bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \ 52 v(Bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \
43 \ 53 \
@@ -50,7 +60,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
50 \ 60 \
51 v(Bool, crashOnDisallowedVMEntry, ASSERT_ENABLED, Normal, "Forces a crash if we attempt to enter the VM when disallowed") \ 61 v(Bool, crashOnDisallowedVMEntry, ASSERT_ENABLED, Normal, "Forces a crash if we attempt to enter the VM when disallowed") \
52 v(Bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \ 62 v(Bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \
53@@ -601,7 +613,7 @@ public: 63@@ -608,7 +620,7 @@ public:
54 bool init(const char*); 64 bool init(const char*);
55 bool isInRange(unsigned); 65 bool isInRange(unsigned);
56 const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; } 66 const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; }
@@ -59,10 +69,12 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
59 void dump(PrintStream& out) const; 69 void dump(PrintStream& out) const;
60 70
61 private: 71 private:
72diff --git a/Source/WTF/wtf/Threading.h b/Source/WTF/wtf/Threading.h
73index 9495d6c1..190b3811 100644
62--- a/Source/WTF/wtf/Threading.h 74--- a/Source/WTF/wtf/Threading.h
63+++ b/Source/WTF/wtf/Threading.h 75+++ b/Source/WTF/wtf/Threading.h
64@@ -56,6 +56,10 @@ 76@@ -60,6 +60,10 @@
65 #include <array> 77 #include <dispatch/dispatch.h>
66 #endif 78 #endif
67 79
68+#if OS(LINUX) && !defined(__GLIBC__) 80+#if OS(LINUX) && !defined(__GLIBC__)
diff --git a/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch b/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch
index 0493150a91..aa11c131d2 100644
--- a/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch
+++ b/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch
@@ -1,22 +1,28 @@
1From ec6045fcf5a46123b54029a675d08d89a5e30f21 Mon Sep 17 00:00:00 2001
1From: Alberto Garcia <berto@igalia.com> 2From: Alberto Garcia <berto@igalia.com>
2Subject: Reduce memory usage when not using the Gold linker 3Date: Sun, 25 Apr 2021 18:45:13 +0000
3Bug-Debian: https://bugs.debian.org/949621 4Subject: [PATCH] Reduce memory usage when not using the Gold linker
4Forwarded: no
5 5
6Upstream-Status: Pending 6Upstream-Status: Pending
7Signed-off-by: Khem Raj <raj.khem@gmail.com> 7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9---
10 Source/cmake/OptionsCommon.cmake | 5 +++++
11 1 file changed, 5 insertions(+)
12
13diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake
14index dd4da682..71ad6106 100644
8--- a/Source/cmake/OptionsCommon.cmake 15--- a/Source/cmake/OptionsCommon.cmake
9+++ b/Source/cmake/OptionsCommon.cmake 16+++ b/Source/cmake/OptionsCommon.cmake
10@@ -95,6 +95,12 @@ option(GCC_OFFLINEASM_SOURCE_MAP 17@@ -101,6 +101,11 @@ option(GCC_OFFLINEASM_SOURCE_MAP
11 "Produce debug line information for offlineasm-generated code"
12 ${GCC_OFFLINEASM_SOURCE_MAP_DEFAULT}) 18 ${GCC_OFFLINEASM_SOURCE_MAP_DEFAULT})
13 19
20 option(USE_APPLE_ICU "Use Apple's internal ICU" ${APPLE})
14+# Pass --reduce-memory-overheads to the bfd linker in order to save memory 21+# Pass --reduce-memory-overheads to the bfd linker in order to save memory
15+if (NOT USE_LD_GOLD) 22+if (NOT USE_LD_GOLD)
16+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") 23+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads")
17+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") 24+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads")
18+endif () 25+endif ()
19+ 26
20 # Enable the usage of OpenMP. 27 # Enable the usage of OpenMP.
21 # - At this moment, OpenMP is only used as an alternative implementation 28 # - At this moment, OpenMP is only used as an alternative implementation
22 # to native threads for the parallelization of the SVG filters.
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.30.6.bb b/meta/recipes-sato/webkit/webkitgtk_2.32.0.bb
index 7d0d0fc16f..8a07fadd9b 100644
--- a/meta/recipes-sato/webkit/webkitgtk_2.30.6.bb
+++ b/meta/recipes-sato/webkit/webkitgtk_2.32.0.bb
@@ -18,12 +18,12 @@ SRC_URI = "https://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
18 file://0001-Fix-build-with-musl.patch \ 18 file://0001-Fix-build-with-musl.patch \
19 file://include_xutil.patch \ 19 file://include_xutil.patch \
20 file://reduce-memory-overheads.patch \ 20 file://reduce-memory-overheads.patch \
21 file://0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch \
22 file://musl-lower-stack-usage.patch \ 21 file://musl-lower-stack-usage.patch \
23 file://0001-MiniBrowser-Fix-reproduciblity.patch \ 22 file://0001-MiniBrowser-Fix-reproduciblity.patch \
23 file://49a19c49c6de8af74e521f36cb43e6c1ec2e391c.patch \
24 " 24 "
25 25
26SRC_URI[sha256sum] = "50736ec7a91770b5939d715196e5fe7209b93efcdeef425b24dc51fb8e9d7c1e" 26SRC_URI[sha256sum] = "9d7df4dae9ada2394257565acc2a68ace9308c4c61c3fcc00111dc1f11076bf0"
27 27
28inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gtk-doc 28inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gtk-doc
29 29
@@ -76,6 +76,7 @@ EXTRA_OECMAKE = " \
76 -DENABLE_MINIBROWSER=ON \ 76 -DENABLE_MINIBROWSER=ON \
77 -DPYTHON_EXECUTABLE=`which python3` \ 77 -DPYTHON_EXECUTABLE=`which python3` \
78 -DENABLE_BUBBLEWRAP_SANDBOX=OFF \ 78 -DENABLE_BUBBLEWRAP_SANDBOX=OFF \
79 -DENABLE_GAMEPAD=OFF \
79 " 80 "
80 81
81# Javascript JIT is not supported on ARC 82# Javascript JIT is not supported on ARC