webkit2gtk: update to 2.32.1

This commit is contained in:
q66 2021-05-10 20:09:33 +02:00
parent 3387aeb4d6
commit 272a831355
6 changed files with 6 additions and 260 deletions

View File

@ -1,22 +0,0 @@
https://bugs.webkit.org/show_bug.cgi?id=221709
diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
index 69b4dc6a6a0b..dc660f399257 100644
--- Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+++ Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
@@ -759,9 +759,15 @@ GRefPtr<GSubprocess> bubblewrapSpawn(GSubprocessLauncher* launcher, const Proces
"--ro-bind-try", "/usr/lib", "/usr/lib",
"--ro-bind-try", "/usr/local/lib", "/usr/local/lib",
"--ro-bind-try", LIBDIR, LIBDIR,
+#if CPU(ADDRESS64)
"--ro-bind-try", "/lib64", "/lib64",
"--ro-bind-try", "/usr/lib64", "/usr/lib64",
"--ro-bind-try", "/usr/local/lib64", "/usr/local/lib64",
+#else
+ "--ro-bind-try", "/lib32", "/lib32",
+ "--ro-bind-try", "/usr/lib32", "/usr/lib32",
+ "--ro-bind-try", "/usr/local/lib32", "/usr/local/lib32",
+#endif
"--ro-bind-try", PKGLIBEXECDIR, PKGLIBEXECDIR,
};

View File

@ -1,10 +0,0 @@
--- Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp 2019-09-23 10:17:18.000000000 +0200
+++ Source/WebKit/UIProcess/gtk/WaylandCompositor.cpp 2019-12-16 11:30:00.971252320 +0100
@@ -32,6 +32,7 @@
#include "WebKitWaylandServerProtocol.h"
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include <EGL/eglmesaext.h>
#include <WebCore/GLContext.h>
#include <WebCore/PlatformDisplayWayland.h>
#include <WebCore/Region.h>

View File

@ -1,80 +0,0 @@
Upstream: yes
--- Source/JavaScriptCore/runtime/MachineContext.h
+++ Source/JavaScriptCore/runtime/MachineContext.h
@@ -196,7 +196,7 @@ static inline void*& stackPointerImpl(mcontext_t& machineContext)
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
#if CPU(X86)
return reinterpret_cast<void*&>((uintptr_t&) machineContext.gregs[REG_ESP]);
@@ -347,7 +347,7 @@ static inline void*& framePointerImpl(mcontext_t& machineContext)
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -498,7 +498,7 @@ static inline void*& instructionPointerImpl(mcontext_t& machineContext)
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -656,7 +656,7 @@ inline void*& argumentPointer<1>(mcontext_t& machineContext)
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
@@ -773,7 +773,7 @@ inline void*& llintInstructionPointer(mcontext_t& machineContext)
#error Unknown Architecture
#endif
-#elif OS(FUCHSIA) || defined(__GLIBC__) || defined(__BIONIC__)
+#elif OS(FUCHSIA) || OS(LINUX)
// The following sequence depends on glibc's sys/ucontext.h.
#if CPU(X86)
--- Source/WebCore/xml/XPathGrammar.cpp
+++ 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
--- Source/WTF/wtf/PlatformHave.h
+++ Source/WTF/wtf/PlatformHave.h
@@ -206,7 +206,7 @@
#define HAVE_HOSTED_CORE_ANIMATION 1
#endif
-#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || defined(__GLIBC__) || defined(__BIONIC__)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
+#if OS(DARWIN) || OS(FUCHSIA) || ((OS(FREEBSD) || OS(LINUX)) && (CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(MIPS)))
#define HAVE_MACHINE_CONTEXT 1
#endif

View File

