summaryrefslogtreecommitdiffstats
path: root/src/qtwebkit-1-fixes.patch
blob: fa8dbe1e87f02d2872464ab30dcd90b4c0836a98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Fri, 11 Jan 2019 18:02:55 +1100
Subject: [PATCH 1/4] ad hoc fixes


diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index 1111111..2222222 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -1714,7 +1714,7 @@ int main(int argc, char** argv)
     fesetenv( &env );
 #endif
 
-#if OS(WINDOWS) && (defined(_M_X64) || defined(__x86_64__))
+#if OS(WINDOWS) && (defined(_M_X64) || defined(__x86_64__)) && !COMPILER(GCC)
     // The VS2013 runtime has a bug where it mis-detects AVX-capable processors
     // if the feature has been disabled in firmware. This causes us to crash
     // in some of the math functions. For now, we disable those optimizations
diff --git a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
index 1111111..2222222 100644
--- a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+++ b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
@@ -92,13 +92,13 @@
 #define OFFLINE_ASM_ARM 0
 #endif
 
-#if CPU(X86_64) && !COMPILER(MSVC)
+#if CPU(X86_64) && !OS(WINDOWS)
 #define OFFLINE_ASM_X86_64 1
 #else
 #define OFFLINE_ASM_X86_64 0
 #endif
 
-#if CPU(X86_64) && COMPILER(MSVC)
+#if CPU(X86_64) && OS(WINDOWS)
 #define OFFLINE_ASM_X86_64_WIN 1
 #else
 #define OFFLINE_ASM_X86_64_WIN 0
