开发者

Cannot build node on Sheevaplug (armv5t) with Debian squeeze

I have now tried several ways of building node (version 0.5.1) on/for a Sheevaplug (armv5t开发者_StackOverflow社区) running Debian (version 6.0.2) squeeze but always ends up with...

$ node
Illegal instruction

... in all cases where ever I could get it to compile.

I have tried to follow several guides (even in various combinations):

  • Adding -march=armv5t to deps/v8/SConstruct ~line 130 (http://code.google.com/p/v8/issues/detail?id=836)
  • Removed if statement from wscript line 533 and replaced with snapshot = "" (http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/10822)
  • Build on other system with scratchbox2 (http://www.plugcomputer.org/plugwiki/index.php/Scratchbox2_based_cross_compiling)
  • Building v8 separately and then referencing it to node when compiling, guide is for other arm so I had to try and change the parameters to armv5t (http://coolaj86.info/articles/debugging-v8-and-node-js-on-arm.html)

Now I feel stuck, several people seem to have succeeded in building node for armv5t but maybe it's different for different versions of node and v8.

How can I continiue trying? I will happily test any suggestions.


Using the stable version 0.4.10 of node solved it with the following steps on the Sheevaplug.

$ sudo apt-get update
$ sudo apt-get install scons make libssl

(Might be a few more packages needed)

$ cd /home/user/source
$ wget http://nodejs.org/dist/node-v0.4.10.tar.gz
$ tar zxvf node-v0.4.10.tar.gz
$ cd node-v0.4.10
$ nano deps/v8/SConstruct

Change ~line 139 in opened file deps/v8/SConstruct

      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS'],

to

      'CCFLAGS':      ['$DIALECTFLAGS', '$WARNINGFLAGS', '-march=armv5t'],

Save file and exit nano with, ctrl+o enter ctrl+x

$ ./configure

Check for complaints about missing packages

$ make

Takes a while ~40 minutes on my Sheevaplug, after build test running node with

$ ./node

If node shell started ok, exit shell and run

$ sudo make install


I got version 6 working on my pogoplug. I figured out removing compiler flags was the best option as if you build on target gcc should know what to do. I've only hacked it for now as the proper solution is to get the build system to set the option 'armeabi:soft' instead of 'armeabi:softfp' which in turn sets the gcc flags.

But if you just want it to work do this in the SConstruct file ( as well as adding the -march=armv5t' as in the previous post )

This is what I commented out at around line 157:

'armeabi:softfp' : {
    'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'],
#    'vfp3:on': {
#      'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS']
#    },
#    'simulator:none': {
#      'CCFLAGS':     ['-mfloat-abi=soft'],
#    }
  },

I did a bit of testing and it works for me.


In case anyone else is looking, there's a useful thread on the nodejs issue tracker: https://github.com/joyent/node/issues/2131#issuecomment-3208846

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