Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

Node.js “Illegal instruction” on PowerPC 440EP #65

Closed
sokovykh opened this issue Aug 12, 2016 · 9 comments
Closed

Node.js “Illegal instruction” on PowerPC 440EP #65

sokovykh opened this issue Aug 12, 2016 · 9 comments

Comments

@sokovykh
Copy link

sokovykh commented Aug 12, 2016

I can't run node.js on PowerPC 440EP, I get only error "Illegal instruction".

Hardware info:

cat /proc/cpuinfo
processor       : 0
cpu             : 440EP Rev. C
clock           : 533.333332MHz
revision        : 24.212 (pvr 4222 18d4)
bogomips        : 1066.66
timebase        : 533333332
platform        : CPU440EP
model           : cpu440
Memory          : 128 MB

LD_SHOW_AUXV=1 /bin/true
AT_DCACHEBSIZE:  0x20
AT_ICACHEBSIZE:  0x20
AT_UCACHEBSIZE:  0x0
AT_SYSINFO_EHDR: 0x100000
AT_HWCAP:        booke mmu fpu ppc32
AT_PAGESZ:       4096
AT_CLKTCK:       100
AT_PHDR:         0x10000034
AT_PHENT:        32
AT_PHNUM:        8
AT_BASE:         0x48000000
AT_FLAGS:        0x0
AT_ENTRY:        0x1000446c
AT_UID:          0
AT_EUID:         0
AT_GID:          0
AT_EGID:         0
AT_SECURE:       0
AT_RANDOM:       0xbf8c04f2
AT_EXECFN:       /bin/true
AT_PLATFORM:     ppc440
AT_BASE_PLATFORM:ppc440

Software info:

I'm using powerpc-440-linux-gnu compiler (version 5.2.0) and Linux v3.6.7.

I tried to use different versions of sources:

*node-0.10-ppc* from https://github.com/ibmruntimes/node
*node-4.x-port* from https://github.com/ibmruntimes/node
*node-v4.4.7* from https://nodejs.org/dist/v4.4.7/node-v4.4.7.tar.gz

I'm using the following script for build of node.js:

#!/bin/bash

CROSS_COMPILER=powerpc-440-linux-gnu
HOST=powerpc-linux
ENDIAN=big
BUILD_PATH=/home/user/node
CFLAGS=-Os
JOBS=4

export ARCH=ppc
export CC=${CROSS_COMPILER}-gcc
export CXX=${CROSS_COMPILER}-g++
export CFLAG=${CFLAGS}
export AR=${CROSS_COMPILER}-ar r
export LINK=${CROSS_COMPILER}-g++

export PATH=${PATH}:/home/user/powerpc-440-linux-gnu/bin

./configure --without-snapshot --prefix=${BUILD_PATH} --dest-cpu=ppc --dest-os=linux

make -j ${JOBS}
make install
  • Which version of node.js should I use?
  • Do we have working portable
    version of node.js for PowerPC 440EP ?
@sokovykh
Copy link
Author

Can I run node.js on ppc32 ?

@sxa
Copy link

sxa commented Aug 12, 2016

Although we don't build it on PPC32 I think it still works if you build it yourself. However your issue is more likely to be that the V8 is built with instructions that require power5+ so it won't support anything that old unfortunately.

@sokovykh
Copy link
Author

sokovykh commented Aug 12, 2016

So... needed power5+ instructions isn't supported by PowerPC 440ep or PowerPC e300c3. Do I understant you correctly?
or can I build V8 without instructions that require power5+ ?

@mhdawson
Copy link

Believe the issue will be that your processor does not support the required instructions. See ibmruntimes/v8ppc#100 for more details.

@sxa
Copy link

sxa commented Aug 12, 2016

@zZzlodey I believe so. While I'm not an expert on that generation of chips, from looking around the e300 seems to be a modified PowerPC603e core, and the 440ep is also based on the older PowerPC cores, so won't have the required POWER5+ instructions available.

@sokovykh
Copy link
Author

sokovykh commented Aug 12, 2016

@sxa555 @mhdawson this is very sad news :-(
Andrew Low wrote that we can build V8 in special simulation mode, may it can help?

@andrewlow
Copy link
Collaborator

Yes - simulation mode will work --- but it will be very very slow.

This issue should be closed (but I'll leave that up to @mhdawson). It is not a Node.js issue - but a problem in the v8 dependency. There are already a number of open issues documenting the problem AND paths to a solution.

It is possible to enhance the code to support older / variations of the PowerPC specification, but so far no one has come forward with the skills or the business case motivation to do so.

@sokovykh
Copy link
Author

@andrewlow Thanks Andrew! I'm going to try simulation mode...

@mhdawson
Copy link

Closing, please re-open if you feel it should still be open.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants