Wed Aug 1 15:01:09 2018 UTC ()
qtwebkit: don't disable JIT on netbsd, declare functions like linux.

this works well enough to browse javascript websites with otter-browser,
which needed paxctl +m, although I didn't try it without these changes.

XXX this package might be crashing from feeding bogus values to
posix_memalign.


(maya)
diff -r1.54 -r1.55 pkgsrc/x11/qt5-qtwebkit/Makefile
diff -r1.11 -r1.12 pkgsrc/x11/qt5-qtwebkit/distinfo
diff -r0 -r1.1 pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_JavaScriptCore_jit_ThunkGenerators.cpp
diff -r1.3 -r1.4 pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_Platform.h

cvs diff -r1.54 -r1.55 pkgsrc/x11/qt5-qtwebkit/Makefile (expand / switch to unified diff)

--- pkgsrc/x11/qt5-qtwebkit/Makefile 2018/07/20 03:34:01 1.54
+++ pkgsrc/x11/qt5-qtwebkit/Makefile 2018/08/01 15:01:08 1.55
@@ -1,43 +1,44 @@ @@ -1,43 +1,44 @@
1# $NetBSD: Makefile,v 1.54 2018/07/20 03:34:01 ryoon Exp $ 1# $NetBSD: Makefile,v 1.55 2018/08/01 15:01:08 maya Exp $
2 2
3DISTNAME= qtwebkit-${QTWKVERSION} 3DISTNAME= qtwebkit-${QTWKVERSION}
4PKGNAME= qt5-qtwebkit-${QTWKVERSION:S/-/./} 4PKGNAME= qt5-qtwebkit-${QTWKVERSION:S/-/./}
5PKGREVISION= 7 5PKGREVISION= 8
6MASTER_SITES= ${MASTER_SITE_GITHUB:=annulen/} 6MASTER_SITES= ${MASTER_SITE_GITHUB:=annulen/}
7GITHUB_PROJECT= webkit 7GITHUB_PROJECT= webkit
8GITHUB_RELEASE= ${DISTNAME} 8GITHUB_RELEASE= ${DISTNAME}
9#MASTER_SITES= https://github.com/annulen/webkit/releases/download/qtwebkit-${QTWKVERSION}/ 9#MASTER_SITES= https://github.com/annulen/webkit/releases/download/qtwebkit-${QTWKVERSION}/
10CATEGORIES= x11 10CATEGORIES= x11
11 11
12MAINTAINER= pkgsrc-users@NetBSD.org 12MAINTAINER= pkgsrc-users@NetBSD.org
13HOMEPAGE= http://qt-project.org/ 13HOMEPAGE= http://qt-project.org/
14COMMENT= Qt5 WebView module 14COMMENT= Qt5 WebView module
15LICENSE= gnu-lgpl-v2.1 AND gnu-gpl-v3 15LICENSE= gnu-lgpl-v2.1 AND gnu-gpl-v3
16EXTRACT_SUFX= .tar.xz 16EXTRACT_SUFX= .tar.xz
17 17
18QTWKVERSION= 5.212.0-alpha2 18QTWKVERSION= 5.212.0-alpha2
19 19
20PYTHON_VERSIONS_ACCEPTED= 27 # as if 5.212.0-alpha2 20PYTHON_VERSIONS_ACCEPTED= 27 # as if 5.212.0-alpha2
21 21
22.include "../../mk/dlopen.buildlink3.mk" 22.include "../../mk/dlopen.buildlink3.mk"
23BUILDLINK_TRANSFORM+= opt:-ldl:${BUILDLINK_LDADD.dl:M*} 23BUILDLINK_TRANSFORM+= opt:-ldl:${BUILDLINK_LDADD.dl:M*}
24 24
25USE_LANGUAGES= c c++11 25USE_LANGUAGES= c c++11
26USE_TOOLS+= gmake perl:build pkg-config bison flex sed 26USE_TOOLS+= gmake perl:build pkg-config bison flex sed
27USE_CMAKE= yes 27USE_CMAKE= yes
28CMAKE_ARG_PATH= .. 28CMAKE_ARG_PATH= ..
29CONFIGURE_DIRS= _build 29CONFIGURE_DIRS= _build
30CMAKE_INSTALL_PREFIX= ${PREFIX}/qt5 30CMAKE_INSTALL_PREFIX= ${PREFIX}/qt5
 31TEST_TARGET= test
