Closed...NodeJS...is there a package around already?

Marvell Kirkwood based
Darkyputz
Posts: 27
Joined: Sun Nov 07, 2010 7:16 pm
Location: New Jersey

Closed...NodeJS...is there a package around already?

Post by Darkyputz » Wed Feb 14, 2018 10:04 pm

Hi out there...

I am looking for a nodejs packade for my NSA320...
I want to control a tuya plug and have the script etc already handy, but for running it i would need node...
And since it is not available for freetz in fritzbox, i was hoping et is available on the NAS...

Thx for any tip...

Jan
Last edited by Darkyputz on Wed Feb 28, 2018 7:03 pm, edited 1 time in total.
NSA 320 with FFP and Metarepository on 4.7 firmware

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: NodeJS...is there a package around already?

Post by barmalej2 » Thu Feb 15, 2018 8:29 am

As I currently focused on updates, my system is incompatible with current ffp 0.7, so I can't help. Any volunteers to compile nodejs for ffp0.7arm? Mr. Dini? I think it is possible to compile nodejs 6.13.0, which has LTS until April 2019 and I can help with approprate patches.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Thu Feb 15, 2018 12:09 pm

I have a 0.10.something now. But it's fine, if you have patches. :) Of courseI will try to compile a newer one. Would be an awesome thing tho.
Last edited by MrDini on Thu Feb 15, 2018 3:54 pm, edited 1 time in total.
Thanks nas-central the lot of help! :)

Darkyputz
Posts: 27
Joined: Sun Nov 07, 2010 7:16 pm
Location: New Jersey

Re: NodeJS...is there a package around already?

Post by Darkyputz » Thu Feb 15, 2018 2:33 pm

Hello...

That just sounds great...
I have Entwareng and FFp on the box so i should be good installing it...
Please let me know how i can get that on the box...or where do download...
Thx!!!!
NSA 320 with FFP and Metarepository on 4.7 firmware

Darkyputz
Posts: 27
Joined: Sun Nov 07, 2010 7:16 pm
Location: New Jersey

Re: NodeJS...is there a package around already?

Post by Darkyputz » Thu Feb 15, 2018 3:59 pm

Sounds better and better...
I am using node-v8.9.4-x64 right now to control the smart plug...so seems not to be sooo urgent for being state of the art compile...
NSA 320 with FFP and Metarepository on 4.7 firmware

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Thu Feb 15, 2018 4:42 pm

Our ZyXEL 3** NASes have ARMv5 CPUs. Node.JS is using V8 JS engine, which is formerly known as Google Chrome's JS engine too. Unfortunately with its release of 3.18 the no-vfp2 support has been dropped, So starting from node 0.11.0 (I think, but maybe it is another version) we Cannot compile any nodejs release because of the lack of VFP2 support in our CPU. So the latest working versions are the 0.10 node branch currently.

I also wanted to use node for a lot of interesting projects. But I had to rewrite everything into Python, that I use. But it would be awesome, if @barmalej2 Could send me some patches for that. :) And then I Can certainly package, and share the result.
Thanks nas-central the lot of help! :)

Darkyputz
Posts: 27
Joined: Sun Nov 07, 2010 7:16 pm
Location: New Jersey

Re: NodeJS...is there a package around already?

Post by Darkyputz » Thu Feb 15, 2018 5:42 pm

Hmmmm...

I would even take the one you have for testing...
Cant believe that it needs to be this new version
As ling it does what i need i would be happy...
NSA 320 with FFP and Metarepository on 4.7 firmware

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: NodeJS...is there a package around already?

Post by barmalej2 » Thu Feb 15, 2018 5:50 pm

OK. Here we go:

https://raw.githubusercontent.com/build ... port.patch
https://raw.githubusercontent.com/Optwa ... -fpu.patch

Configure options:
./configure \
--prefix=/ffp \
--dest-os=linux \
--dest-cpu=arm \
--with-arm-float-abi=softfp \
--with-arm-fpu=none \
--with-intl=system-icu \
--without-snapshot \
--shared-zlib \
--shared-openssl \
--shared-libuv \
--shared-http-parser \
--shared-cares
You will need libuv, http-parser and cares libs. Additionally, adjust source code for /ffp prefix and to declare:

