title: Node.js source code build giving segmentation fault on ARM
body: <p>tl;dr: I tried to install node.js on my ARMv7-based <a href="http://www.solid-run.com/products/cubox" rel="noreferrer">Cubox</a> running Ubuntu 12.10 (quantal). When compiling node.js from source (see "Second attempt" below), <code>node</code> produces a segmentation fault. What can I do here?</p>
  
  <h2>First attempt</h2>
  
  <p>First of all, I tried to install node.js via the package manager, following the instructions for Ubuntu that are given here: <a href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint" rel="noreferrer">Installing Node.js via package manager: Ubuntu, Mint</a></p>
  
  <p>Adding the repository mentioned there using <code>sudo add-apt-repository ppa:chris-lea/node.js</code> seems to work fine:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>However, <code>sudo apt-get install nodejs</code> gives me the error:</p>
  
  <pre><code>E: Unable to locate package nodejs
  </code></pre>
  
  <p>I assume this is because I have an ARM-based system. As far as I can tell <a href="https://launchpad.net/~chris-lea/+archive/node.js/+packages" rel="noreferrer">from the package details</a>, the repo only contains builds for i386 and amd64. Is my assumption right?</p>
  
  <h2>Second attempt</h2>
  
  <p>So my next attempt was to install node.js from source. I used the instructions given in the following gist: <a href="https://gist.github.com/isaacs/579814#file-node-and-npm-in-30-seconds-sh" rel="noreferrer">Node.js and NPM in 30 seconds</a>. Everything seems to work, including <code>make install</code>. But the execution of the <code>install.sh</code> script in the last line of the gist fails since <code>node</code> produces a segmentation fault. Now I wonder what I can do to properly install node.js on my machine?</p>
  
  <p>In order to illustrate my problem, here is some output:</p>
  
  <p><strong>install.sh output</strong></p>
  
  <p>This is the ouput of <code>install.sh</code> after running <code>make install</code>, as described in the gist installation instructions mentioned above.</p>
  
  <pre><code>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 &lt;http://gnu.org/licenses/gpl.html&gt;.
  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
  </code></pre>
  
  <p><strong>node output</strong></p>
  
  <pre><code>cyroxx@cubox:~/node-latest-install$ node
  Segmentation fault
  </code></pre>
  
  <p><strong>make Debug build</strong></p>
  
  <p>Running <code>make</code> with <code>BUILDTYPE=Debug</code> produces this output:</p>
  
  <pre><code>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 &lt; 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'
  </code></pre>
  
  <p>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.</p>