cross compile node.js for raspberry Pi

117 views
Skip to first unread message

Tix Lo

unread,
Aug 18, 2014, 10:35:35 PM8/18/14
to nod...@googlegroups.com
Hi,

  I got the source code of node.js from http://nodejs.org/dist/v0.10.25/node-v0.10.25.tar.gz and cross compiled it

  Here were my steps of compiling:

  a) # AR=arm-arago-linux-gnueabi-ar CC="arm-arago-linux-gnueabi-gcc -march=armv6" CXX="arm-arago-linux-gnueabi-g++ -march=armv6" LINK=arm-arago-linux-gnueabi-g++ ./configure --without-snapshot --dest-cpu=arm --dest-os=linux --prefix=/home/xxxxx/install

{ 'target_defaults': { 'cflags': [],
                       
'default_configuration': 'Release',
                       
'defines': [],
                       
'include_dirs': [],
                       
'libraries': []},
 
'variables': { 'arm_fpu': 'vfpv2',
                 
'arm_neon': 0,
                 
'armv7': 0,
                 
'clang': 0,
                 
'gcc_version': 45,
                 
'host_arch': 'arm',
                 
'node_install_npm': 'true',
                 
'node_prefix': '/home/arecd/nfs/RPi/nodejs/install',
                 
'node_shared_cares': 'false',
                 
'node_shared_http_parser': 'false',
                 
'node_shared_libuv': 'false',
                 
'node_shared_openssl': 'false',
                 
'node_shared_v8': 'false',
                 
'node_shared_zlib': 'false',
                 
'node_tag': '',
                 
'node_unsafe_optimizations': 0,
                 
'node_use_dtrace': 'false',
                 
'node_use_etw': 'false',
                 
'node_use_openssl': 'true',
                 
'node_use_perfctr': 'false',
                 
'node_use_systemtap': 'false',
                 
'python': '/usr/bin/python',
                 
'target_arch': 'arm',
                 
'v8_enable_gdbjit': 0,
                 
'v8_no_strict_aliasing': 1,
                 
'v8_use_arm_eabi_hardfloat': 'false',
                 
'v8_use_snapshot': 'false'}}
creating  
./config.gypi
creating  
./config.mk




  b)  # AR=arm-arago-linux-gnueabi-ar CC=arm-arago-linux-gnueabi-gcc CXX=arm-arago-linux-gnueabi-g++ LINK=arm-arago-linux-gnueabi-g++ CFLAGS=-march=armv6 make
 
   It was successful for generating a binary , node. However I executed the binary after putted it to rastberry pi (ArchLinux Firmware)

   It show the errors:

fs.js:476
 
var r = binding.read(fd, buffer, offset, length, position);
                 
^
Error: Offset is out of bounds
    at
Object.fs.readSync (fs.js:476:19)
    at
Object.fs.readFileSync (fs.js:310:28)
    at
Object.Module._extensions..js (module.js:473:44)
    at
Module.load (module.js:356:32)
    at
Function.Module._load (module.js:312:12)
    at
Function.Module.runMain (module.js:497:10)
    at startup
(node.js:119:16)
    at node
.js:902:3


  So I tried another way to run node.js. I used the pre-compiled binary ,http://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-arm-pi.tar.gz.

  IT WORKS PERFECTLLY! I really dont know why because the same version, the same rastberry pi , and the same test javascript.

  someone can give me some suggestions?

  thanks a lot.
  


Reply all
Reply to author
Forward
0 new messages