diff options
author | jmcneill <jmcneill@pkgsrc.org> | 2015-10-21 23:46:28 +0000 |
---|---|---|
committer | jmcneill <jmcneill@pkgsrc.org> | 2015-10-21 23:46:28 +0000 |
commit | 8db8eef8c54a47589fc0122d033583832e9d998a (patch) | |
tree | ed68892c7ebc70d7541b84a051d8b8d29c33702b /lang/nodejs | |
parent | 0f34d43da96b5506f6f6f649530bd790691adf7d (diff) | |
download | pkgsrc-8db8eef8c54a47589fc0122d033583832e9d998a.tar.gz |
Add support for NetBSD/arm
Diffstat (limited to 'lang/nodejs')
5 files changed, 126 insertions, 1 deletions
diff --git a/lang/nodejs/distinfo b/lang/nodejs/distinfo index d3eb2628e70..b21bad09518 100644 --- a/lang/nodejs/distinfo +++ b/lang/nodejs/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.42 2015/10/21 14:47:43 fhajny Exp $ +$NetBSD: distinfo,v 1.43 2015/10/21 23:46:28 jmcneill Exp $ SHA1 (node-v4.2.1.tar.gz) = ba4ae3d1bb02f80289575be56aa7bbb8fa4f0ec6 RMD160 (node-v4.2.1.tar.gz) = 25755b50c96137156869bbb31a5e5b1b7da79ff0 @@ -8,7 +8,11 @@ SHA1 (patch-common.gypi) = 5b3a50617358637a6f910de28bb5a14f037317a6 SHA1 (patch-deps_cares_cares.gyp) = 2235eb44bc984fa2e745fdf1786f1ae6de6ef80f SHA1 (patch-deps_npm_node__modules_node-gyp_gyp_pylib_gyp_generator_make.py) = 78d6ddd37ae30e869e0da666a78baad86a638c50 SHA1 (patch-deps_uv_common.gypi) = ba9caa1f6d9d6df1913d0d72a8d18ea6db0a32ff +SHA1 (patch-deps_v8_src_arm_cpu-arm.cc) = 854a7b0c6392d4568066b961da0958073b7ac62e +SHA1 (patch-deps_v8_src_base_atomicops.h) = 65b6508f5260ae672b9efc5672ba2c93223355ff +SHA1 (patch-deps_v8_src_base_atomicops__internals__arm__gcc.h) = 39ba63d8c397c7f076c108173f1ee2b5839ad4d6 SHA1 (patch-deps_v8_src_base_platform_platform-freebsd.cc) = 686c2054838a25cfeed7fb9870a959e48dc4de35 +SHA1 (patch-deps_v8_src_base_platform_platform-openbsd.cc) = 0abf6a541f24da87dbbd22f57abcd5534999b3df SHA1 (patch-deps_v8_src_base_platform_platform-posix.cc) = eff609b75125dab536934bd8afa640955dcee674 SHA1 (patch-deps_v8_src_base_platform_semaphore.cc) = dd8cafadd2668f069dab8625f57fbd71a304db3e SHA1 (patch-deps_v8_src_types.h) = 1c122245079b3ce0c6fe3f1644d28102fb2eb456 diff --git a/lang/nodejs/patches/patch-deps_v8_src_arm_cpu-arm.cc b/lang/nodejs/patches/patch-deps_v8_src_arm_cpu-arm.cc new file mode 100644 index 00000000000..76f3c9742a2 --- /dev/null +++ b/lang/nodejs/patches/patch-deps_v8_src_arm_cpu-arm.cc @@ -0,0 +1,25 @@ +$NetBSD: patch-deps_v8_src_arm_cpu-arm.cc,v 1.1 2015/10/21 23:46:28 jmcneill Exp $ + +--- deps/v8/src/arm/cpu-arm.cc.orig 2015-10-13 17:20:07.000000000 +0000 ++++ deps/v8/src/arm/cpu-arm.cc +@@ -7,6 +7,9 @@ + #ifdef __QNXNTO__ + #include <sys/mman.h> // for cache flushing. + #undef MAP_TYPE ++#elif defined(__NetBSD__) ++#include <sys/types.h> ++#include <machine/sysarch.h> // for cache flushing. + #else + #include <sys/syscall.h> // for cache flushing. + #endif +@@ -40,6 +43,10 @@ void CpuFeatures::FlushICache(void* star + #elif V8_OS_QNX + msync(start, size, MS_SYNC | MS_INVALIDATE_ICACHE); + ++#elif defined(__NetBSD__) ++ 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/lang/nodejs/patches/patch-deps_v8_src_base_atomicops.h b/lang/nodejs/patches/patch-deps_v8_src_base_atomicops.h new file mode 100644 index 00000000000..03a910e01bc --- /dev/null +++ b/lang/nodejs/patches/patch-deps_v8_src_base_atomicops.h @@ -0,0 +1,18 @@ +$NetBSD: patch-deps_v8_src_base_atomicops.h,v 1.1 2015/10/21 23:46:28 jmcneill Exp $ + +--- deps/v8/src/base/atomicops.h.orig 2015-10-13 17:20:07.000000000 +0000 ++++ deps/v8/src/base/atomicops.h +@@ -54,9 +54,13 @@ typedef intptr_t Atomic64; + #endif // defined(V8_HOST_ARCH_64_BIT) + #endif // defined(__native_client__) + ++#if defined(__NetBSD__) && defined(__arm__) ++typedef int32_t AtomicWord; ++#else + // Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or + // Atomic64 routines below, depending on your architecture. + typedef intptr_t AtomicWord; ++#endif + + // Atomically execute: + // result = *ptr; diff --git a/lang/nodejs/patches/patch-deps_v8_src_base_atomicops__internals__arm__gcc.h b/lang/nodejs/patches/patch-deps_v8_src_base_atomicops__internals__arm__gcc.h new file mode 100644 index 00000000000..d45ead0c81b --- /dev/null +++ b/lang/nodejs/patches/patch-deps_v8_src_base_atomicops__internals__arm__gcc.h @@ -0,0 +1,25 @@ +$NetBSD: patch-deps_v8_src_base_atomicops__internals__arm__gcc.h,v 1.1 2015/10/21 23:46:28 jmcneill Exp $ + +--- deps/v8/src/base/atomicops_internals_arm_gcc.h.orig 2015-10-13 17:20:07.000000000 +0000 ++++ deps/v8/src/base/atomicops_internals_arm_gcc.h +@@ -13,6 +13,11 @@ + #include <sys/cpuinline.h> + #endif + ++#if defined(__NetBSD__) ++#include <sys/types.h> ++#include <machine/sysarch.h> ++#endif ++ + namespace v8 { + namespace base { + +@@ -50,6 +55,8 @@ inline void MemoryBarrier() { + ((KernelMemoryBarrierFunc)0xffff0fa0)(); + #elif defined(__QNXNTO__) + __cpu_membarrier(); ++#elif defined(__NetBSD__) ++ sysarch(ARM_DRAIN_WRITEBUF, (void *)0); + #else + #error MemoryBarrier() is not implemented on this platform. + #endif diff --git a/lang/nodejs/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc b/lang/nodejs/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc new file mode 100644 index 00000000000..d31cfcff6c3 --- /dev/null +++ b/lang/nodejs/patches/patch-deps_v8_src_base_platform_platform-openbsd.cc @@ -0,0 +1,53 @@ +$NetBSD: patch-deps_v8_src_base_platform_platform-openbsd.cc,v 1.1 2015/10/21 23:46:28 jmcneill Exp $ + +--- deps/v8/src/base/platform/platform-openbsd.cc.orig 2015-10-13 17:20:07.000000000 +0000 ++++ deps/v8/src/base/platform/platform-openbsd.cc +@@ -34,6 +34,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 ""; |