@ -1,74 +0,0 @@
https://bugs.webkit.org/show_bug.cgi?id=225099
From ab7e2bfae280b151ac173d6fc9d8eaa3da2e92a8 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Tue, 27 Apr 2021 22:51:22 +0200
Subject: [PATCH] fix stack size issues on musl
---
Source/WTF/wtf/StackBounds.cpp | 26 +++++++++++++++++++++++++-
Source/WTF/wtf/Threading.cpp | 4 ++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git Source/WTF/wtf/StackBounds.cpp Source/WTF/wtf/StackBounds.cpp
index e6f7095..58bdb18 100644
--- Source/WTF/wtf/StackBounds.cpp
+++ Source/WTF/wtf/StackBounds.cpp
@@ -36,6 +36,12 @@
#include <pthread_np.h>
#endif
+#if OS(LINUX)
+#include <sys/resource.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#endif
+
#endif
namespace WTF {
@@ -107,7 +113,25 @@ StackBounds StackBounds::newThreadStackBounds(PlatformThreadHandle thread)
StackBounds StackBounds::currentThreadStackBoundsInternal()
{
- return newThreadStackBounds(pthread_self());
+ auto ret = newThreadStackBounds(pthread_self());
+#if OS(LINUX)
+ // on glibc, pthread_attr_getstack will generally return the limit size (minus a guard page)
+ // for the main thread; this is however not necessarily always true on every libc - for example
+ // on musl, it will return the currently reserved size - since the stack bounds are expected to
+ // be constant (and they are for every thread except main, which is allowed to grow), check
+ // resource limits and use that as the boundary instead (and prevent stack overflows in JSC)
+ if (getpid() == static_cast<pid_t>(syscall(SYS_gettid))) {
+ void* origin = ret.origin();
+ rlimit limit;
+ getrlimit(RLIMIT_STACK, &limit);
+ rlim_t size = limit.rlim_cur;
+ // account for a guard page
+ size -= static_cast<rlim_t>(sysconf(_SC_PAGESIZE));
+ void* bound = static_cast<char*>(origin) - size;
+ return StackBounds { origin, bound };
+ }
+#endif
+ return ret;
}
#elif OS(WINDOWS)
diff --git Source/WTF/wtf/Threading.cpp Source/WTF/wtf/Threading.cpp
index 99d09c0..362bf35 100644
--- Source/WTF/wtf/Threading.cpp
+++ Source/WTF/wtf/Threading.cpp
@@ -58,6 +58,10 @@ static Optional<size_t> stackSize(ThreadType threadType)
#if defined(DEFAULT_THREAD_STACK_SIZE_IN_KB) && DEFAULT_THREAD_STACK_SIZE_IN_KB > 0
return DEFAULT_THREAD_STACK_SIZE_IN_KB * 1024;
+#elif OS(LINUX) && !defined(__BIONIC__) && !defined(__GLIBC__)
+ // on libc's other than glibc and bionic (e.g. musl) we are either unsure how big
+ // the default thread stack is, or we know it's too small - pick a robust default
+ return 1 * MB;
#else
// Use the platform's default stack size
return WTF::nullopt;
--
2.30.1

View File

@ -1,59 +0,0 @@
Upstream: yes
From 1b7144916774dbb4cc4705ba9a4377844e35f47d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Tue, 27 Apr 2021 22:56:33 +0200
Subject: [PATCH] remove __WORDSIZE usage
---
Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp | 6 +++---
Source/WebCore/rendering/RenderLayerBacking.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
index cfe3698..e5bc870 100644
--- Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
+++ Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_GCM.cpp
@@ -39,7 +39,7 @@ namespace CryptoAlgorithmAES_GCMInternal {
static const char* const ALG128 = "A128GCM";
static const char* const ALG192 = "A192GCM";
static const char* const ALG256 = "A256GCM";
-#if __WORDSIZE >= 64
+#if CPU(ADDRESS64)
static const uint64_t PlainTextMaxLength = 549755813632ULL; // 2^39 - 256
#endif
static const uint8_t DefaultTagLength = 128;
@@ -77,7 +77,7 @@ void CryptoAlgorithmAES_GCM::encrypt(const CryptoAlgorithmParameters& parameters
auto& aesParameters = downcast<CryptoAlgorithmAesGcmParams>(parameters);
-#if __WORDSIZE >= 64
+#if CPU(ADDRESS64)
if (plainText.size() > PlainTextMaxLength) {
exceptionCallback(OperationError);
return;
@@ -120,7 +120,7 @@ void CryptoAlgorithmAES_GCM::decrypt(const CryptoAlgorithmParameters& parameters
return;
}
-#if __WORDSIZE >= 64
+#if CPU(ADDRESS64)
if (aesParameters.ivVector().size() > UINT64_MAX) {
exceptionCallback(OperationError);
return;
diff --git Source/WebCore/rendering/RenderLayerBacking.h Source/WebCore/rendering/RenderLayerBacking.h
index 9960724..193c5d1 100644
--- Source/WebCore/rendering/RenderLayerBacking.h
+++ Source/WebCore/rendering/RenderLayerBacking.h
@@ -43,7 +43,7 @@ class TiledBacking;
class TransformationMatrix;
-#if __WORDSIZE == 64 && PLATFORM(COCOA)
+#if CPU(ADDRESS64) && PLATFORM(COCOA)
#define USE_OWNING_LAYER_BEAR_TRAP 1
#define BEAR_TRAP_VALUE 0xEEEEEEEEEEEEEEEE
#else
--
2.30.1

View File

@ -1,16 +1,15 @@
# Template file for 'webkit2gtk'
# ping q66 before touching this
pkgname=webkit2gtk
version=2.32.0
revision=3
version=2.32.1
revision=1
wrksrc="webkitgtk-${version}"
build_style=cmake
build_helper="gir"
configure_args="-DPORT=GTK -DUSE_LD_GOLD=OFF
-DCMAKE_LINKER=${XBPS_CROSS_TRIPLET}-gcc
-DRUBY_VERSION=2.7
-DCMAKE_LINKER=${XBPS_CROSS_TRIPLET}-gcc -DCMAKE_SKIP_RPATH=ON
-DUSE_SYSTEMD=OFF -DUSE_WOFF2=ON
-DENABLE_GTKDOC=OFF -DUSE_GSTREAMER_GL=OFF -DUSE_WPE_RENDERER=ON
-DENABLE_GTKDOC=OFF -DUSE_WPE_RENDERER=ON
-DENABLE_MINIBROWSER=$(vopt_if minibrowser ON OFF)
-DENABLE_JIT=$(vopt_if jit ON OFF)
-DENABLE_C_LOOP=$(vopt_if jit OFF ON)
@ -37,7 +36,8 @@ maintainer="q66 <daniel@octaforge.org>"
license="LGPL-2.1-or-later, BSD-2-Clause"
homepage="https://webkitgtk.org/"
distfiles="${homepage}/releases/webkitgtk-${version}.tar.xz"
checksum=9d7df4dae9ada2394257565acc2a68ace9308c4c61c3fcc00111dc1f11076bf0
checksum=136117317f70f66486f71b8edf5e46f8776403c5d8a296e914b11a36ef836917
make_check=no
build_options="gir wayland x11 bubblewrap jit sampling_profiler minibrowser"
build_options_default="gir wayland x11 bubblewrap minibrowser"
@ -65,10 +65,6 @@ post_patch() {
Source/cmake/tools/scripts/version-stamp.pl
}
do_check() {
:
}
# detection + runtime
if [ "$build_option_bubblewrap" ]; then
hostmakedepends+=" bubblewrap xdg-dbus-proxy"
@ -76,11 +72,6 @@ if [ "$build_option_bubblewrap" ]; then
depends+=" bubblewrap xdg-dbus-proxy"
fi
# https://bugs.webkit.org/show_bug.cgi?id=197192
case "$XBPS_TARGET_MACHINE" in
aarch64*) configure_args+=" -DWTF_CPU_ARM64_CORTEXA53=OFF";;
esac
# only a few platform support JIT
case "$XBPS_TARGET_MACHINE" in
aarch64*|x86_64*)