diff --git a/Source/WTF/wtf/Atomics.h b/Source/WTF/wtf/Atomics.h
index 1111111..2222222 100644
--- a/Source/WTF/wtf/Atomics.h
+++ b/Source/WTF/wtf/Atomics.h
@@ -125,7 +125,7 @@ inline void memoryBarrierBeforeUnlock() { armV7_dmb(); }
 
 inline void x86_mfence()
 {
-#if OS(WINDOWS)
+#if OS(WINDOWS) && !COMPILER(GCC)
     // I think that this does the equivalent of a dummy interlocked instruction,
     // instead of using the 'mfence' instruction, at least according to MSDN. I
     // know that it is equivalent for our purposes, but it would be good to
diff --git a/Source/WTF/wtf/CurrentTime.cpp b/Source/WTF/wtf/CurrentTime.cpp
index 1111111..2222222 100644
--- a/Source/WTF/wtf/CurrentTime.cpp
+++ b/Source/WTF/wtf/CurrentTime.cpp
@@ -91,6 +91,35 @@ static double lowResUTCTime()
 
 #if USE(QUERY_PERFORMANCE_COUNTER)
 
+#if defined(_WIN32) && (defined(__x86_64__) || defined(_AMD64_)) && _WIN32_WINNT < 0x0600
+/* GetTickCount64() is not available on XP. */
+ULONGLONG GetTickCount64 ()
+{
+    static ULONGLONG (CALLBACK *DynGetTickCount64)() = (ULONGLONG (*)(void))-1;
+    static DWORD last_ticks = 0;
+    static DWORD n_overflow = 0;
+    DWORD ticks = 0;
+    HINSTANCE hKernel32;
+
+    if (DynGetTickCount64 == (void*)-1)
+    {
+        hKernel32 = GetModuleHandleW(L"KERNEL32");
+        DynGetTickCount64 = *(ULONGLONG (*)(void))(GetProcAddress(hKernel32,
+                                        "GetTickCount64"));
+    }
+    if (DynGetTickCount64 != (void*) NULL)
+    {
+        return DynGetTickCount64();
+    }
+
+    ticks = GetTickCount();
+    if (ticks < last_ticks)
+        n_overflow++;
+    last_ticks = ticks;
+    return ((ULONGLONG)n_overflow << 32LL) + (ULONGLONG)GetTickCount();
+}
+#endif
+
 static LARGE_INTEGER qpcFrequency;
 static bool syncedTime;
 
diff --git a/Source/WebCore/bindings/scripts/preprocess-idls.pl b/Source/WebCore/bindings/scripts/preprocess-idls.pl
index 1111111..2222222 100644
--- a/Source/WebCore/bindings/scripts/preprocess-idls.pl
+++ b/Source/WebCore/bindings/scripts/preprocess-idls.pl
@@ -179,9 +179,9 @@ my $cygwinPathAdded;
 sub CygwinPathIfNeeded
 {
     my $path = shift;
-    if ($path && $Config{osname} eq "cygwin") {
+    if ($path && ($Config{osname} eq "cygwin" || $Config{osname} eq "msys")) {
         if (not $cygwinPathAdded) {
-            $ENV{PATH} = "$ENV{PATH}:/cygdrive/c/cygwin/bin";
+            $ENV{PATH} = "$ENV{PATH}:/usr/bin";
             $cygwinPathAdded = 1; 
         }
         chomp($path = `cygpath -u '$path'`);
diff --git a/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py b/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
index 1111111..2222222 100644
--- a/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
+++ b/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py
@@ -57,7 +57,7 @@ def enumerablePseudoType(stringPseudoType):
 def expand_ifdef_condition(condition):
     return condition.replace('(', '_').replace(')', '')
 
-output_file = open('SelectorPseudoClassAndCompatibilityElementMap.gperf', 'w')
+output_file = open('SelectorPseudoClassAndCompatibilityElementMap.gperf', 'wb')
 
 output_file.write("""
 %{
diff --git a/Source/WebCore/css/makeSelectorPseudoElementsMap.py b/Source/WebCore/css/makeSelectorPseudoElementsMap.py
index 1111111..2222222 100644
--- a/Source/WebCore/css/makeSelectorPseudoElementsMap.py
+++ b/Source/WebCore/css/makeSelectorPseudoElementsMap.py
@@ -57,7 +57,7 @@ def enumerablePseudoType(stringPseudoType):
 def expand_ifdef_condition(condition):
     return condition.replace('(', '_').replace(')', '')
 
-output_file = open('SelectorPseudoElementTypeMap.gperf', 'w')
+output_file = open('SelectorPseudoElementTypeMap.gperf', 'wb')
 
 output_file.write("""
 %{
diff --git a/Source/WebCore/platform/network/create-http-header-name-table b/Source/WebCore/platform/network/create-http-header-name-table
index 1111111..2222222 100755
--- a/Source/WebCore/platform/network/create-http-header-name-table
+++ b/Source/WebCore/platform/network/create-http-header-name-table
@@ -54,7 +54,7 @@ input_file.close()
 
 http_header_names.sort()
 
-gperf_file = open('HTTPHeaderNames.gperf', 'w')
+gperf_file = open('HTTPHeaderNames.gperf', 'wb')
 gperf_file.write('''
 %{
 /*
diff --git a/Source/cmake/ECMGeneratePriFile.cmake b/Source/cmake/ECMGeneratePriFile.cmake
index 1111111..2222222 100644
--- a/Source/cmake/ECMGeneratePriFile.cmake
+++ b/Source/cmake/ECMGeneratePriFile.cmake
@@ -101,7 +101,11 @@ if(KDE_INSTALL_USE_QT_SYS_PATHS OR _askqmake)
   query_qmake(qt_host_data_dir QT_HOST_DATA)
   set(ECM_MKSPECS_INSTALL_DIR ${qt_host_data_dir}/mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
 else()
-  set(ECM_MKSPECS_INSTALL_DIR mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
+  if(MINGW)
+    set(ECM_MKSPECS_INSTALL_DIR share/qt5/mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
+  else()
+    set(ECM_MKSPECS_INSTALL_DIR mkspecs/modules CACHE PATH "The directory where mkspecs will be installed to.")
+  endif()
 endif()
 
 function(ECM_GENERATE_PRI_FILE)
diff --git a/Source/cmake/FindICU.cmake b/Source/cmake/FindICU.cmake
index 1111111..2222222 100644
--- a/Source/cmake/FindICU.cmake
+++ b/Source/cmake/FindICU.cmake
@@ -49,7 +49,7 @@ if (ICU_INCLUDE_DIR AND ICU_LIBRARY)
     pkg_check_modules(PC_ICU_I18N icu-i18n)
     find_library(
         ICU_I18N_LIBRARY
-        NAMES icui18n icuin cygicuin cygicuin32
+        NAMES icuin icui18n cygicuin cygicuin32
         HINTS ${PC_ICU_I18N_LIBRARY_DIRS}
               ${PC_ICU_I18N_LIBDIR}
         DOC "Libraries to link against for ICU internationalization")

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Konstantin Tokarev <annulen@yandex.ru>
Date: Fri, 3 Nov 2017 18:59:25 +0300
Subject: [PATCH 2/4] Install private headers for WK2 and private .pri modules

Change-Id: Ie2f52c600180fd31cc5fac2f5d30952df28ea9d6

diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake
index 1111111..2222222 100644
--- a/Source/WebKit/PlatformQt.cmake
+++ b/Source/WebKit/PlatformQt.cmake
@@ -418,7 +418,7 @@ install(
     COMPONENT Data
 )
 
-file(GLOB WebKit_PRIVATE_HEADERS qt/Api/*_p.h)
+file(GLOB WebKit_PRIVATE_HEADERS qt/Api/*_p.h ../WebKit2/UIProcess/API/qt/*_p.h)
 install(
     FILES
         ${WebKit_PRIVATE_HEADERS}
@@ -510,7 +510,7 @@ if (NOT MACOS_BUILD_FRAMEWORKS)
     install(FILES ${WebKit_PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR} COMPONENT Data)
 endif ()
 
-if (KDE_INSTALL_USE_QT_SYS_PATHS)
+if (KDE_INSTALL_USE_QT_SYS_PATHS OR MINGW)
     set(WebKit_PRI_ARGUMENTS
         BIN_INSTALL_DIR "$$QT_MODULE_BIN_BASE"
         LIB_INSTALL_DIR "$$QT_MODULE_LIB_BASE"
@@ -734,7 +734,7 @@ if (NOT MACOS_BUILD_FRAMEWORKS)
     install(FILES ${WebKitWidgets_PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR} COMPONENT Data)
 endif ()
 
-if (KDE_INSTALL_USE_QT_SYS_PATHS)
+if (KDE_INSTALL_USE_QT_SYS_PATHS OR MINGW)
     set(WebKitWidgets_PRI_ARGUMENTS
         BIN_INSTALL_DIR "$$QT_MODULE_BIN_BASE"
         LIB_INSTALL_DIR "$$QT_MODULE_LIB_BASE"
diff --git a/Source/cmake/WebKitMacros.cmake b/Source/cmake/WebKitMacros.cmake
index 1111111..2222222 100644
--- a/Source/cmake/WebKitMacros.cmake
+++ b/Source/cmake/WebKitMacros.cmake
@@ -265,8 +265,6 @@ macro(WEBKIT_FRAMEWORK _target)
         ${${_target}_HEADERS}
         ${${_target}_SOURCES}
         ${${_target}_DERIVED_SOURCES}
-        ${${_target}_PRIVATE_HEADERS}
-        ${${_target}_PUBLIC_HEADERS}
     )
     target_link_libraries(${_target} ${${_target}_LIBRARIES})
     set_target_properties(${_target} PROPERTIES COMPILE_DEFINITIONS "BUILDING_${_target}")

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Pek <tehnick-8@yandex.ru>
Date: Fri, 11 Jan 2019 18:06:01 +1100
Subject: [PATCH 3/4] cmake: fix Cflags sections in pkg-config files


diff --git a/Source/cmake/ECMGeneratePkgConfigFile.cmake b/Source/cmake/ECMGeneratePkgConfigFile.cmake
index 1111111..2222222 100644
--- a/Source/cmake/ECMGeneratePkgConfigFile.cmake
+++ b/Source/cmake/ECMGeneratePkgConfigFile.cmake
@@ -129,6 +129,7 @@ function(ECM_GENERATE_PKGCONFIG_FILE)
       else()
           set(EGPF_INCLUDE_INSTALL_DIR "include/${EGPF_BASE_NAME}")
       endif()
+      string(REPLACE "/Qt5" "/Qt" EGPF_INCLUDE_INSTALL_DIR "${EGPF_INCLUDE_INSTALL_DIR}")
   endif()
   if(NOT EGPF_LIB_INSTALL_DIR)
       if(LIB_INSTALL_DIR)

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Pek <tehnick-8@yandex.ru>
Date: Fri, 11 Jan 2019 18:07:10 +1100
Subject: [PATCH 4/4] Fix cross-compilation using MinGW

with USE_MEDIA_FOUNDATION=ON. (Part 1)

diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h
index 1111111..2222222 100644
--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h
+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h
@@ -31,12 +31,13 @@
 #include "MediaPlayerPrivate.h"
 #include "Win32Handle.h"
 
-#include <D3D9.h>
-#include <Dxva2api.h>
+#include <d3d9.h>
+#include <dxva2api.h>
 
-#include <Mfapi.h>
-#include <Mferror.h>
-#include <Mfidl.h>
+#include <mfapi.h>
+#include <mferror.h>
+#include <mfidl.h>
+#include <mfobjects.h>
 #include <evcode.h>
 #include <evr.h>
 
diff --git a/Source/WebCore/platform/win/HWndDC.h b/Source/WebCore/platform/win/HWndDC.h
index 1111111..2222222 100644
--- a/Source/WebCore/platform/win/HWndDC.h
+++ b/Source/WebCore/platform/win/HWndDC.h
@@ -27,7 +27,7 @@
 #define HWndDC_h
 
 #include <windows.h>
-#include <wtf/NonCopyable.h>
+#include <wtf/Noncopyable.h>
 
 namespace WebCore {