Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does V8 in Node.js 0.12.0 release require SSE2 CPU instructions?

Tags:

node.js

v8

sse2

Trying to upgrade Node.js from 0.10.x to 0.12.0. The first thing noticed is that I am getting an error that SSE2 instructions are not supported by my CPU (indeed they are not).

Tried to compile Node.js from sources but it failed for the same reason. In deps/v8/src/ia32/assembler-ia32.cc there is a line stating

CHECK(cpu.has_sse2());  // SSE2 support is mandatory.

I wonder if there is a way to get rid of this SSE2 dependency which was not required in Node.js 0.10.x. Just commenting out this line does not help, it throws an Illegal instruction error during make process.

like image 949
Pavel Lobodinský Avatar asked Mar 15 '15 22:03

Pavel Lobodinský


1 Answers

From slide 14 of this presentation: V8 engine of Node.js on IA: JavaScript-JITTED x86 machine code mapping profiling support and X87 Quark processor enabling

You'll need to compile from sources.

Do this:

./configure –dest-cpu=ia32

And add this line to the options in config.gypi file:

'v8_target_arch': 'x87',

Run make.

Basically there is port of V8 to this CPU, it's with the instruction set of old Pentiums (i586).

It works for me with Node v5.11.0 and CPU AMD Geode LX800.

like image 78
Vojtěch Sázel Avatar answered Sep 17 '22 11:09

Vojtěch Sázel