Node.js source code build giving segmentation fault on ARM - node.js

tl;dr: I tried to install node.js on my ARMv7-based Cubox running Ubuntu 12.10 (quantal). When compiling node.js from source (see "Second attempt" below), node produces a segmentation fault. What can I do here?
First attempt
First of all, I tried to install node.js via the package manager, following the instructions for Ubuntu that are given here: Installing Node.js via package manager: Ubuntu, Mint
Adding the repository mentioned there using sudo add-apt-repository ppa:chris-lea/node.js seems to work fine:
You are about to add the following PPA to your system:
Evented I/O for V8 javascript. Node's goal is to provide an easy way to build scalable network programs
More info: https://launchpad.net/~chris-lea/+archive/node.js
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keyring `/tmp/tmpp0owib/secring.gpg' created
gpg: keyring `/tmp/tmpp0owib/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpp0owib/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
However, sudo apt-get install nodejs gives me the error:
E: Unable to locate package nodejs
I assume this is because I have an ARM-based system. As far as I can tell from the package details, the repo only contains builds for i386 and amd64. Is my assumption right?
Second attempt
So my next attempt was to install node.js from source. I used the instructions given in the following gist: Node.js and NPM in 30 seconds. Everything seems to work, including make install. But the execution of the install.sh script in the last line of the gist fails since node produces a segmentation fault. Now I wonder what I can do to properly install node.js on my machine?
In order to illustrate my problem, here is some output:
install.sh output
This is the ouput of install.sh after running make install, as described in the gist installation instructions mentioned above.
cyroxx#cubox:~/node-latest-install$ curl https://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7882 100 7882 0 0 11251 0 --:--:-- --:--:-- --:--:-- 14984
tar=/bin/tar
version:
tar (GNU tar) 1.26
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
install npm#latest
fetching: http://registry.npmjs.org/npm/-/npm-1.2.21.tgz
Segmentation fault
Segmentation fault
You need node to run this program.
node --version reports: v0.10.7
Please upgrade node before continuing.
It failed
node output
cyroxx#cubox:~/node-latest-install$ node
Segmentation fault
make Debug build
Running make with BUILDTYPE=Debug produces this output:
cyroxx#cubox:~/node-latest-install$ make -C out BUILDTYPE=Debug
make: Entering directory `/home/cyroxx/node-latest-install/out'
CXX(target) /home/cyroxx/node-latest-install/out/Debug/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o
../deps/v8/src/arm/stub-cache-arm.cc: In function 'void v8::internal::ProbeTable(v8::internal::Isolate*, v8::internal::MacroAssembler*, v8::internal::Code::Flags, v8::internal::StubCache::Table, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register, v8::internal::Register)':
../deps/v8/src/arm/stub-cache-arm.cc:106:15: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1plus: all warnings being treated as errors
make: *** [/home/cyroxx/node-latest-install/out/Debug/obj.target/v8_base/deps/v8/src/arm/stub-cache-arm.o] Error 1
make: Leaving directory `/home/cyroxx/node-latest-install/out'
What's wrong here? Is this a bug in the ARM implementation of V8? Maybe any compiler flags that are not (properly) set? Anything else? I am totally stuck.

I had this problem too on a few different ARM computers. Compiling without the snapshot feature worked for me. Snapshot is a V8 feature that allows node to start faster, and there seems to be a bug for ARM.
./configure --without-snapshot
make
sudo make install
http://www.armhf.com/index.php/node-js-for-the-beaglebone-black/

I had trouble building on a Samsung Chromebook XE303C12I with Crouton running Unity, even with --without-snapshot and --with-arm-float-abi=hard, so I used the precompiled binaries for Linux ARM devices.
Binaries can be found in the release directory at nodejs.org/dist/{version number}
For example, the ARM binary for v0.10.24 can be downloaded [here].(http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-arm-pi.tar.gz)
Here's a script to download and install a binary. Once you have node installed, make sure to add path/to/bin/node to your $PATH.

Related

Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y