31 32
32CMAKE_ARGS+= -DPORT=Qt 33CMAKE_ARGS+= -DPORT=Qt
33CMAKE_ARGS+= -DENABLE_TOOLS=OFF 34CMAKE_ARGS+= -DENABLE_TOOLS=OFF
34CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release 35CMAKE_ARGS+= -DCMAKE_BUILD_TYPE=Release
35CMAKE_ARGS+= -DSHARED_CORE:BOOL=ON 36CMAKE_ARGS+= -DSHARED_CORE:BOOL=ON
36CMAKE_ARGS+= -DUSE_SYSTEM_MALLOC:BOOL=ON 37CMAKE_ARGS+= -DUSE_SYSTEM_MALLOC:BOOL=ON
37CMAKE_ARGS+= -DUSE_LD_GOLD:BOOL=OFF 38CMAKE_ARGS+= -DUSE_LD_GOLD:BOOL=OFF
38## requires gcc >= 4.9 39## requires gcc >= 4.9
39#CMAKE_ARGS+= -DENABLE_FTL_JIT:BOOL=OFF 40#CMAKE_ARGS+= -DENABLE_FTL_JIT:BOOL=OFF
40#CMAKE_ARGS+= -DENABLE_INDEXED_DATABASE:BOOL=OFF 41#CMAKE_ARGS+= -DENABLE_INDEXED_DATABASE:BOOL=OFF
41## needs JIT and ASSEMBLER 42## needs JIT and ASSEMBLER
42CMAKE_ARGS+= -DENABLE_SAMPLING_PROFILER:BOOL=OFF 43CMAKE_ARGS+= -DENABLE_SAMPLING_PROFILER:BOOL=OFF
43 44

