Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the port build on 10.9.5 . #1

Open
wants to merge 1 commit into
base: mascguy-webkit2-gtk-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 221 additions & 53 deletions www/webkit2-gtk-devel/Portfile

Large diffs are not rendered by default.

799 changes: 799 additions & 0 deletions www/webkit2-gtk-devel/files/MacTypes.h

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions www/webkit2-gtk-devel/files/file-linux-madv_free.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git Source/bmalloc/libpas/src/libpas/orig.pas_probabilistic_guard_malloc_allocator.c Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c
index d4e79ba..f70c3be 100644
--- Source/bmalloc/libpas/src/libpas/orig.pas_probabilistic_guard_malloc_allocator.c
+++ Source/bmalloc/libpas/src/libpas/pas_probabilistic_guard_malloc_allocator.c
@@ -114,6 +114,10 @@ pas_allocation_result pas_probabilistic_guard_malloc_allocate(pas_large_heap* la
* ensure physical addresses are released
* TODO: investigate using MADV_FREE_REUSABLE instead
*/
+#if defined(linux) && !defined(MADV_FREE)
+#warning "Defining MADV_FREE (8)"
+#define MADV_FREE 8
+#endif
int madvise_res = madvise((void *) upper_guard_page, page_size, MADV_FREE);
PAS_ASSERT(!madvise_res);

26 changes: 26 additions & 0 deletions www/webkit2-gtk-devel/files/patch-DateInstance-nullptr-deref.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git Source/JavaScriptCore/runtime/orig.DateInstance.cpp Source/JavaScriptCore/runtime/DateInstance.cpp
index 915854b..1b00c91 100644
--- Source/JavaScriptCore/runtime/orig.DateInstance.cpp
+++ Source/JavaScriptCore/runtime/DateInstance.cpp
@@ -59,6 +59,10 @@ const GregorianDateTime* DateInstance::calculateGregorianDateTime(VM& vm) const
if (!m_data)
m_data = vm.dateInstanceCache.add(milli);

+ if (!m_data) {
+ // this can happen when finishCreation() was called with time <= 0
+ return nullptr;
+ }
if (m_data->m_gregorianDateTimeCachedForMS != milli) {
msToGregorianDateTime(vm, milli, WTF::LocalTime, m_data->m_cachedGregorianDateTime);
m_data->m_gregorianDateTimeCachedForMS = milli;
@@ -75,6 +79,10 @@ const GregorianDateTime* DateInstance::calculateGregorianDateTimeUTC(VM& vm) con
if (!m_data)
m_data = vm.dateInstanceCache.add(milli);

+ if (!m_data) {
+ // this can happen when finishCreation() was called with time <= 0
+ return nullptr;
+ }
if (m_data->m_gregorianDateTimeUTCCachedForMS != milli) {
msToGregorianDateTime(vm, milli, WTF::UTCTime, m_data->m_cachedGregorianDateTimeUTC);
m_data->m_gregorianDateTimeUTCCachedForMS = milli;
13 changes: 13 additions & 0 deletions www/webkit2-gtk-devel/files/patch-IPC-failure-message.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp.orig Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
index e01364f..6489537 100644
--- Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp.orig
+++ Source/WebKit/Platform/IPC/unix/ConnectionUnix.cpp
@@ -535,7 +535,7 @@ bool Connection::sendOutputMessage(UnixMessage& outputMessage)
}

if (m_isConnected)
- WTFLogAlways("Error sending IPC message: %s", safeStrerror(errno).data());
+ WTFLogAlways("Error sending IPC message of length %d: %s", message.msg_iovlen, safeStrerror(errno).data());
return false;
}

22 changes: 11 additions & 11 deletions www/webkit2-gtk-devel/files/patch-WTF-wtf-Randomdevice.diff
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
diff --git Source/WTF/wtf/RandomDevice.cpp Source/WTF/wtf/RandomDevice.cpp
index 89165f03..99251674 100644
--- Source/WTF/wtf/RandomDevice.cpp
diff --git Source/WTF/wtf/RandomDevice.cpp.orig Source/WTF/wtf/RandomDevice.cpp
index 1e35bcd..4cac605 100644
--- Source/WTF/wtf/RandomDevice.cpp.orig
+++ Source/WTF/wtf/RandomDevice.cpp
@@ -30,7 +30,7 @@
#include <stdint.h>
@@ -29,7 +29,7 @@

#include <stdlib.h>

-#if !OS(DARWIN) && !OS(FUCHSIA) && OS(UNIX)
+#if (1)
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -41,7 +41,7 @@
@@ -40,7 +40,7 @@
#include <wincrypt.h> // windows.h must be included before wincrypt.h.
#endif

-#if OS(DARWIN)
+#if (0)
#include <CommonCrypto/CommonCryptoError.h>
#include <CommonCrypto/CommonCryptor.h>
#include <CommonCrypto/CommonRandom.h>
#endif
@@ -52,7 +52,7 @@
@@ -51,7 +51,7 @@

namespace WTF {

Expand All @@ -29,7 +29,7 @@ index 89165f03..99251674 100644
NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToOpenURandom()
{
CRASH();
@@ -64,7 +64,7 @@ NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToReadFromURandom()
@@ -63,7 +63,7 @@ NEVER_INLINE NO_RETURN_DUE_TO_CRASH static void crashUnableToReadFromURandom()
}
#endif

Expand All @@ -38,7 +38,7 @@ index 89165f03..99251674 100644
RandomDevice::RandomDevice()
{
int ret = 0;
@@ -77,7 +77,7 @@ RandomDevice::RandomDevice()
@@ -76,7 +76,7 @@ RandomDevice::RandomDevice()
}
#endif

Expand All @@ -47,7 +47,7 @@ index 89165f03..99251674 100644
RandomDevice::~RandomDevice()
{
close(m_fd);
@@ -88,11 +88,11 @@ RandomDevice::~RandomDevice()
@@ -87,11 +87,11 @@ RandomDevice::~RandomDevice()
// https://bugs.webkit.org/show_bug.cgi?id=170190
void RandomDevice::cryptographicallyRandomValues(unsigned char* buffer, size_t length)
{
Expand Down
37 changes: 0 additions & 37 deletions www/webkit2-gtk-devel/files/patch-WTF-wtf-getVTablePointer.diff

This file was deleted.

19 changes: 19 additions & 0 deletions www/webkit2-gtk-devel/files/patch-cmake-no-colours.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git Source/cmake/orig.WebKitCompilerFlags.cmake Source/cmake/WebKitCompilerFlags.cmake
index 074fdf5..acfb9d4 100644
--- Source/cmake/orig.WebKitCompilerFlags.cmake
+++ Source/cmake/WebKitCompilerFlags.cmake
@@ -198,10 +198,10 @@ if (COMPILER_IS_GCC_OR_CLANG AND NOT MSVC)
endif ()

# Ninja tricks compilers into turning off color support.
-if (CMAKE_GENERATOR STREQUAL "Ninja")
- WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-fcolor-diagnostics
- -fdiagnostics-color=always)
-endif ()
+# if (CMAKE_GENERATOR STREQUAL "Ninja")
+# WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-fcolor-diagnostics
+# -fdiagnostics-color=always)
+# endif ()


string(TOLOWER ${CMAKE_HOST_SYSTEM_PROCESSOR} LOWERCASE_CMAKE_HOST_SYSTEM_PROCESSOR)
17 changes: 17 additions & 0 deletions www/webkit2-gtk-devel/files/patch-cmake-summary.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git orig.CMakeLists.txt CMakeLists.txt
index a79000b..9f8f6d5 100644
--- orig.CMakeLists.txt
+++ CMakeLists.txt
@@ -11,6 +11,7 @@
cmake_minimum_required(VERSION 3.10)

project(WebKit)
+include(FeatureSummary)

if (NOT CMAKE_BUILD_TYPE)
message(WARNING "No CMAKE_BUILD_TYPE value specified, defaulting to RelWithDebInfo.")
@@ -202,3 +203,4 @@ endif ()
# Print the features list last, for maximum visibility.
# -----------------------------------------------------------------------------
PRINT_WEBKIT_OPTIONS()
+feature_summary(WHAT ALL)
17 changes: 17 additions & 0 deletions www/webkit2-gtk-devel/files/patch-currenttime.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git Source/WTF/wtf/orig.CurrentTime.cpp Source/WTF/wtf/CurrentTime.cpp
index c042a0f..e7c6362 100644
--- Source/WTF/wtf/orig.CurrentTime.cpp
+++ Source/WTF/wtf/CurrentTime.cpp
@@ -288,7 +288,12 @@ MonotonicTime MonotonicTime::now()
ApproximateTime ApproximateTime::now()
{
#if OS(DARWIN)
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 101000
return fromMachApproximateTime(mach_approximate_time());
+#else
+ // anything better we can do??
+ return fromMachApproximateTime(mach_absolute_time());
+#endif
#elif OS(LINUX)
struct timespec ts { };
clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
76 changes: 76 additions & 0 deletions www/webkit2-gtk-devel/files/patch-fix-jsc_jsch-include.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
diff --git Source/WebKit/orig.PlatformGTK.cmake Source/WebKit/PlatformGTK.cmake
index e229687..c566384 100644
--- Source/WebKit/orig.PlatformGTK.cmake
+++ Source/WebKit/PlatformGTK.cmake
@@ -241,6 +241,7 @@ list(INSERT WebKit_INCLUDE_DIRECTORIES 0
"${WebKitGTK_FRAMEWORK_HEADERS_DIR}/webkitgtk-web-process-extension"
"${WebKitGTK_DERIVED_SOURCES_DIR}/webkit"
"${WebKitGTK_DERIVED_SOURCES_DIR}"
+ "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}"
)

list(APPEND WebKit_PRIVATE_INCLUDE_DIRECTORIES
diff --git Tools/TestWebKitAPI/orig.PlatformGTK.cmake Tools/TestWebKitAPI/PlatformGTK.cmake
index 87c714b..72bd474 100644
--- Tools/TestWebKitAPI/orig.PlatformGTK.cmake
+++ Tools/TestWebKitAPI/PlatformGTK.cmake
@@ -98,6 +98,7 @@ set(TestJSC_SYSTEM_INCLUDE_DIRECTORIES
set(TestJSC_PRIVATE_INCLUDE_DIRECTORIES
${CMAKE_BINARY_DIR}
${TESTWEBKITAPI_DIR}
+ "${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}"
"${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc"
)

diff --git Source/JavaScriptCore/orig.GLib.cmake Source/JavaScriptCore/GLib.cmake
index 4945542..af269c1 100644
--- Source/JavaScriptCore/orig.GLib.cmake
+++ Source/JavaScriptCore/GLib.cmake
@@ -63,12 +63,45 @@ configure_file(API/glib/JSCVersion.h.in ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR
# These symbolic link allows includes like #include <jsc/jsc.h> which simulates installed headers.
add_custom_command(
OUTPUT ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc
- DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib
- COMMAND ln -n -s -f ${JAVASCRIPTCORE_DIR}/API/glib ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc
+ DEPENDS ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc
+ COMMAND ln -n -s -f ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc
+ COMMENT "Installing jsc symlink"
+ VERBATIM
+)
+add_custom_command(
+ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h
+ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCOptions.h
+ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCOptions.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h
+ COMMENT "Installing symlink to JSCOptions.h"
+ VERBATIM
+)
+add_custom_command(
+ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h
+ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCAutocleanups.h
+ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCAutocleanups.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h
+ COMMENT "Installing symlink to JSCAutocleanups.h"
+ VERBATIM
+)
+add_custom_command(
+ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h
+ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCContextPrivate.h
+ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCContextPrivate.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h
+ COMMENT "Installing symlink to JSCContextPrivate.h"
+ VERBATIM
+)
+add_custom_command(
+ OUTPUT ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h
+ DEPENDS ${JAVASCRIPTCORE_DIR}/API/glib/JSCValuePrivate.h
+ COMMAND cp -pv ${JAVASCRIPTCORE_DIR}/API/glib/JSCValuePrivate.h ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h
+ COMMENT "Installing symlink to JSCValuePrivate.h"
VERBATIM
)
add_custom_target(JSC-fake-api-headers
DEPENDS ${JavaScriptCoreGLib_FRAMEWORK_HEADERS_DIR}/jsc
+ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCOptions.h
+ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCAutocleanups.h
+ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCContextPrivate.h
+ ${JavaScriptCoreGLib_DERIVED_SOURCES_DIR}/jsc/JSCValuePrivate.h
)
set(JavaScriptCore_EXTRA_DEPENDENCIES
JSC-fake-api-headers
16 changes: 16 additions & 0 deletions www/webkit2-gtk-devel/files/patch-gigacage.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git Source/WTF/wtf/orig.Gigacage.h Source/WTF/wtf/Gigacage.h
index 1d4f068..2bc9d2b 100644
--- Source/WTF/wtf/orig.Gigacage.h
+++ Source/WTF/wtf/Gigacage.h
@@ -31,6 +31,11 @@
#if USE(SYSTEM_MALLOC)
#define GIGACAGE_ENABLED 0

+#if OS(DARWIN)
+#include <wtf/MathExtras.h>
+#include <mach/mach_vm.h>
+#endif
+
namespace Gigacage {

constexpr bool hasCapacityToUseLargeGigacage = OS_CONSTANT(EFFECTIVE_ADDRESS_WIDTH) > 36;
23 changes: 23 additions & 0 deletions www/webkit2-gtk-devel/files/patch-less-gcrypt-oops-msg.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git Source/WebCore/PAL/pal/crypto/gcrypt/orig.Initialization.h Source/WebCore/PAL/pal/crypto/gcrypt/Initialization.h
index ef9a09d..fab6577 100644
--- Source/WebCore/PAL/pal/crypto/gcrypt/orig.Initialization.h
+++ Source/WebCore/PAL/pal/crypto/gcrypt/Initialization.h
@@ -37,9 +37,16 @@ static inline void initialize()
// returned version string.
gcry_check_version(nullptr);

+ static char done = 0;
+ if (done) {
+ return;
+ }
+
// Pre-allocate 16kB of secure memory and finish the initialization.
- gcry_control(GCRYCTL_INIT_SECMEM, 16384, nullptr);
- gcry_control(GCRYCTL_INITIALIZATION_FINISHED, nullptr);
+ if (gcry_control(GCRYCTL_INIT_SECMEM, 16384, nullptr) == 0 &&
+ gcry_control(GCRYCTL_INITIALIZATION_FINISHED, nullptr) == 0) {
+ done = 1;
+ }
}

} // namespace PAL
39 changes: 39 additions & 0 deletions www/webkit2-gtk-devel/files/patch-mach_vm.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git Source/WTF/wtf/orig.CompactPointerTuple.h Source/WTF/wtf/CompactPointerTuple.h
index 0659138..f18beb4 100644
--- Source/WTF/wtf/orig.CompactPointerTuple.h
+++ Source/WTF/wtf/CompactPointerTuple.h
@@ -33,7 +33,7 @@
#include <wtf/StdLibExtras.h>

#if OS(DARWIN)
-#include <mach/vm_param.h>
+#include <mach/mach_vm.h>
#endif

namespace WTF {
diff --git Source/WTF/wtf/orig.Packed.h Source/WTF/wtf/Packed.h
index 274b963..3c769bd 100644
--- Source/WTF/wtf/orig.Packed.h
+++ Source/WTF/wtf/Packed.h
@@ -34,7 +34,7 @@
#include <wtf/UnalignedAccess.h>

#if OS(DARWIN)
-#include <mach/vm_param.h>
+#include <mach/mach_vm.h>
#endif

namespace WTF {
diff --git Source/JavaScriptCore/bytecode/orig.CodeOrigin.h Source/JavaScriptCore/bytecode/CodeOrigin.h
index 3497138..128cf9e 100644
--- Source/JavaScriptCore/bytecode/orig.CodeOrigin.h
+++ Source/JavaScriptCore/bytecode/CodeOrigin.h
@@ -35,7 +35,7 @@
#include <wtf/Vector.h>

#if OS(DARWIN)
-#include <mach/vm_param.h>
+#include <mach/mach_vm.h>
#endif

namespace JSC {
16 changes: 16 additions & 0 deletions www/webkit2-gtk-devel/files/patch-mactypes.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git Source/JavaScriptCore/API/orig.WebKitAvailability.h Source/JavaScriptCore/API/WebKitAvailability.h
index 11e4087..4ef0b7c 100644
--- Source/JavaScriptCore/API/orig.WebKitAvailability.h
+++ Source/JavaScriptCore/API/WebKitAvailability.h
@@ -28,6 +28,11 @@

#if defined(__APPLE__)

+#if defined(BUILDING_GTK__)
+// prevent clash with old QuickDraw symbols in /usr/include/MacTypes.h
+#include <JavaScriptCore/MacTypes.h>
+#endif
+
#include <AvailabilityMacros.h>
#include <CoreFoundation/CoreFoundation.h>

Loading