I’m big enthusiast of Manjaro since 2015 but today I got a problem that I couldn’t resolve on my own. After big updates done few days ago (by update manager) I have a problem with compiling Kernel Drivers on kernel 4.15.18-1. After call make I got error:
make -C /usr/lib/modules/4.15.18-1-MANJARO/build M=/run/media/mati/common/hello_world modules
make[1]: Wejście do katalogu '/usr/lib/modules/4.15.18-1-MANJARO/build'
**Makefile:974: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.**
make[1]: Opuszczenie katalogu '/usr/lib/modules/4.15.18-1-MANJARO/build'
make: *** [Makefile:4: all] Błąd 2
The problem is that I cannot install mentioned libraries and command: pacman -Q libelf
returns
libelf 0.170-1
i have no idea what happend, I tried another kernels (I have few versions installed) but each has problems (e.g. the newest, experimental 4.17 has problem with asm goto of gcc compiler). I started learning Linux Kernel Drivers programming but now I can’t learn because of these compilation problems … anyone can help me ?
(Hope my english is understanable).
Greetings !
I got this error while setting up VirtualBox in my Fedora OS 29, I issued the following command and this issue got resolved.
sudo dnf install elfutils-libelf-devel
Are you able to install these packages on your system?
elfutils
elfutils-libelf-devel
libelf-dev
libelf-devel
May require dependencies such as: zlib-devel
For me I had to install elfutils-devel first then install eflutils and eflutils-libelf-devel. libelf-dev and libelf-devel could not be found but when I ran /sbin/vboxconfig again this time it did not error out. I ran the check, "systemctl status vboxdrv" and this time it showed Active: as Active (exited) and I was able to spin up the VM.

Installing/compiling OpenFOAM on a server without admin privileges

I'm trying to install/compile OpenFOAM on a remote server. As I don't have the admin privileges I have to compile it from scratch. Following the instructions here, when I try to run
source ~/OpenFOAM/OpenFOAM-v1712/etc/bashrc
I get the error:
No completion added for /home/foobar/OpenFOAM/OpenFOAM-v1712/platforms/linux64GccDPInt32Opt/bin
I checked the ~/OpenFOAM/OpenFOAM-v1712/etc/bashrc definitely exists and it is intact. I also checked the /home/foobar/OpenFOAM/OpenFOAM-v1712/ folder and there are no such thing as platforms folder! I searched and the only place I could see a similar error message is here where the issue is old Bash. I tried bash --version returning version 4.3.48(1)-release (x86_64-pc-linux-gnu) which is more than 4.2 as seems to be required.
My system information:
When I run the uname -a command on the server this is what I get
Linux foobar 4.4.0-101-generic #124-Ubuntu SMP Fri Nov 10 18:29:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Looking into the possible required dependencies mentioned in this page, I checked the installed packages using the command apt list --installed | grep -i packageName, The packages installed are:
build-essential, flex, bison, cmake, zlib1g-dev, libboost-system-dev, libboost-thread-dev, libopenmpi-dev, openmpi-bin, gnuplot, libreadline-dev, libqt4-dev, libqt4-opengl-dev, freeglut3-dev,
And the ones not installed are:
libncurses-dev, libxt-dev, libqtwebkit-dev, libcgal-dev
which according to the installation page are not essential I suppose.
and checking the versions of the libraries installed:
mpirun --version --> (Open MPI) 1.10.2
gcc --version --> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
cmake --version --> 3.5.1
I would appreciate if could let me know
What is the problem and how I can solve it?
if not solvable, what are the alternative methods for me to have the OpenFOAM installed/compiled on the said server.
This is really embracing as it was just a wrong error! I was informed here that I could have ignored the error and go forward with compiling. Of course I couldn't compile the ParaVIEW/paraFoam as dependencies lack, but it is just a headless server without any GUI. So if you got this error just ignore it and go forwards with the compiling with:
./Allwmake
I have reported the issue here so they can fix it.
P.S. I reported this issue almost 9 month ago and now there is a new confusing message instead of the old one!
No completion added for /home/foobar/OpenFOAM/OpenFOAM-v1806/platforms/linux64GccDPInt32Opt/bin
... incorrect platform, or not yet compiled?

How do I install tcpslice from source, released for fedora, on a mac 64 bit?