cvs diff -r1.11 -r1.12 pkgsrc/x11/qt5-qtwebkit/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/qt5-qtwebkit/distinfo 2018/01/17 19:37:33 1.11
+++ pkgsrc/x11/qt5-qtwebkit/distinfo 2018/08/01 15:01:08 1.12
@@ -1,25 +1,26 @@ @@ -1,25 +1,26 @@
1$NetBSD: distinfo,v 1.11 2018/01/17 19:37:33 markd Exp $ 1$NetBSD: distinfo,v 1.12 2018/08/01 15:01:08 maya Exp $
2 2
3SHA1 (qtwebkit-5.212.0-alpha2.tar.xz) = 6a361cc3f3b7ab1d35955bafe20fbbae61bc80c8 3SHA1 (qtwebkit-5.212.0-alpha2.tar.xz) = 6a361cc3f3b7ab1d35955bafe20fbbae61bc80c8
4RMD160 (qtwebkit-5.212.0-alpha2.tar.xz) = 33c3f7c68090fa16f72950ef85c20978432cc058 4RMD160 (qtwebkit-5.212.0-alpha2.tar.xz) = 33c3f7c68090fa16f72950ef85c20978432cc058
5SHA512 (qtwebkit-5.212.0-alpha2.tar.xz) = b15985aab20c5618dc1f71a0d91f02dbed993516272090a4a12990714bf4c9554ccbdcf9d6a143bf46fcc2c170f691e571114d61686fe49791f8d5c540785758 5SHA512 (qtwebkit-5.212.0-alpha2.tar.xz) = b15985aab20c5618dc1f71a0d91f02dbed993516272090a4a12990714bf4c9554ccbdcf9d6a143bf46fcc2c170f691e571114d61686fe49791f8d5c540785758
6Size (qtwebkit-5.212.0-alpha2.tar.xz) = 12456284 bytes 6Size (qtwebkit-5.212.0-alpha2.tar.xz) = 12456284 bytes
7SHA1 (patch-Source_JavaScriptCore_API_ObjCCallbackFunction.h) = be77c4b19f5f97c12180c1b7d3b72968364f3229 7SHA1 (patch-Source_JavaScriptCore_API_ObjCCallbackFunction.h) = be77c4b19f5f97c12180c1b7d3b72968364f3229
8SHA1 (patch-Source_JavaScriptCore_assembler_ARMAssembler.h) = 7bbb0a59a0c087abaaddda08fc31aa24809acb70 8SHA1 (patch-Source_JavaScriptCore_assembler_ARMAssembler.h) = 7bbb0a59a0c087abaaddda08fc31aa24809acb70
9SHA1 (patch-Source_JavaScriptCore_assembler_MacroAssemblerARM.cpp) = 79b54cb1d03d976a0629fbd8ee9ac1881951ba10 9SHA1 (patch-Source_JavaScriptCore_assembler_MacroAssemblerARM.cpp) = 79b54cb1d03d976a0629fbd8ee9ac1881951ba10
10SHA1 (patch-Source_JavaScriptCore_dfg_DFGNode.h) = a3eba122c7226a80dacf1b762747fe0a7408b849 10SHA1 (patch-Source_JavaScriptCore_dfg_DFGNode.h) = a3eba122c7226a80dacf1b762747fe0a7408b849
11SHA1 (patch-Source_JavaScriptCore_heap_MachineStackMarker.cpp) = a5815dd5794d9ffbd49e5793198a06535ad89d3c 11SHA1 (patch-Source_JavaScriptCore_heap_MachineStackMarker.cpp) = a5815dd5794d9ffbd49e5793198a06535ad89d3c
 12SHA1 (patch-Source_JavaScriptCore_jit_ThunkGenerators.cpp) = f0ca56e4b4060c0a8d756289d7c25d1ead6b07be
