Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jun 2018 03:40:38 +0000 (UTC)
From:      Fukang Chen <loader@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r472754 - in head/lang/phantomjs: . files
Message-ID:  <201806190340.w5J3ecf8082451@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: loader (doc committer)
Date: Tue Jun 19 03:40:38 2018
New Revision: 472754
URL: https://svnweb.freebsd.org/changeset/ports/472754

Log:
  lang/phantomjs: Allow building on armv6 and armv7 platforms
  
  - Patches for armv6 and armv7 are obtained from www/webkit-gtk3
  - Allow building with non-default LOCALBASE
  - Fix build with Clang 6.0.0 [0]
  
  PR:		225482 [0]
  Reviewed by:	koobs, feld
  Approved by:	koobs (mentor), feld (maintainner)
  Differential Revision:	https://reviews.freebsd.org/D15850

Added:
  head/lang/phantomjs/files/patch-src_qt_qtbase_mkspecs_freebsd-clang_qmake.conf   (contents, props changed)
  head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_JavaScriptCore_assembler_ARMAssembler.h   (contents, props changed)
  head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WTF_wtf_Platform.h   (contents, props changed)
  head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp   (contents, props changed)
  head/lang/phantomjs/files/patch-src_webpage.cpp   (contents, props changed)
Modified:
  head/lang/phantomjs/Makefile

Modified: head/lang/phantomjs/Makefile
==============================================================================
--- head/lang/phantomjs/Makefile	Tue Jun 19 02:46:53 2018	(r472753)
+++ head/lang/phantomjs/Makefile	Tue Jun 19 03:40:38 2018	(r472754)
@@ -12,8 +12,6 @@ LICENSE=	BSD3CLAUSE
 
 BROKEN_powerpc64=	fails to build: g++48: not found
 BROKEN_sparc64=		does not link on sparc64
-NOT_FOR_ARCHS=		armv6 armv7
-NOT_FOR_ARCHS_REASON=	Platform.h: Not supported ARM architecture
 BROKEN_SSL=	openssl-devel
 BROKEN_SSL_REASON_openssl-devel=	error: member access into incomplete type 'X509' (aka 'x509_st')
 
@@ -52,7 +50,7 @@ post-extract:
 	${MKDIR} ${WRKSRC}/src/qt/qtwebkit/.git
 	${RM} ${WRKSRC}/src/qt/qtwebkit/Source/WebCore/DerivedSources.cpp
 
-_ENV=	CC=${CC} CXX=${CXX} GMAKE=${GMAKE} OSTYPE=freebsd MAKEFLAGS=
+_ENV=	CC=${CC} CXX=${CXX} GMAKE=${GMAKE} OSTYPE=freebsd MAKEFLAGS= LOCALBASE=${LOCALBASE}
 _BLD=	${PYTHON_CMD} build.py --jobs ${MAKE_JOBS_NUMBER} --confirm
 do-build:
 .if defined(_PHANTOMJS_USE_QT_SYSTEM)

Added: head/lang/phantomjs/files/patch-src_qt_qtbase_mkspecs_freebsd-clang_qmake.conf
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-src_qt_qtbase_mkspecs_freebsd-clang_qmake.conf	Tue Jun 19 03:40:38 2018	(r472754)
@@ -0,0 +1,13 @@
+--- src/qt/qtbase/mkspecs/freebsd-clang/qmake.conf.orig	2017-03-26 06:45:23 UTC
++++ src/qt/qtbase/mkspecs/freebsd-clang/qmake.conf
+@@ -10,8 +10,8 @@ QMAKE_CFLAGS_THREAD     = -pthread -D_TH
+ QMAKE_CXXFLAGS_THREAD   = $$QMAKE_CFLAGS_THREAD
+ 
+ # Addon software goes into /usr/local on the BSDs, by default we will look there
+-QMAKE_INCDIR            = /usr/local/include
+-QMAKE_LIBDIR            = /usr/local/lib
++QMAKE_INCDIR            = $$(LOCALBASE)/include
++QMAKE_LIBDIR            = $$(LOCALBASE)/lib
+ 
+ QMAKE_LFLAGS_NOUNDEF    = -Wl,--no-undefined
+ QMAKE_LFLAGS_THREAD     = -pthread