The newest publicly available tcpslice version 1.2a1 (found on its github) has a bug where it expects 8 bytes for a time field but gets 16 (when in 64 bit). This leads to the error:
tcpslice: problems finding end packet of file ./abc1234.bin
I got my info for this error from: https://bugzilla.redhat.com/show_bug.cgi?id=485670
This led me to grab the updated version (1.2a3) from here and try compiling from source: http://pkgs.fedoraproject.org/repo/pkgs/tcpdump/tcpslice-1.2a3.tar.gz/. I think this is or close to the actual patch
HOWEVER, I couldn't ./configure this on my mac because it says (understandably) this:
checking build system type... configure: error: cannot guess build type; you must specify one
Not one to give up, and becuase I don't wnat to switch over to linux to continue deveolping my wrapper script, I tried to compile like this:
./configure --build=i686-pc-linux-gnu
This configured and make'd!!! However, its 32 bit which still gives the same error when I run the newly made tcpdump!!
Is this possible at all, and what other --build type can I use that is for x86_64 bit systems? No other --build types are compiling for me. I have no idea how to find acceptable build types, and am currently referenceing this: https://gcc.gnu.org/gcc-4.2/buildstat.html
EDIT: I tried Warren Young's suggestion here but libtoolize --force did not remake config.guess, so I manually downloaded the "newest" config.guess from the link on this page with curl. However, now ./configure says:
checking build system type... Invalid configuration `x86_64-apple-darwin15.4.0': machine `x86_64-apple' not recognized
configure: error: /bin/sh ./config.sub x86_64-apple-darwin15.4.0 failed
Am I screwed? Or can I sitll try a default x86_64 -build type (which I still cannot find):
checking build system type... Invalid configuration `x86_64': machine `x86_64' not recognized
configure: error: /bin/sh ./config.sub x86_64 failed
Welp, the answer was to manually download the newest config.guess and config.sub files from here: https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html and to overwrite the ones in the tcpslice directory.
However, the same problem still existed. There must be another reason the time issue is happening on the mac because this version of tcpslice worked fine on ubuntu on the same pcap.
Thanks to Warren Young's post in this question for guiding me in the right (though not successful) direction: Compiling tcpsplice on a 64-bit machine. Guess I'll be using ubuntu to finish my script!

Invalid configuration i686-redhat-linux-gnu on CentOS

I launch this command to build rpm package:
#>rpmbuild --rebuild -vv vqadmin-toaster-2.3.7-1.4.1.src.rpm
I'm on CentOs 6.4 and i want to build and install qmailtoaster packets.
Only this packet get an error:
checking build system type... Invalid configuration 'i686-redhat-linux-gnu': machine 'i686-redhat-linux' not recognized
What can i do? this is first time that i'm compiling RPM packages, any ideas?
i also run into the same problem, according to qmailtoaster installation script the command suppose to be
rpmbuild --rebuild --with cnt5064 vqadmin-toaster-2.3.7-1.4.1.src.rpm
built it has the same error msg as above
and I Google around and found out
vqadmin build error
many of our programs are running automake versions that PREDATE 64-bit linux... and while most apps will build just fine (albeit less optimized), vqadmin 2.3.7 does NOT build successfully in this "unknown-linux" environment.
He offers a x86_64 rpm at the bottom

How to compile NodeJS on a D-Link DNS 325 with fun_plug 0.5 installed?