12SHA1 (patch-Source_JavaScriptCore_tools_CodeProfiling.cpp) = 94c139413eecb875bba98c7749bba24cfcc16632 13SHA1 (patch-Source_JavaScriptCore_tools_CodeProfiling.cpp) = 94c139413eecb875bba98c7749bba24cfcc16632
13SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = 1e4b8cffbd7ec0a6130a0ec2112023bed5c0b78e 14SHA1 (patch-Source_ThirdParty_gtest_include_gtest_internal_gtest-port.h) = 1e4b8cffbd7ec0a6130a0ec2112023bed5c0b78e
14SHA1 (patch-Source_WTF_wtf_Assertions.cpp) = 15b8ac40e49cfec78d46de634fd6a1edde2d2a96 15SHA1 (patch-Source_WTF_wtf_Assertions.cpp) = 15b8ac40e49cfec78d46de634fd6a1edde2d2a96
15SHA1 (patch-Source_WTF_wtf_InlineASM.h) = 64ea54605fbe787be57f7423e33802def66d6432 16SHA1 (patch-Source_WTF_wtf_InlineASM.h) = 64ea54605fbe787be57f7423e33802def66d6432
16SHA1 (patch-Source_WTF_wtf_MathExtras.h) = 7dac41bf3e50944e49c3e3c29d482d2c3300665d 17SHA1 (patch-Source_WTF_wtf_MathExtras.h) = 7dac41bf3e50944e49c3e3c29d482d2c3300665d
17SHA1 (patch-Source_WTF_wtf_Platform.h) = cfffb219f1d58d937ae46440aa5395aa066669e4 18SHA1 (patch-Source_WTF_wtf_Platform.h) = 73e8b07e8d7e718abe986a12b9f0b903dfcc4765
18SHA1 (patch-Source_WTF_wtf_ThreadIdentifierDataPthreads.cpp) = bfa570aa20e3508c77bbaebed051821a33f36209 19SHA1 (patch-Source_WTF_wtf_ThreadIdentifierDataPthreads.cpp) = bfa570aa20e3508c77bbaebed051821a33f36209
19SHA1 (patch-Source_WebCore_page_NavigatorBase.cpp) = e8972f4b703a9ff45ce313609d2540f89064b4ff 20SHA1 (patch-Source_WebCore_page_NavigatorBase.cpp) = e8972f4b703a9ff45ce313609d2540f89064b4ff
20SHA1 (patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp) = dd409929936955ad31b8ec0902067e2f23c054a2 21SHA1 (patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp) = dd409929936955ad31b8ec0902067e2f23c054a2
21SHA1 (patch-Source_WebCore_platform_graphics_surfaces_GraphicsSurface.h) = d1d986afd5525143fc786a959240a72167f03352 22SHA1 (patch-Source_WebCore_platform_graphics_surfaces_GraphicsSurface.h) = d1d986afd5525143fc786a959240a72167f03352
22SHA1 (patch-Source_WebCore_platform_graphics_surfaces_GraphicsSurfaceToken.h) = 838acb2d7ecf41e5f6989d98459d103f4268cdcf 23SHA1 (patch-Source_WebCore_platform_graphics_surfaces_GraphicsSurfaceToken.h) = 838acb2d7ecf41e5f6989d98459d103f4268cdcf
23SHA1 (patch-Source_WebKit2_Platform_unix_SharedMemoryUnix.cpp) = d18013d0e07d7ad7e9d84cb6ef2d418d9bba4c7e 24SHA1 (patch-Source_WebKit2_Platform_unix_SharedMemoryUnix.cpp) = d18013d0e07d7ad7e9d84cb6ef2d418d9bba4c7e
24SHA1 (patch-Source_WebKit_PlatformQt.cmake) = 5dfde3b2e3092ffcd11fc6746bed1767b2c3b692 25SHA1 (patch-Source_WebKit_PlatformQt.cmake) = 5dfde3b2e3092ffcd11fc6746bed1767b2c3b692
25SHA1 (patch-Source_cmake_OptionsQt.cmake) = 2527e56468709bd9fd0a98bf754ac9c692cac4dc 26SHA1 (patch-Source_cmake_OptionsQt.cmake) = 2527e56468709bd9fd0a98bf754ac9c692cac4dc

File Added: pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_JavaScriptCore_jit_ThunkGenerators.cpp
$NetBSD: patch-Source_JavaScriptCore_jit_ThunkGenerators.cpp,v 1.1 2018/08/01 15:01:08 maya Exp $

Treat netbsd as linux for JIT purposes.

--- Source/JavaScriptCore/jit/ThunkGenerators.cpp.orig	2017-06-04 20:16:05.000000000 +0000
+++ Source/JavaScriptCore/jit/ThunkGenerators.cpp
@@ -633,7 +633,7 @@ MacroAssemblerCodeRef sqrtThunkGenerator
 enum MathThunkCallingConvention { };
 typedef MathThunkCallingConvention(*MathThunk)(MathThunkCallingConvention);
 
