HaikuWebKit: More Clang fixes, fix and enable PCH, re-enable unified builds.

A build completed successfully on 32-bit here.
This commit is contained in:
Augustin Cavalier
2024-09-06 16:34:17 -04:00
parent d04bcdbc9a
commit e5b370f033
2 changed files with 94 additions and 2 deletions

View File

@@ -116,7 +116,7 @@ BUILD()
export CC="/bin/clang"
export CXX="/bin/clang++"
Tools/Scripts/build-webkit --haiku --no-webkit2 --no-fatal-warnings \
--cmakeargs="-DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_BUILD_TYPE=Release -DSHOULD_INSTALL_JS_SHELL=ON -DENABLE_UNIFIED_BUILDS=OFF"
--cmakeargs="-DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_BUILD_TYPE=Release -DSHOULD_INSTALL_JS_SHELL=ON"
}
INSTALL()

View File

@@ -1,4 +1,4 @@
From ef2fbf5c3c1a980ee97abe34f37ad1df4b294cdc Mon Sep 17 00:00:00 2001
From ce8b6293327006e34b2a26eea4ca523647520a45 Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Wed, 4 Sep 2024 21:29:17 -0400
Subject: Hacks to fix the build on Haiku with Clang.
@@ -45,6 +45,98 @@ index 39c0353..caba9ba 100644
return String::fromUTF8(extMap->mimeType);
++extMap;
}
diff --git a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp
index 7371818..d45fe88 100644
--- a/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp
+++ b/Source/WebKitLegacy/haiku/WebCoreSupport/IconDatabase.cpp
@@ -1079,7 +1079,7 @@ bool IconDatabase::checkIntegrity()
String resultText = integrity->columnText(0);
// A successful, no-error integrity check will be "ok" - all other strings imply failure
- if (resultText == "ok")
+ if (resultText == StringView::fromLatin1("ok"))
return true;
LOG_ERROR("Icon database integrity check failed - \n%s", resultText.ascii().data());
diff --git a/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp b/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp
index dab51a2..27abd62 100644
--- a/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/haiku/DumpRenderTree.cpp
@@ -163,7 +163,7 @@ static void dumpFrameScrollPosition(BWebFrame* frame)
static void adjustOutputTypeByMimeType(BWebFrame* frame)
{
const String responseMimeType(WebCore::DumpRenderTreeClient::responseMimeType(frame));
- if (responseMimeType == "text/plain") {
+ if (responseMimeType == StringView::fromLatin1("text/plain")) {
gTestRunner->setDumpAsText(true);
gTestRunner->setGeneratePixelResults(false);
}
@@ -408,7 +408,7 @@ static void runTest(const string& inputLine)
webView->UnlockLooper();
// TODO efl does some history cleanup here
-
+
webView->WebPage()->MainFrame()->LoadURL(BString(testURL));
}
--
2.45.2
From 75402bb8945a624cc64f5b1e403a3e5b169a3dae Mon Sep 17 00:00:00 2001
From: Augustin Cavalier <waddlesplash@gmail.com>
Date: Fri, 6 Sep 2024 16:29:59 -0400
Subject: Fix and enable precompiled headers on Haiku.
WebKit enables them only for Windows by default for some reason.
diff --git a/Source/WebCore/testing/js/WebCoreTestSupportPrefix.h b/Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
index ffba977..19283e7 100644
--- a/Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
+++ b/Source/WebCore/testing/js/WebCoreTestSupportPrefix.h
@@ -18,7 +18,7 @@
*
*/
-/* This prefix file should contain only:
+/* This prefix file should contain only:
* 1) files to precompile for faster builds
* 2) in one case at least: OS-X-specific performance bug workarounds
* 3) the special trick to catch us using new or delete without including "config.h"
@@ -108,7 +108,7 @@
#endif
#include <windows.h>
#else
-#if !PLATFORM(IOS_FAMILY)
+#if defined(__APPLE__) && !PLATFORM(IOS_FAMILY)
#include <CoreServices/CoreServices.h>
#endif // !PLATFORM(IOS_FAMILY)
#endif // OS(WINDOWS)
@@ -124,8 +124,8 @@
#endif
#ifdef __cplusplus
-#define new ("if you use new/delete make sure to include config.h at the top of the file"())
-#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
+#define new ("if you use new/delete make sure to include config.h at the top of the file"())
+#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
#endif
/* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
diff --git a/Source/cmake/OptionsHaiku.cmake b/Source/cmake/OptionsHaiku.cmake
index 3b46cd7..4434036 100644
--- a/Source/cmake/OptionsHaiku.cmake
+++ b/Source/cmake/OptionsHaiku.cmake
@@ -11,6 +11,8 @@ add_definitions(-DBUILDING_HAIKU__=1)
CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 25 4 7)
+set(CMAKE_DISABLE_PRECOMPILE_HEADERS OFF)
+
# Force libstdc++ to export std::isinf and friends. This should be fixed on
# Haiku side ultimately.
add_definitions(-D_GLIBCXX_USE_C99_MATH)
--
2.45.2