I am trying to compile Node on my NAS device, but I get this error, and I don't really know how to make this work:
/node-v0.6.6/deps/v8/src/arm/constants-arm.h:33:2: error: #error ARM EABI support is
required.
scons: *** [obj/release/accessors.o] Error 1
scons: building terminated because of errors.
Waf: Leaving directory `/ffp/home/root/node-v0.6.6/out'
Build failed: -> task failed (err #2):
{task: libv8.a SConstruct -> libv8.a}
Did someone actually manage do get Node to compile on a D-Link NAS? Does someone know of any official guides to doing this or where should I ask for help?
Many thanks.
DNS320, Fonzplug, NodeJS, Funplug, (DNS323, my original target) also appears to apply to sheeva plug!!.
(as a matter of interest 323 takes about 7.5 hours to compile, whilst 320 takes 1hr, 3 minutes)
(also compile on 1G8 Intel Linux (Debian) take about 15 minutes)
========================
NOTE: on fonz plug - you need the following installed:
binutils
List item
kernel-headers
pkg-config
uclibc
gcc
make
gettext
patch
bison
flex
autoconf
automake
=======================
then you can:
exported TMPDIR=/ffp/tmp (need this to put tmp files on HD not in memory!)
export CC='gcc -march=armv5t -mfloat-abi=softfp -fno-tree-sink -O0'
export CCFLAGS='-march=armv5t -mfloat-abi=softfp -fno-tree-sink -O0'
export CXX='g++ -march=armv5t -mfloat-abi=softfp -fno-tree-sink -O0'
export GCC='-march=armv5t -mfloat-abi=softfp -fno-tree-sink -O0'
./configure --prefix=/ffp --without-snapshot
......
make
.............
make install
Notes:
I have had experience with NodeJS 0.4.9 - so I have kept using it - read on as to why!!
actually compiles without error!!
BUT!
when run - Illegal instruction - pops up
this appears to be because V8 is EXPECTED to be compiled on a host machine that is NOT an arm!!
see below for references I've found: (It has taken me 6 months to find all these)
Someone, somewhere has decided that running on ARM is an embedded environment, therefore you won't ever compile on it!!
Can someone with authority fix this!!!!!!!!
The fact that I can get a clean compile, says it can work, but at least V8 doesn't want us too????
original instructions:
https://github.com/joyent/node/wiki/Installation
What else I have found:
http://code.google.com/p/v8/wiki/CrossCompilingForARM
http://code.google.com/p/v8/issues/detail?id=914
http://code.google.com/p/v8/issues/detail?id=1632&q=vfp%20off&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars
https://github.com/joyent/node/issues/1566
http://fastr.github.com/articles/Node.js-on-OpenEmbedded.html
http://freebsd.1045724.n5.nabble.com/problems-with-cvsup-on-FreeBSD-9-snapshot-201101-td4491053.html
http://code.google.com/p/v8/issues/detail?id=1446
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0133c/index.html
http://infocenter.arm.com/help/topic/com.arm.doc.qrc0007e/QRC0007_VFP.pdf
https://github.com/joyent/node/issues/1386
https://github.com/joyent/node/issues/2131
and from this article, the minimum installs of fonz stuff that needs to be pre-installed:
http://www.shadowandy.net/2008/08/adding-compiling-capabilities-to-your-dns-323.htm
DNS323 - wiki site (new one??!!)
http://dns323.kood.org/dns-320
http://tsd.dlink.com.tw/downloads2008detail.asp (open source for dlink find dns then 320 - or 323 etc)
compiler options:
http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
debugging options:
http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html
Interest:
http://itrs.tw/wiki/Code_Sourcery_G%2B%2B_Lite
http://pandorawiki.org/Floating_Point_Optimization
http://wiki.debian.org/ArmHardFloatPort/VfpComparison
https://groups.google.com/group/nodejs-dev/browse_thread/thread/18bfc495b01e2f9b/8507143b5578ebf9#8507143b5578ebf9
http://stackoverflow.com/questions/6788768/cannot-build-node-on-sheevaplug-armv5t-with-debian-squeeze/6790823#6790823
http://www.plugcomputer.org/plugwiki/index.php/Scratchbox2_based_cross_compiling
why 0.4.9, and not 0.6.6?
6.6 may be crapping out in same place but error says EABI error, compiler with Fonz doesn't understand EABI.
I think the V8 guys (or node guys) have relabelled the error descriptor to EABI, I don't know enough to trace problem.
There are heaps of other switches available for the compilers - I have given up trying them all (other people seem to have found the same problem, they are MUCH more knowledgable than I am, so I am going to assume that they have tried all the available switches that could make a difference).
As a matter of interest the V8 compile only uses the CXXFLAGS switch to compile with, whilst the rest of NodeJS seems to use the others I have labelled!!
Also note that in order to get snapshot running it points to /tmp - no matter what I do, -
I ended up moving /tmp to /tmp1, and ln -s /tmp /ffp/tmp
ie
mv /tmp /tmp1
ln -s /tmp /ffp/tmp

Resources