-#if CPU(X86_64) && COMPILER(GCC_OR_CLANG) && (OS(DARWIN) || OS(LINUX))
+#if CPU(X86_64) && COMPILER(GCC_OR_CLANG) && (OS(DARWIN) || OS(LINUX) || OS(NETBSD))
 
 #define defineUnaryDoubleOpWrapper(function) \
     asm( \
@@ -651,7 +651,7 @@ typedef MathThunkCallingConvention(*Math
     } \
     static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
 
-#elif CPU(X86) && COMPILER(GCC_OR_CLANG) && OS(LINUX) && defined(__PIC__)
+#elif CPU(X86) && COMPILER(GCC_OR_CLANG) && (OS(LINUX) || OS(NETBSD)) && defined(__PIC__)
 #define defineUnaryDoubleOpWrapper(function) \
     asm( \
         ".text\n" \
@@ -675,7 +675,7 @@ typedef MathThunkCallingConvention(*Math
     } \
     static MathThunk UnaryDoubleOpWrapper(function) = &function##Thunk;
 
-#elif CPU(X86) && COMPILER(GCC_OR_CLANG) && (OS(DARWIN) || OS(LINUX))
+#elif CPU(X86) && COMPILER(GCC_OR_CLANG) && (OS(DARWIN) || OS(LINUX) || OS(NETBSD))
 #define defineUnaryDoubleOpWrapper(function) \
     asm( \
         ".text\n" \

cvs diff -r1.3 -r1.4 pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_Platform.h (expand / switch to unified diff)

--- pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_Platform.h 2018/01/17 19:37:33 1.3
+++ pkgsrc/x11/qt5-qtwebkit/patches/patch-Source_WTF_wtf_Platform.h 2018/08/01 15:01:08 1.4
@@ -1,34 +1,23 @@ @@ -1,34 +1,23 @@
1$NetBSD: patch-Source_WTF_wtf_Platform.h,v 1.3 2018/01/17 19:37:33 markd Exp $ 1$NetBSD: patch-Source_WTF_wtf_Platform.h,v 1.4 2018/08/01 15:01:08 maya Exp $
2 2
3* Disable JIT support for NetBSD, fix segfault of qtwebkit consumers 
4* Use system's malloc for NetBSD, do not use fastmalloc from qt5, 3* Use system's malloc for NetBSD, do not use fastmalloc from qt5,
5 fix segfault of qtwebkit consumers 4 fix segfault of qtwebkit consumers
6 5
7* Disable DISASSEMBLER on Linux. Unresolved symbols as not building 6* Disable DISASSEMBLER on Linux. Unresolved symbols as not building
8 UDis86Disassembler.cpp for some reason. 7 UDis86Disassembler.cpp for some reason.
9 8
10--- Source/WTF/wtf/Platform.h.orig 2017-06-04 20:16:06.000000000 +0000 9--- Source/WTF/wtf/Platform.h.orig 2017-06-04 20:16:06.000000000 +0000
11+++ Source/WTF/wtf/Platform.h 10+++ Source/WTF/wtf/Platform.h
12@@ -36,6 +36,9 @@ 
13 macros, policy decision macros, and top-level port definitions. ==== */ 
14 #define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE && WTF_PLATFORM_##WTF_FEATURE) 
15  
16+#if defined(__NetBSD__) 
17+#define ENABLE_JIT 0 
18+#endif 
19  
20 /* ==== Platform adaptation macros: these describe properties of the target environment. ==== */ 
21  
22@@ -691,6 +694,12 @@ 11@@ -691,6 +694,12 @@
23 #define USE_SYSTEM_MALLOC 1 12 #define USE_SYSTEM_MALLOC 1
24 #endif 13 #endif
25  14
26+/* Workaround an issue with fastMalloc on NetBSD */ 15+/* Workaround an issue with fastMalloc on NetBSD */
27+#if OS(NETBSD) 16+#if OS(NETBSD)
28+#define USE_SYSTEM_MALLOC 1 17+#define USE_SYSTEM_MALLOC 1
29+#define ENABLE_ASSEMBLER 1 18+#define ENABLE_ASSEMBLER 1
30+#endif 19+#endif
31+ 20+
32 #define ENABLE_DEBUG_WITH_BREAKPOINT 0 21 #define ENABLE_DEBUG_WITH_BREAKPOINT 0
33 #define ENABLE_SAMPLING_COUNTERS 0 22 #define ENABLE_SAMPLING_COUNTERS 0
34 #define ENABLE_SAMPLING_FLAGS 0 23 #define ENABLE_SAMPLING_FLAGS 0