Code: Select all

export PYTHON=/ffp/bin/python 
(v2.7) variable.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Thu Feb 15, 2018 5:58 pm

Thanks a lot! :) Let's see.
Thanks nas-central the lot of help! :)

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Fri Feb 16, 2018 6:32 pm

The first patch not works, because there is no deps/v8/src/base/debug/stack_trace_posix.cc inside the node 6.13.0 tag... :roll: But i think in this release, we don't need to disable bt support. It isn't used here at all. Or I just Cannot grep it. :D
patch command wrote:|diff --git a/deps/v8/src/base/debug/stack_trace_posix.cc b/deps/v8/src/base/debug/stack_trace_posix.cc
|index 87c0a73..d2c182a 100644
|--- a/deps/v8/src/base/debug/stack_trace_posix.cc
|+++ b/deps/v8/src/base/debug/stack_trace_posix.cc
--------------------------
File to patch:
Hmm, what a lovely error:

Code: Select all

  g++ '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -I../deps  -pthread -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -mfloat-abi=softfp -marm -fdata-sections -ffunction-sections -O3 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /i-data/bf835951/build/node-v6.13.0/out/Release/.deps//i-data/bf835951/build/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/accessors.o.d.raw   -c -o /i-data/bf835951/build/node-v6.13.0/out/Release/obj.target/v8_base/deps/v8/src/accessors.o ../deps/v8/src/accessors.cc
In file included from ../deps/v8/src/base/atomicops.h:151:0,
                 from ../deps/v8/src/base/accounting-allocator.h:8,
                 from ../deps/v8/src/zone.h:10,
                 from ../deps/v8/src/handles.h:13,
                 from ../deps/v8/src/accessors.h:11,
                 from ../deps/v8/src/accessors.cc:5:
../deps/v8/src/base/atomicops_internals_arm_gcc.h:260:4: error: #error "Your CPU's ARM architecture is not supported yet"
 #  error "Your CPU's ARM architecture is not supported yet"
    ^

:(
Last edited by MrDini on Fri Feb 16, 2018 7:10 pm, edited 1 time in total.
Thanks nas-central the lot of help! :)

Darkyputz
Posts: 27
Joined: Sun Nov 07, 2010 7:16 pm
Location: New Jersey

Re: NodeJS...is there a package around already?

Post by Darkyputz » Fri Feb 16, 2018 7:00 pm

You guys have no idea how thankful i am...even if it never works, you tried...so great job...
Keeping my fingers crossed
NSA 320 with FFP and Metarepository on 4.7 firmware

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: NodeJS...is there a package around already?

Post by barmalej2 » Fri Feb 16, 2018 8:45 pm

