diff options
Diffstat (limited to 'poky/meta/recipes-sato')
5 files changed, 204 insertions, 11 deletions
diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch new file mode 100644 index 0000000000..93bda4d754 --- /dev/null +++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch @@ -0,0 +1,77 @@ +From 40520b0de69d8ca8e659248f5ffe641f33cc6dee Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Tue, 9 Mar 2021 14:16:58 -0800 +Subject: [PATCH] Extend atomics check to include 1-byte CAS test + +Rename ATOMIC_INT64_REQUIRES_LIBATOMIC to ATOMICS_REQUIRE_LIBATOMIC so +it can reflect broader range which is now checked + +Rename ATOMIC_INT64_IS_BUILTIN to ATOMICS_ARE_BUILTIN + +Upstream-Status: Submitted [https://bugs.webkit.org/attachment.cgi?bugid=222959] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Source/JavaScriptCore/CMakeLists.txt | 2 +- + Source/WebKit/CMakeLists.txt | 2 +- + Source/cmake/WebKitCompilerFlags.cmake | 15 ++++++++++----- + 3 files changed, 12 insertions(+), 7 deletions(-) + +--- a/Source/JavaScriptCore/CMakeLists.txt ++++ b/Source/JavaScriptCore/CMakeLists.txt +@@ -129,7 +129,7 @@ if (USE_CAPSTONE) + list(APPEND JavaScriptCore_LIBRARIES capstone) + endif () + +-if (ATOMIC_INT64_REQUIRES_LIBATOMIC) ++if (ATOMICS_REQUIRE_LIBATOMIC) + list(APPEND JavaScriptCore_LIBRARIES atomic) + endif () + +--- a/Source/WebKit/CMakeLists.txt ++++ b/Source/WebKit/CMakeLists.txt +@@ -337,7 +337,7 @@ if (USE_LIBWEBRTC) + list(APPEND WebKit_LIBRARIES webrtc) + endif () + +-if (ATOMIC_INT64_REQUIRES_LIBATOMIC) ++if (ATOMICS_REQUIRE_LIBATOMIC) + list(APPEND WebKit_PRIVATE_LIBRARIES atomic) + endif () + +--- a/Source/cmake/WebKitCompilerFlags.cmake ++++ b/Source/cmake/WebKitCompilerFlags.cmake +@@ -280,12 +280,17 @@ endif () + if (COMPILER_IS_GCC_OR_CLANG) + set(ATOMIC_TEST_SOURCE " + #include <atomic> +- int main() { std::atomic<int64_t> i(0); i++; return 0; } ++ int main() { ++ std::atomic<int64_t> i(0); ++ std::atomic<int8_t> j(0); ++ i++; j++; ++ return 0; ++ } + ") +- check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_IS_BUILTIN) +- if (NOT ATOMIC_INT64_IS_BUILTIN) ++ check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_ARE_BUILTIN) ++ if (NOT ATOMICS_ARE_BUILTIN) + set(CMAKE_REQUIRED_LIBRARIES atomic) +- check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMIC_INT64_REQUIRES_LIBATOMIC) ++ check_cxx_source_compiles("${ATOMIC_TEST_SOURCE}" ATOMICS_REQUIRE_LIBATOMIC) + unset(CMAKE_REQUIRED_LIBRARIES) + endif () + endif () +--- a/Source/WTF/wtf/CMakeLists.txt ++++ b/Source/WTF/wtf/CMakeLists.txt +@@ -529,6 +529,10 @@ list(APPEND WTF_LIBRARIES + ICU::uc + ) + ++if (ATOMICS_REQUIRE_LIBATOMIC) ++ list(APPEND WTF_LIBRARIES atomic) ++endif () ++ + set(WTF_INTERFACE_LIBRARIES WTF) + set(WTF_INTERFACE_INCLUDE_DIRECTORIES ${WTF_FRAMEWORK_HEADERS_DIR}) + set(WTF_INTERFACE_DEPENDENCIES WTF_CopyHeaders) diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch index 6dcb52956c..a13b394fd9 100644 --- a/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch +++ b/poky/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-musl.patch @@ -11,11 +11,9 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Source/WTF/wtf/PlatformHave.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) -diff --git a/Source/JavaScriptCore/runtime/MachineContext.h b/Source/JavaScriptCore/runtime/MachineContext.h -index c5052527..95ef98b5 100644 --- a/Source/JavaScriptCore/runtime/MachineContext.h +++ b/Source/JavaScriptCore/runtime/MachineContext.h -@@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mcontext_t& machineContext) +@@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mc #error Unknown Architecture #endif @@ -24,7 +22,7 @@ index c5052527..95ef98b5 100644 #if CPU(X86) return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]); -@@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mcontext_t& machineContext) +@@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mc #error Unknown Architecture #endif @@ -33,7 +31,7 @@ index c5052527..95ef98b5 100644 // The following sequence depends on glibc's sys/ucontext.h. #if CPU(X86) -@@ -498,7 +498,7 @@ static inline void*& instructionPointerImpl(mcontext_t& machineContext) +@@ -498,7 +498,7 @@ static inline void*& instructionPointerI #error Unknown Architecture #endif @@ -42,7 +40,7 @@ index c5052527..95ef98b5 100644 // The following sequence depends on glibc's sys/ucontext.h. #if CPU(X86) -@@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext) +@@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontex #error Unknown Architecture #endif @@ -51,7 +49,7 @@ index c5052527..95ef98b5 100644 // The following sequence depends on glibc's sys/ucontext.h. #if CPU(X86) -@@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext) +@@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mc #error Unknown Architecture #endif @@ -60,11 +58,9 @@ index c5052527..95ef98b5 100644 // The following sequence depends on glibc's sys/ucontext.h. #if CPU(X86) -diff --git a/Source/WTF/wtf/PlatformHave.h b/Source/WTF/wtf/PlatformHave.h -index daca20fe..53eae6ba 100644 --- a/Source/WTF/wtf/PlatformHave.h +++ b/Source/WTF/wtf/PlatformHave.h -@@ -222,7 +222,7 @@ +@@ -202,7 +202,7 @@ #define HAVE_HOSTED_CORE_ANIMATION 1 #endif @@ -73,3 +69,23 @@ index daca20fe..53eae6ba 100644 #define HAVE_MACHINE_CONTEXT 1 #endif +--- a/Source/WebCore/xml/XPathGrammar.cpp ++++ b/Source/WebCore/xml/XPathGrammar.cpp +@@ -966,7 +966,7 @@ int yydebug; + #if YYERROR_VERBOSE + + # ifndef yystrlen +-# if defined __GLIBC__ && defined _STRING_H ++# if defined __linux__ && defined _STRING_H + # define yystrlen strlen + # else + /* Return the length of YYSTR. */ +@@ -989,7 +989,7 @@ yystrlen (yystr) + # endif + + # ifndef yystpcpy +-# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE ++# if defined __linux__ && defined _STRING_H && defined _GNU_SOURCE + # define yystpcpy stpcpy + # else + /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch b/poky/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch new file mode 100644 index 0000000000..dc3a71d932 --- /dev/null +++ b/poky/meta/recipes-sato/webkit/webkitgtk/musl-lower-stack-usage.patch @@ -0,0 +1,74 @@ +reduce thread stack and heap usage for javascriptcore on musl + +default sizes for musl are smaller compared to glibc, this matches +to musl defaults, avoid stack overflow crashes in jscore + +This is based on Alpine Linux's patch based on suggestion from +https://bugs.webkit.org/show_bug.cgi?id=187485 + +Real solution would entail more as the suggestions to increase +stack size via -Wl,-z,stack-size=N does not work fully and also +setting DEFAULT_THREAD_STACK_SIZE_IN_KB alone is not enough either + +This patch only changes behavior when using musl, the defaults for +glibc in OE remains same + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> + +--- a/Source/JavaScriptCore/runtime/OptionsList.h ++++ b/Source/JavaScriptCore/runtime/OptionsList.h +@@ -75,6 +75,18 @@ constexpr bool enableWebAssemblyStreamin + // On instantiation of the first VM instance, the Options will be write protected + // and cannot be modified thereafter. + ++#if OS(LINUX) && !defined(__GLIBC__) ++// non-glibc options on linux ( musl ) ++constexpr unsigned jscMaxPerThreadStack = 128 * KB; ++constexpr unsigned jscSoftReservedZoneSize = 32 * KB; ++constexpr unsigned jscReservedZoneSize = 16 * KB; ++#else ++//default ++constexpr unsigned jscMaxPerThreadStack = 4 * MB; ++constexpr unsigned jscSoftReservedZoneSize = 128 * KB; ++constexpr unsigned jscReservedZoneSize = 64 * KB; ++#endif ++ + #define FOR_EACH_JSC_OPTION(v) \ + v(Bool, useKernTCSM, defaultTCSMValue(), Normal, "Note: this needs to go before other options since they depend on this value.") \ + v(Bool, validateOptions, false, Normal, "crashes if mis-typed JSC options were passed to the VM") \ +@@ -90,9 +102,9 @@ constexpr bool enableWebAssemblyStreamin + \ + v(Bool, reportMustSucceedExecutableAllocations, false, Normal, nullptr) \ + \ +- v(Unsigned, maxPerThreadStackUsage, 5 * MB, Normal, "Max allowed stack usage by the VM") \ +- v(Unsigned, softReservedZoneSize, 128 * KB, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \ +- v(Unsigned, reservedZoneSize, 64 * KB, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \ ++ v(Unsigned, maxPerThreadStackUsage, jscMaxPerThreadStack, Normal, "Max allowed stack usage by the VM") \ ++ v(Unsigned, softReservedZoneSize, jscSoftReservedZoneSize, Normal, "A buffer greater than reservedZoneSize that reserves space for stringifying exceptions.") \ ++ v(Unsigned, reservedZoneSize, jscReservedZoneSize, Normal, "The amount of stack space we guarantee to our clients (and to interal VM code that does not call out to clients).") \ + \ + v(Bool, crashOnDisallowedVMEntry, ASSERT_ENABLED, Normal, "Forces a crash if we attempt to enter the VM when disallowed") \ + v(Bool, crashIfCantAllocateJITMemory, false, Normal, nullptr) \ +@@ -601,7 +613,7 @@ public: + bool init(const char*); + bool isInRange(unsigned); + const char* rangeString() const { return (m_state > InitError) ? m_rangeString : s_nullRangeStr; } +- ++ + void dump(PrintStream& out) const; + + private: +--- a/Source/WTF/wtf/Threading.h ++++ b/Source/WTF/wtf/Threading.h +@@ -56,6 +56,10 @@ + #include <array> + #endif + ++#if OS(LINUX) && !defined(__GLIBC__) ++#define DEFAULT_THREAD_STACK_SIZE_IN_KB 128 ++#endif ++ + namespace WTF { + + class AbstractLocker; diff --git a/poky/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch b/poky/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch new file mode 100644 index 0000000000..0493150a91 --- /dev/null +++ b/poky/meta/recipes-sato/webkit/webkitgtk/reduce-memory-overheads.patch @@ -0,0 +1,22 @@ +From: Alberto Garcia <berto@igalia.com> +Subject: Reduce memory usage when not using the Gold linker +Bug-Debian: https://bugs.debian.org/949621 +Forwarded: no + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/Source/cmake/OptionsCommon.cmake ++++ b/Source/cmake/OptionsCommon.cmake +@@ -95,6 +95,12 @@ option(GCC_OFFLINEASM_SOURCE_MAP + "Produce debug line information for offlineasm-generated code" + ${GCC_OFFLINEASM_SOURCE_MAP_DEFAULT}) + ++# Pass --reduce-memory-overheads to the bfd linker in order to save memory ++if (NOT USE_LD_GOLD) ++ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") ++ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--reduce-memory-overheads") ++endif () ++ + # Enable the usage of OpenMP. + # - At this moment, OpenMP is only used as an alternative implementation + # to native threads for the parallelization of the SVG filters. diff --git a/poky/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb b/poky/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb index 2928b8e55b..ff4c496e2a 100644 --- a/poky/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb +++ b/poky/meta/recipes-sato/webkit/webkitgtk_2.30.5.bb @@ -18,7 +18,11 @@ SRC_URI = "https://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \ file://0001-Fix-build-with-musl.patch \ file://include_array.patch \ file://include_xutil.patch \ + file://reduce-memory-overheads.patch \ + file://0001-Extend-atomics-check-to-include-1-byte-CAS-test.patch \ + file://musl-lower-stack-usage.patch \ " + SRC_URI[sha256sum] = "7d0dab08e3c5ae07bec80b2822ef42e952765d5724cac86eb23999bfed5a7f1f" inherit cmake pkgconfig gobject-introspection perlnative features_check upstream-version-is-even gtk-doc @@ -55,6 +59,7 @@ PACKAGECONFIG[libhyphen] = "-DUSE_LIBHYPHEN=ON,-DUSE_LIBHYPHEN=OFF,libhyphen" PACKAGECONFIG[woff2] = "-DUSE_WOFF2=ON,-DUSE_WOFF2=OFF,woff2" PACKAGECONFIG[openjpeg] = "-DUSE_OPENJPEG=ON,-DUSE_OPENJPEG=OFF,openjpeg" PACKAGECONFIG[systemd] = "-DUSE_SYSTEMD=ON,-DUSE_SYSTEMD=off,systemd" +PACKAGECONFIG[reduce-size] = "-DCMAKE_BUILD_TYPE=MinSizeRel,-DCMAKE_BUILD_TYPE=Release,," # webkitgtk is full of /usr/bin/env python, particular for generating docs do_configure[postfuncs] += "setup_python_link" @@ -66,7 +71,6 @@ setup_python_link() { EXTRA_OECMAKE = " \ -DPORT=GTK \ - -DCMAKE_BUILD_TYPE=Release \ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \ ${@bb.utils.contains('GTKDOC_ENABLED', 'True', '-DENABLE_GTKDOC=ON', '-DENABLE_GTKDOC=OFF', d)} \ -DENABLE_MINIBROWSER=ON \ |