Added: head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_JavaScriptCore_assembler_ARMAssembler.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_JavaScriptCore_assembler_ARMAssembler.h	Tue Jun 19 03:40:38 2018	(r472754)
@@ -0,0 +1,17 @@
+assembler/ARMAssembler.h:1073:2: error: "The cacheFlush support is missing on this platform."
+#error "The cacheFlush support is missing on this platform."
+ ^
+
+Obtained from: www/webkit-gtk3/files/patch-Source__JavaScriptCore__assembler__ARMAssembler.h
+
+--- src/qt/qtwebkit/Source/JavaScriptCore/assembler/ARMAssembler.h.orig	2016-01-08 10:07:46 UTC
++++ src/qt/qtwebkit/Source/JavaScriptCore/assembler/ARMAssembler.h
+@@ -1069,6 +1069,8 @@ namespace JSC {
+             UNUSED_PARAM(size);
+ #elif OS(QNX)
+             msync(code, size, MS_INVALIDATE_ICACHE);
++#elif CPU(ARM_TRADITIONAL) && OS(FREEBSD) && COMPILER(CLANG)
++            __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ #else
+ #error "The cacheFlush support is missing on this platform."
+ #endif

Added: head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WTF_wtf_Platform.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WTF_wtf_Platform.h	Tue Jun 19 03:40:38 2018	(r472754)
@@ -0,0 +1,19 @@
+On armv6 platform:
+./wtf/Platform.h:323:6: error: "Not supported ARM architecture"
+#    error "Not supported ARM architecture"
+     ^
+
+Obtained from: www/webkit-gtk3/files/patch-Source_WTF_wtf_Platform.h
+
+This patch reportedly fixes build for ARM. See PR 208569
+
+--- src/qt/qtwebkit/Source/WTF/wtf/Platform.h.orig	2018-06-14 11:03:55 UTC
++++ src/qt/qtwebkit/Source/WTF/wtf/Platform.h
+@@ -232,6 +232,7 @@
+ #elif defined(__ARM_ARCH_6__) \
+     || defined(__ARM_ARCH_6J__) \
+     || defined(__ARM_ARCH_6K__) \
++    || defined(__ARM_ARCH_6KZ__) \
+     || defined(__ARM_ARCH_6Z__) \
+     || defined(__ARM_ARCH_6ZK__) \
+     || defined(__ARM_ARCH_6T2__) \

Added: head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-src_qt_qtwebkit_Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp	Tue Jun 19 03:40:38 2018	(r472754)
@@ -0,0 +1,18 @@
+.obj/platform/graphics/cpu/arm/filters/FELightingNEON.o ---
+<inline asm>:149:1: error: invalid instruction
+vmov.u32 r2, r3, s8, s9
+^
+
+Obtained from: www/webkit-gtk3/files/patch-Source_WebCore_platform_graphics_cpu_arm_filters_FELightingNEON.cpp
+
+--- src/qt/qtwebkit/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp.orig	2018-06-12 14:38:27 UTC
++++ src/qt/qtwebkit/Source/WebCore/platform/graphics/cpu/arm/filters/FELightingNEON.cpp
+@@ -404,7 +404,7 @@ TOSTRING(neonDrawLighting) ":" NL
+     "vmin.f32 " TMP2_D0 ", " TMP2_D0 ", " CONST_ONE_HI_D NL
+     "vmul.f32 " TMP3_Q ", " COLOR_Q ", " TMP2_D0 "[1]" NL
+     "vcvt.u32.f32 " TMP3_Q ", " TMP3_Q NL
+-    "vmov.u32 r2, r3, " TMP3_S0 ", " TMP3_S1 NL
++    "vmov r2, r3, " TMP3_S0 ", " TMP3_S1 NL
+     // The color values are stored in-place.
+     "strb r2, [" PIXELS_R ", #-11]" NL
+     "strb r3, [" PIXELS_R ", #-10]" NL

Added: head/lang/phantomjs/files/patch-src_webpage.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/phantomjs/files/patch-src_webpage.cpp	Tue Jun 19 03:40:38 2018	(r472754)
@@ -0,0 +1,20 @@
+webpage.cpp:80:89: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
+#define CALLBACKS_OBJECT_INJECTION      INPAGE_CALL_NAME" = function() { return window."CALLBACKS_OBJECT_NAME".call.call(_phantom, Array.prototype.slice.call(arguments, 0)); };"
+                                                                                        ^
+webpage.cpp:81:57: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
+#define CALLBACKS_OBJECT_PRESENT        "typeof(window."CALLBACKS_OBJECT_NAME") !== \"undefined\";"
+                                                        ^
+
+--- src/webpage.cpp.orig	2018-01-26 07:17:31 UTC
++++ src/webpage.cpp
+@@ -77,8 +77,8 @@
+ #define BLANK_HTML                      "<html><head></head><body></body></html>"
+ #define CALLBACKS_OBJECT_NAME           "_phantom"
+ #define INPAGE_CALL_NAME                "window.callPhantom"
+-#define CALLBACKS_OBJECT_INJECTION      INPAGE_CALL_NAME" = function() { return window."CALLBACKS_OBJECT_NAME".call.call(_phantom, Array.prototype.slice.call(arguments, 0)); };"
+-#define CALLBACKS_OBJECT_PRESENT        "typeof(window."CALLBACKS_OBJECT_NAME") !== \"undefined\";"
++#define CALLBACKS_OBJECT_INJECTION      INPAGE_CALL_NAME" = function() { return window." CALLBACKS_OBJECT_NAME".call.call(_phantom, Array.prototype.slice.call(arguments, 0)); };"
++#define CALLBACKS_OBJECT_PRESENT        "typeof(window." CALLBACKS_OBJECT_NAME") !== \"undefined\";"
+ 
+ #define STDOUT_FILENAME "/dev/stdout"
+ #define STDERR_FILENAME "/dev/stderr"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806190340.w5J3ecf8082451>