MrDini wrote: Hmm, what a lovely error:
In file included from ../deps/v8/src/base/atomicops.h:151:0,
from ../deps/v8/src/base/accounting-allocator.h:8,
from ../deps/v8/src/zone.h:10,
from ../deps/v8/src/handles.h:13,
from ../deps/v8/src/accessors.h:11,
from ../deps/v8/src/accessors.cc:5:
../deps/v8/src/base/atomicops_internals_arm_gcc.h:260:4: error: #error "Your CPU's ARM architecture is not supported yet"
# error "Your CPU's ARM architecture is not supported yet"
:(
Yea, that's bad. I was hoping that 2-nd patch will override this error, but it seams not enough. Not sure, what atomic ops V8 needs, but v5te can do that with __atomic built-ins , if not legacy __sync built-ins are used. I will take a look closer at Monday, but it seems like the road to nowhere.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Fri Feb 16, 2018 10:06 pm

That patch just change the node's system check config. It doesn't modify the V8's source code.

Is the atomic ops related to the simple atomic support? Because it has been implemented on ARM since 2.6.32 kernel if I clearly remember. So our kernel is too old for that.
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: NodeJS...is there a package around already?

Post by barmalej2 » Sat Feb 17, 2018 8:26 am

MrDini wrote:That patch just change the node's system check config. It doesn't modify the V8's source code.
Do we see the same things differently?
--- a/deps/v8/build/toolchain.gypi
+++ b/deps/v8/build/toolchain.gypi

@@ -56,10 +56,24 @@
'arm_test_noprobe%': 'off',

# Similar to vfp but on MIPS.
- 'v8_can_use_fpu_instructions%': 'true',
+ 'conditions': [
+ ['mips_fpu_mode!="soft"', {
+ 'v8_can_use_fpu_instructions%': 'true',
+ }],
+ ['mips_fpu_mode=="soft"', {
+ 'v8_can_use_fpu_instructions%': 'false',
+ }],
+ ],

# Similar to the ARM hard float ABI but on MIPS.
- 'v8_use_mips_abi_hardfloat%': 'true',
+ 'conditions': [
+ ['mips_fpu_mode!="soft"', {
+ 'v8_use_mips_abi_hardfloat%': 'true',
+ }],
+ ['mips_fpu_mode=="soft"', {
+ 'v8_use_mips_abi_hardfloat%': 'false',
+ }],
+ ],

# Force disable libstdc++ debug mode.
'disable_glibcxx_debug%': 0,
@@ -207,7 +221,7 @@
}],
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
- [ 'arm_fpu!="default"', {
+ [ 'arm_fpu!="default" and arm_fpu!="none"', {
'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
@@ -250,7 +264,7 @@
}],
[ 'arm_version==7 or arm_version=="default"', {
'conditions': [
- [ 'arm_fpu!="default"', {
+ [ 'arm_fpu!="default" and arm_fpu!="none"', {
'cflags': ['-mfpu=<(arm_fpu)',],
}],
],
@@ -526,6 +540,11 @@
'FPU_MODE_FP32',
],
}],
+ ['mips_fpu_mode=="soft"', {
+ 'defines': [
+ '_MIPS_ARCH_MIPS32R2',
+ ],
+ }],
],
}],
['mips_arch_variant=="r1"', {
@@ -665,6 +684,12 @@
[ 'clang==0', {
'cflags': ['-Wa,-mips32r2'],
}],
+ ['mips_fpu_mode=="soft"', {
+ 'defines': [
+ '_MIPS_ARCH_MIPS32R2',
+ ],
+ 'cflags': ['-msoft-float'],
+ }],
],
'cflags': ['-mips32r2'],
'ldflags': ['-mips32r2'],
--- a/deps/v8/src/base/build_config.h
+++ b/deps/v8/src/base/build_config.h
@@ -71,7 +71,7 @@
defined(__ARM_ARCH_7__)
# define CAN_USE_ARMV7_INSTRUCTIONS 1
# ifndef CAN_USE_VFP3_INSTRUCTIONS
-# define CAN_USE_VFP3_INSTRUCTIONS
+//# define CAN_USE_VFP3_INSTRUCTIONS
# endif
#endif

--- a/deps/v8/src/base/cpu.cc
+++ b/deps/v8/src/base/cpu.cc

@@ -137,6 +137,7 @@

#if V8_HOST_ARCH_MIPS
int __detect_fp64_mode(void) {
+#ifndef __mips_soft_float
double result = 0;
// Bit representation of (double)1 is 0x3FF0000000000000.
__asm__ volatile(
@@ -153,6 +154,9 @@
: "t0", "$f0", "$f1", "memory");

return !(result == 1);
+#else
+ return 0;
+#endif
}
MrDini wrote:Is the atomic ops related to the simple atomic support? Because it has been implemented on ARM since 2.6.32 kernel if I clearly remember. So our kernel is too old for that.
Bilobil can help to remember, that the problem is with __sync atomic family 8 byte instructions only until 3.1 kernel
ARM supports 8 byte atomics with cmpxchg64 kernel helper with gcc-4.8 + Linux 3.1 (or Linux 2.6.30 w/ armv6k+).
Besides we can use __atomic builtins functions instead __sync.

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: NodeJS...is there a package around already?

Post by MrDini » Sat Feb 17, 2018 9:56 am

Hmm, I just looked on the gypi ending, and it's node related. :roll: I Can only hardly imagine, it is a part of the original V8. But also, I were sketchy.
Thanks nas-central the lot of help! :)

Post Reply