aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2016-05-19 13:24:48 +0800
committerpi <pi@FreeBSD.org>2016-05-19 13:24:48 +0800
commit1787680b81d2ebdb6c0edb6a26d58711e4592d29 (patch)
treec065e4065f4a215a9e98478fbc3af693a3340909 /www
parentca0c7e4c377294e109561bfb57c4396a99f489c5 (diff)
downloadfreebsd-ports-gnome-1787680b81d2ebdb6c0edb6a26d58711e4592d29.tar.gz
freebsd-ports-gnome-1787680b81d2ebdb6c0edb6a26d58711e4592d29.tar.zst
freebsd-ports-gnome-1787680b81d2ebdb6c0edb6a26d58711e4592d29.zip
www/node: add armv6 support
PR: 209481 Submitted by: mikael.urankar@gmail.com Approved by: bradleythughes@fastmail.fm (maintainer)
Diffstat (limited to 'www')
-rw-r--r--www/node/Makefile6
-rw-r--r--www/node/files/patch-deps_v8_src_arm_cpu-arm.cc22
-rw-r--r--www/node/files/patch-deps_v8_src_base_atomicops_internals_arm_gcc.h35
-rw-r--r--www/node/files/patch-deps_v8_src_base_platform_platform-freebsd.cc51
-rw-r--r--www/node/files/patch-deps_v8_src_profiler_sampler.cc15
5 files changed, 128 insertions, 1 deletions
diff --git a/www/node/Makefile b/www/node/Makefile
index 681566cf2efd..87eced0eb2b1 100644
--- a/www/node/Makefile
+++ b/www/node/Makefile
@@ -20,7 +20,7 @@ USE_LDCONFIG= yes
CONFLICTS_INSTALL= node4-* node-0.[02-9][0-9]* node-devel-0.[0-9]* node010-[0-9]* node012-[0-9]* iojs-[0-9]*
-ONLY_FOR_ARCHS= i386 amd64
+ONLY_FOR_ARCHS= i386 amd64 armv6
CONFIGURE_ARGS= --prefix=${PREFIX_RELDEST} --without-npm --shared-zlib
PREFIX_RELDEST= ${PREFIX:S,^${DESTDIR},,}
REINPLACE_ARGS= -i ''
@@ -28,6 +28,10 @@ MAKE_ENV+= CC.host=${CC} CXX.host=${CXX} LINK.host=${CXX} LINK.target=${CXX}
.include <bsd.port.pre.mk>
+.if ${ARCH} == "armv6"
+CONFIGURE_ARGS= --openssl-no-asm
+.endif
+
.if ${COMPILER_TYPE} == clang
MAKE_ENV+= LINK=clang++
CFLAGS+= -Wno-unused-private-field
diff --git a/www/node/files/patch-deps_v8_src_arm_cpu-arm.cc b/www/node/files/patch-deps_v8_src_arm_cpu-arm.cc
new file mode 100644
index 000000000000..3ae7b8bfdc6e
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_arm_cpu-arm.cc
@@ -0,0 +1,22 @@
+--- deps/v8/src/arm/cpu-arm.cc.orig 2016-05-06 17:09:05.953032000 +0200
++++ deps/v8/src/arm/cpu-arm.cc 2016-05-06 17:10:42.094376000 +0200
+@@ -7,6 +7,9 @@
+ #ifdef __QNXNTO__
+ #include <sys/mman.h> // for cache flushing.
+ #undef MAP_TYPE
++#elif defined(__FreeBSD__)
++#include <sys/types.h>
++#include <machine/sysarch.h> // for cache flushing.
+ #else
+ #include <sys/syscall.h> // for cache flushing.
+ #endif
+@@ -24,6 +27,9 @@ void CpuFeatures::FlushICache(void* star
+ #if !defined(USE_SIMULATOR)
+ #if V8_OS_QNX
+ msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE);
++#elif defined(__FreeBSD__)
++ struct arm_sync_icache_args args = { .addr = (uintptr_t)start, .len = size };
++ sysarch(ARM_SYNC_ICACHE, (void *)&args);
+ #else
+ register uint32_t beg asm("r0") = reinterpret_cast<uint32_t>(start);
+ register uint32_t end asm("r1") = beg + size;
diff --git a/www/node/files/patch-deps_v8_src_base_atomicops_internals_arm_gcc.h b/www/node/files/patch-deps_v8_src_base_atomicops_internals_arm_gcc.h
new file mode 100644
index 000000000000..97d04a0c3569
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_base_atomicops_internals_arm_gcc.h
@@ -0,0 +1,35 @@
+--- deps/v8/src/base/atomicops_internals_arm_gcc.h.orig 2016-01-19 17:14:41 UTC
++++ deps/v8/src/base/atomicops_internals_arm_gcc.h
+@@ -13,6 +13,11 @@
+ #include <sys/cpuinline.h>
+ #endif
+
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <machine/sysarch.h>
++#endif
++
+ namespace v8 {
+ namespace base {
+
+@@ -48,6 +53,8 @@ inline void MemoryBarrier() {
+ // Note: This is a function call, which is also an implicit compiler barrier.
+ typedef void (*KernelMemoryBarrierFunc)();
+ ((KernelMemoryBarrierFunc)0xffff0fa0)();
++#elif defined(__FreeBSD__)
++ sysarch(ARM_DRAIN_WRITEBUF, (void *)0);
+ #elif defined(__QNXNTO__)
+ __cpu_membarrier();
+ #else
+@@ -63,8 +70,9 @@ inline void MemoryBarrier() {
+ defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \
+ defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || \
+ defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \
+- defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || \
+- defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__)
++ defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6KZ__) || \
++ defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || \
++ defined(__ARM_ARCH_6T2__)
+
+ inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr,
+ Atomic32 old_value,
diff --git a/www/node/files/patch-deps_v8_src_base_platform_platform-freebsd.cc b/www/node/files/patch-deps_v8_src_base_platform_platform-freebsd.cc
new file mode 100644
index 000000000000..aad1b1005b5d
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_base_platform_platform-freebsd.cc
@@ -0,0 +1,51 @@
+--- deps/v8/src/base/platform/platform-freebsd.cc.orig 2016-01-19 17:19:28 UTC
++++ deps/v8/src/base/platform/platform-freebsd.cc
+@@ -36,6 +36,48 @@
+ namespace v8 {
+ namespace base {
+
++#ifdef __arm__
++
++bool OS::ArmUsingHardFloat() {
++ // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify
++ // the Floating Point ABI used (PCS stands for Procedure Call Standard).
++ // We use these as well as a couple of other defines to statically determine
++ // what FP ABI used.
++ // GCC versions 4.4 and below don't support hard-fp.
++ // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or
++ // __ARM_PCS_VFP.
++
++#define GCC_VERSION (__GNUC__ * 10000 \
++ + __GNUC_MINOR__ * 100 \
++ + __GNUC_PATCHLEVEL__)
++#if GCC_VERSION >= 40600
++#if defined(__ARM_PCS_VFP)
++ return true;
++#else
++ return false;
++#endif
++
++#elif GCC_VERSION < 40500
++ return false;
++
++#else
++#if defined(__ARM_PCS_VFP)
++ return true;
++#elif defined(__ARM_PCS) || defined(__SOFTFP__) || defined(__SOFTFP) || \
++ !defined(__VFP_FP__)
++ return false;
++#else
++#error "Your version of GCC does not report the FP ABI compiled for." \
++ "Please report it on this issue" \
++ "http://code.google.com/p/v8/issues/detail?id=2140"
++
++#endif
++#endif
++#undef GCC_VERSION
++}
++
++#endif // def __arm__
++
+
+ const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
+ if (std::isnan(time)) return "";
diff --git a/www/node/files/patch-deps_v8_src_profiler_sampler.cc b/www/node/files/patch-deps_v8_src_profiler_sampler.cc
new file mode 100644
index 000000000000..dc300f5dfd5d
--- /dev/null
+++ b/www/node/files/patch-deps_v8_src_profiler_sampler.cc
@@ -0,0 +1,15 @@
+--- ./deps/v8/src/profiler/sampler.cc.orig 2016-05-06 11:58:26 UTC
++++ ./deps/v8/src/profiler/sampler.cc
+@@ -515,9 +515,9 @@ void SignalHandler::HandleProfilerSignal
+ state.sp = reinterpret_cast<Address>(mcontext.mc_rsp);
+ state.fp = reinterpret_cast<Address>(mcontext.mc_rbp);
+ #elif V8_HOST_ARCH_ARM
+- state.pc = reinterpret_cast<Address>(mcontext.mc_r15);
+- state.sp = reinterpret_cast<Address>(mcontext.mc_r13);
+- state.fp = reinterpret_cast<Address>(mcontext.mc_r11);
++ state.pc = reinterpret_cast<Address>(mcontext.__gregs[_REG_PC]);
++ state.sp = reinterpret_cast<Address>(mcontext.__gregs[_REG_SP]);
++ state.fp = reinterpret_cast<Address>(mcontext.__gregs[_REG_FP]);
+ #endif // V8_HOST_ARCH_*
+ #elif V8_OS_NETBSD
+ #if V8_HOST_ARCH_IA32