webkit-gtk: use clang for build, cleanup

This commit is contained in:
Gerasim Troeglazov
2022-11-25 22:57:19 +10:00
parent 96873b7e19
commit 50a3d64d2f
2 changed files with 255 additions and 24 deletions

View File

@@ -604,3 +604,219 @@ index 2605e1c..c01a1a0 100644
--
2.37.3
From 5904e33007e48afce68eda900ca3af68f5ca5316 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 23 Nov 2022 17:50:41 +1000
Subject: Remove fullpath for gcc
diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/preprocess.pl b/Source/JavaScriptCore/inspector/scripts/codegen/preprocess.pl
index d3c8a9b..2b16edc 100644
--- a/Source/JavaScriptCore/inspector/scripts/codegen/preprocess.pl
+++ b/Source/JavaScriptCore/inspector/scripts/codegen/preprocess.pl
@@ -43,7 +43,7 @@ if (!$preprocessor) {
$preprocessor = $ENV{CC} || "cl";
push(@args, qw(/nologo /EP /TP /C));
} else {
- $preprocessor = $ENV{CC} || (-x "/bin/clang" ? "/bin/clang" : "/bin/gcc");
+ $preprocessor = $ENV{CC} || (-x "clang" ? "clang" : "gcc");
push(@args, qw(-E -P -x c++ -C));
}
}
--
2.37.3
From 15195b11b69b080ec88ffe2c0fae4f540920a41e Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Nov 2022 17:49:09 +1000
Subject: Use __thread instead thread_local
diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp b/Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp
index 9fa9991..c1f6528 100644
--- a/Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp
+++ b/Source/ThirdParty/ANGLE/src/libANGLE/Context.cpp
@@ -424,7 +424,7 @@ void SetCurrentValidContextTLS(Context *context)
SetTLSValue(CurrentValidContextIndex, context);
}
#else
-thread_local Context *gCurrentValidContext = nullptr;
+__thread Context *gCurrentValidContext = nullptr;
#endif
Context::Context(egl::Display *display,
diff --git a/Source/ThirdParty/ANGLE/src/libANGLE/Context.h b/Source/ThirdParty/ANGLE/src/libANGLE/Context.h
index 34a1fda..8d8b8a4 100644
--- a/Source/ThirdParty/ANGLE/src/libANGLE/Context.h
+++ b/Source/ThirdParty/ANGLE/src/libANGLE/Context.h
@@ -859,7 +859,7 @@ class [[nodiscard]] ScopedContextRef
extern Context *GetCurrentValidContextTLS();
extern void SetCurrentValidContextTLS(Context *context);
#else
-extern thread_local Context *gCurrentValidContext;
+extern __thread Context *gCurrentValidContext;
#endif
} // namespace gl
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.cpp
index 18265d2..8b6f174 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.cpp
@@ -141,7 +141,7 @@ void SetCurrentThreadTLS(Thread *thread)
SetTLSValue(CurrentThreadIndex, thread);
}
#else
-thread_local Thread *gCurrentThread = nullptr;
+__thread Thread *gCurrentThread = nullptr;
#endif
angle::GlobalMutex &GetGlobalMutex()
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.h b/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.h
index cfb2ae2..e85ec60 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/global_state.h
@@ -97,7 +97,7 @@ class Thread;
extern Thread *GetCurrentThreadTLS();
extern void SetCurrentThreadTLS(Thread *thread);
#else
-extern thread_local Thread *gCurrentThread;
+extern __thread Thread *gCurrentThread;
#endif
angle::GlobalMutex &GetGlobalMutex();
diff --git a/Source/WTF/wtf/FastMalloc.cpp b/Source/WTF/wtf/FastMalloc.cpp
index 30e43b3..541915f 100644
--- a/Source/WTF/wtf/FastMalloc.cpp
+++ b/Source/WTF/wtf/FastMalloc.cpp
@@ -58,8 +58,8 @@
namespace WTF {
#if ASSERT_ENABLED
-thread_local static unsigned forbidMallocUseScopeCount;
-thread_local static unsigned disableMallocRestrictionScopeCount;
+__thread unsigned forbidMallocUseScopeCount;
+__thread unsigned disableMallocRestrictionScopeCount;
ForbidMallocUseForCurrentThreadScope::ForbidMallocUseForCurrentThreadScope()
{
diff --git a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
index a097b23..5d42aa1 100644
--- a/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
+++ b/Source/WebCore/platform/graphics/gbm/GraphicsContextGLANGLELinux.cpp
@@ -108,7 +108,7 @@ RefPtr<PixelBuffer> GraphicsContextGLANGLE::readCompositedResults()
bool GraphicsContextGLANGLE::makeContextCurrent()
{
- static thread_local TLS_MODEL_INITIAL_EXEC GraphicsContextGLANGLE* s_currentContext { nullptr };
+ __thread TLS_MODEL_INITIAL_EXEC GraphicsContextGLANGLE* s_currentContext { nullptr };
if (s_currentContext == this)
return true;
--
2.37.3
From 1d366b98de71c31f0664119e65c77957b9bcadb7 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Nov 2022 17:54:59 +1000
Subject: Fix platform defs
diff --git a/Source/WTF/wtf/CheckedArithmetic.h b/Source/WTF/wtf/CheckedArithmetic.h
index c9d31d5..25b90a3 100644
--- a/Source/WTF/wtf/CheckedArithmetic.h
+++ b/Source/WTF/wtf/CheckedArithmetic.h
@@ -34,7 +34,7 @@
/* On Linux with clang, libgcc is usually used instead of compiler-rt, and it does
* not provide the __mulodi4 symbol used by clang for __builtin_mul_overflow
*/
-#if COMPILER(GCC) || (COMPILER(CLANG) && !(CPU(ARM) && OS(LINUX))) && !PLATFORM(IOS_FAMILY_SIMULATOR)
+#if COMPILER(GCC) || (COMPILER(CLANG) && !(CPU(ARM) && OS(LINUX)) && !OS(HAIKU)) && !PLATFORM(IOS_FAMILY_SIMULATOR)
#define USE_MUL_OVERFLOW 1
#endif
diff --git a/Source/WTF/wtf/InlineASM.h b/Source/WTF/wtf/InlineASM.h
index aba12e0..04f2529 100644
--- a/Source/WTF/wtf/InlineASM.h
+++ b/Source/WTF/wtf/InlineASM.h
@@ -43,7 +43,7 @@
#define THUMB_FUNC_PARAM(name)
#endif
-#if (OS(LINUX) || OS(FREEBSD)) && CPU(X86_64)
+#if (OS(LINUX) || OS(FREEBSD) || OS(HAIKU)) && CPU(X86_64)
#define GLOBAL_REFERENCE(name) #name "@plt"
#elif CPU(X86) && COMPILER(MINGW)
#define GLOBAL_REFERENCE(name) "@" #name "@4"
diff --git a/Source/WTF/wtf/PlatformEnable.h b/Source/WTF/wtf/PlatformEnable.h
index 8863f57..2e4548d 100644
--- a/Source/WTF/wtf/PlatformEnable.h
+++ b/Source/WTF/wtf/PlatformEnable.h
@@ -646,7 +646,7 @@
#if !defined(ENABLE_DFG_JIT) && ENABLE(JIT)
/* Enable the DFG JIT on X86 and X86_64. */
-#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
+#if CPU(X86_64) && (OS(DARWIN) || OS(LINUX) || OS(HAIKU) || OS(FREEBSD) || OS(HURD) || OS(WINDOWS))
#define ENABLE_DFG_JIT 1
#endif
--
2.37.3
From 1225ec8c5d2b14320605f6093b9b9dceb33ec175 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Nov 2022 17:55:35 +1000
Subject: Fix build for x86 arch
diff --git a/Source/JavaScriptCore/API/glib/JSCOptions.cpp b/Source/JavaScriptCore/API/glib/JSCOptions.cpp
index dd46ff5..54f6dac 100644
--- a/Source/JavaScriptCore/API/glib/JSCOptions.cpp
+++ b/Source/JavaScriptCore/API/glib/JSCOptions.cpp
@@ -73,7 +73,7 @@ static void valueToGValue(int32_t value, GValue* gValue)
g_value_set_int(gValue, value);
}
-#if CPU(ADDRESS64)
+#if CPU(ADDRESS64) || OS(HAIKU)
static bool valueFromGValue(const GValue* gValue, unsigned& value)
{
value = g_value_get_uint(gValue);
@@ -556,7 +556,7 @@ static JSCOptionType jscOptionsType(int)
return JSC_OPTION_INT;
}
-#if CPU(ADDRESS64)
+#if CPU(ADDRESS64) || OS(HAIKU)
static JSCOptionType jscOptionsType(unsigned)
{
return JSC_OPTION_UINT;
diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp
index 47a6001..c10cfa0 100644
--- a/Source/JavaScriptCore/runtime/Options.cpp
+++ b/Source/JavaScriptCore/runtime/Options.cpp
@@ -91,7 +91,7 @@ std::optional<OptionsStorage::Unsigned> parse(const char* string)
return std::nullopt;
}
-#if CPU(ADDRESS64) || OS(DARWIN)
+#if CPU(ADDRESS64) || OS(DARWIN) || OS(HAIKU)
template<>
std::optional<OptionsStorage::Size> parse(const char* string)
{
@@ -100,7 +100,7 @@ std::optional<OptionsStorage::Size> parse(const char* string)
return value;
return std::nullopt;
}
-#endif // CPU(ADDRESS64) || OS(DARWIN)
+#endif // CPU(ADDRESS64) || OS(DARWIN) || OS(HAIKU)
template<>
std::optional<OptionsStorage::Double> parse(const char* string)
--
2.37.3

View File

@@ -12,7 +12,7 @@ COPYRIGHT="20092022 The WebKitGTK Team"
LICENSE="GNU LGPL v2
BSD (2-clause)
"
REVISION="4"
REVISION="5"
SOURCE_URI="https://www.webkitgtk.org/releases/webkitgtk-$portVersion.tar.xz"
CHECKSUM_SHA256="f3eb82899651f583b4d99cacd16af784a1a7710fce9e7b6807bd6ccde909fe3e"
SOURCE_DIR="webkitgtk-$portVersion"
@@ -22,8 +22,8 @@ ADDITIONAL_FILES="
webprocess.rdef.in
"
ARCHITECTURES="!all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
webkit_gtk$secondaryArchSuffix = $portVersion
@@ -106,7 +106,8 @@ REQUIRES_devel="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
wayland_protocols
gcc${secondaryArchSuffix}_syslibs
gcc${secondaryArchSuffix}_syslibs_devel
devel:libavif$secondaryArchSuffix
devel:libbrotlidec$secondaryArchSuffix
devel:libcrypto$secondaryArchSuffix
@@ -132,9 +133,10 @@ BUILD_REQUIRES="
devel:libharfbuzz$secondaryArchSuffix
devel:libhyphen$secondaryArchSuffix
devel:libicuuc$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libjxl$secondaryArchSuffix
devel:libLLVM_12$secondaryArchSuffix
devel:libnghttp2$secondaryArchSuffix
devel:libopenjp2$secondaryArchSuffix
devel:libopus$secondaryArchSuffix
@@ -149,14 +151,17 @@ BUILD_REQUIRES="
devel:libvpx$secondaryArchSuffix
devel:libwayland_client$secondaryArchSuffix
devel:libwayland_server$secondaryArchSuffix
devel:libwebp$secondaryArchSuffix
devel:libwebp$secondaryArchSuffix >= 7
devel:libwoff2dec$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
wayland_protocols
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:clang >= 12
cmd:clang++ >= 12
cmd:gcc$secondaryArchSuffix
cmd:gperf
cmd:make
@@ -179,36 +184,47 @@ PATCH()
BUILD()
{
export DISABLE_ASLR=1
export CC="/bin/clang"
export CXX="/bin/clang++"
cmake -S. -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="-D_BSD_SOURCE" \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_INSTALL_BINDIR=$binDir \
-DCMAKE_INSTALL_SBINDIR=$binDir \
-DCMAKE_INSTALL_LIBDIR=$libDir \
-DCMAKE_INSTALL_LIBEXECDIR=$libDir \
-DCMAKE_INSTALL_DATAROOTDIR=$dataDir \
-DCMAKE_INSTALL_INCLUDEDIR=$includeDir \
-DCMAKE_CXX_FLAGS="-D_BSD_SOURCE -fPIC" \
-DCMAKE_C_FLAGS="-D_BSD_SOURCE -fPIC" \
-DPORT=GTK \
-DENABLE_ACCESSIBILITY=OFF \
-DENABLE_ACCESSIBILITY=OFF \
-DENABLE_API_TESTS=OFF \
-DENABLE_BUBBLEWRAP_SANDBOX=OFF \
-DENABLE_EXPERIMENTAL_FEATURES=ON \
-DENABLE_FTPDIR=ON \
-DENABLE_EXPERIMENTAL_FEATURES=ON \
-DENABLE_FTPDIR=ON \
-DENABLE_GAMEPAD=OFF \
-DENABLE_GEOLOCATION=ON \
-DENABLE_GLES2=OFF \
-DENABLE_GTKDOC=OFF \
-DENABLE_INTROSPECTION=OFF \
-DENABLE_JOURNALD_LOG=OFF \
-DENABLE_MEDIA_STREAM=ON \
-DENABLE_MEDIA_RECORDER=OFF \
-DENABLE_MEDIA_SOURCE=ON \
-DENABLE_MEDIA_STREAM=ON \
-DENABLE_MEDIA_RECORDER=OFF \
-DENABLE_MEDIA_SOURCE=ON \
-DENABLE_MINIBROWSER=ON \
-DENABLE_QUARTZ_TARGET=OFF \
-DENABLE_SAMPLING_PROFILER=OFF \
-DENABLE_SMOOTH_SCROLLING=OFF \
-DENABLE_SAMPLING_PROFILER=OFF \
-DENABLE_SERVICE_WORKER=OFF \
-DENABLE_SMOOTH_SCROLLING=OFF \
-DENABLE_SPELLCHECK=ON \
-DENABLE_UNIFIED_BUILDS=ON \
-DENABLE_VIDEO=ON \
-DENABLE_WEB_AUDIO=ON \
-DENABLE_WEBDRIVER=OFF \
-DENABLE_WEBGL=ON \
-DENABLE_WEB_RTC=ON \
-DENABLE_WEBDRIVER=OFF \
-DENABLE_WEBGL=ON \
-DENABLE_WEB_RTC=ON \
-DENABLE_WAYLAND_TARGET=OFF \
-DENABLE_X11_TARGET=OFF \
-DUSE_ATSPI=OFF \
@@ -222,22 +238,21 @@ BUILD()
-DUSE_LIBHYPHEN=ON \
-DUSE_LIBNOTIFY=OFF \
-DUSE_LIBSECRET=ON \
-DUSE_LIBWEBRTC=OFF \
-DUSE_LIBWEBRTC=OFF \
-DUSE_OPENGL=ON \
-DUSE_OPENJPEG=ON \
-DUSE_SOUP2=OFF \
-DUSE_SYSTEM_MALLOC=ON \
-DUSE_SYSTEM_MALLOC=ON \
-DUSE_SYSTEMD=OFF \
-DUSE_WOFF2=ON \
-DUSE_WPE_RENDERER=OFF \
$cmakeDirArgs
-DUSE_WPE_RENDERER=OFF
ninja -C build
ninja -v -C build
}
INSTALL()
{
make -C build install
ninja -C build install
mkdir -p $dataDir $appsDir
mv $prefix/share/locale $dataDir