PowerLinux (PowerPC aka PPC) early (unofficial) version of Node.js

3,246 views
Skip to first unread message

Andrew Low

unread,
Sep 3, 2013, 2:41:53 PM9/3/13
to nod...@googlegroups.com
Hi folks, allow me to introduce myself. I'm Andrew Low and I work for IBM. I've been building runtime technology for almost 20 years, over that time I've built Smalltalk VMs (http://en.wikipedia.org/wiki/IBM_VisualAge), Java VMs (http://en.wikipedia.org/wiki/IBM_J9), and I'm now working on JavaScript runtimes (and this means Node.js too!)

Since early this year I've been leading a small team porting V8 to PowerPC. If you're keen to follow along all of our work it up on GitHub https://github.com/andrewlow/v8ppc

As most of you are aware, Node.js relies on V8 for it's javascript runtime. This has been a barrier to bringing Node.js to platforms that don't (yet) have a V8 port. Now that the V8 port to PowerPC is fairly feature complete, we're able to bring Node.js up on Power Linux. You can check the code out here: https://github.com/andrewlow/node - specifically the branch "v0.10.16-release-ppc"

We're planning on giving all of this code back to the community - it's all there on GitHub now and licensed in the same manner as the original project. So far there are only a handful of changes to the Node.js code.

There is also a public Jenkins continuous integration server building binaries: http://v8ppc.osuosl.org:8080/

Limitations: For now it's only 32bit (but the binaries will of course run just fine on 64bit systems). We're also stuck on the 0.10.x branch of Node for the time being. We will be working towards removing these limitations.

Mikeal Rogers

unread,
Sep 3, 2013, 2:51:13 PM9/3/13
to nod...@googlegroups.com
Great work!

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Matt

unread,
Sep 3, 2013, 3:38:21 PM9/3/13
to nod...@googlegroups.com
I know this isn't your target market, but does this mean I can get node running on my old G4 Powerbook?

Andrew Low

unread,
Sep 3, 2013, 3:53:06 PM9/3/13
to nod...@googlegroups.com
If you're G4 Powerbook is running Linux - I think you _are_ the target market :) 

If your question was about getting a version running under OSX (on PowerPC) that may require a bunch of code changes. If you want to try, you're certainly welcome to go for it.

We've also managed to convince the code to (mostly) compile/run on AIX. So it's pretty flexible.

You can grab binaries for PowerLinux from the Jenkins server http://v8ppc.osuosl.org:8080/ - give it a try.

Ryan Schmidt

unread,
Sep 3, 2013, 4:00:13 PM9/3/13
to nod...@googlegroups.com

On Sep 3, 2013, at 14:53, Andrew Low wrote:

> If you're G4 Powerbook is running Linux - I think you _are_ the target market :)
>
> If your question was about getting a version running under OSX (on PowerPC) that may require a bunch of code changes. If you want to try, you're certainly welcome to go for it.

What "bunch of code changes" are you thinking of? node and v8 already compile fine on OS X on Intel.

One roadblock I see is that PowerPC Macs can't run Mac OS X 10.6 or later, and last I checked node did not compile on 10.5 or earlier. So someone wanting node to run on a PowerPC Mac could begin by figuring out why node doesn't compile on 10.5 on Intel and fixing that. It used to work a year or more ago but broke at some point.


Andrew Low

unread,
Sep 3, 2013, 4:08:04 PM9/3/13
to nod...@googlegroups.com


On Tuesday, September 3, 2013 4:00:13 PM UTC-4, ryandesign wrote:

On Sep 3, 2013, at 14:53, Andrew Low wrote:

> If you're G4 Powerbook is running Linux - I think you _are_ the target market :)
>
> If your question was about getting a version running under OSX (on PowerPC) that may require a bunch of code changes. If you want to try, you're certainly welcome to go for it.

What "bunch of code changes" are you thinking of? node and v8 already compile fine on OS X on Intel.

I probably wasn't clear. OSX on PowerPC will need changes. OSX on Intel is of course an existing and well supported platform.
 
One roadblock I see is that PowerPC Macs can't run Mac OS X 10.6 or later, and last I checked node did not compile on 10.5 or earlier. So someone wanting node to run on a PowerPC Mac could begin by figuring out why node doesn't compile on 10.5 on Intel and fixing that. It used to work a year or more ago but broke at some point.
 
Good point. Not only will you encounter compile issues because the V8 PPC code is targeted at Linux (on Power), you'll likely have additional woes getting the Node.js code itself to compile.

Personally I like old hardware and like to see it kept as current as software will permit - however, to return to the origin of this thread - it is now possible to run Node.js on PowerLinux. If you've got PowerPC hardware that's running Linux, there is a good chance you can get Node.js going now.

Nathan Rajlich

unread,
Sep 3, 2013, 4:31:41 PM9/3/13
to nodejs
Very cool! I wish my PS3 still had Linux running on it :(


Matt

unread,
Sep 3, 2013, 4:52:28 PM9/3/13
to nod...@googlegroups.com

On Tue, Sep 3, 2013 at 3:53 PM, Andrew Low <roo...@gmail.com> wrote:
If you're G4 Powerbook is running Linux - I think you _are_ the target market :) 

If your question was about getting a version running under OSX (on PowerPC) that may require a bunch of code changes. If you want to try, you're certainly welcome to go for it.

Ah, yeah I meant for OSX. And you're right - the fact that libuv requires 10.6 will likely be a showstopper.

Matt.

Ben Noordhuis

unread,
Sep 4, 2013, 4:12:33 AM9/4/13
to nod...@googlegroups.com
I removed a bunch of link-time framework dependencies recently so
there's a pretty good chance the latest master will compile and/or
run. If not, I'll accept patches. (Just make sure they're of good
quality. Anything that looks like it'll have to go through multiple
review rounds, I'll probably reject outright - I don't want to spend
too much time on this.)

OS X 10.4 and 10.5 have some gnarly kqueue() bugs though. How _well_
it will run node or libuv is anybody's guess.

Bruno Jouhier

unread,
Sep 4, 2013, 7:38:33 AM9/4/13
to nod...@googlegroups.com
Great news!

We would be very interested by an AIX port. PowerPC is a first step (and likely the most difficult one). Any plans for AIX?

Bruno

Bruno Jouhier

unread,
Sep 4, 2013, 7:44:55 AM9/4/13
to nod...@googlegroups.com

We've also managed to convince the code to (mostly) compile/run on AIX. So it's pretty flexible.

I had missed this line. Looks AWESOME. I'd like to beta test on my spare time.

Bruno

Matt

unread,
Sep 4, 2013, 9:49:35 AM9/4/13
to nod...@googlegroups.com
Thanks Ben, but to be honest it was just an old laptop I had lying around that I was curious if I could do dev work on, and then I realised it wouldn't compile node because of the G4 and old OS. I'm very unlikely to hack on it, and I doubt anyone wants to run node in production on old G4s.


am_p1

unread,
Sep 17, 2013, 7:34:33 PM9/17/13
to nod...@googlegroups.com
Any benchmarks you can share? like on one of those 4.42 GHz POWER7+ chips?

Andrew Low

unread,
Sep 18, 2013, 9:15:29 AM9/18/13
to nod...@googlegroups.com
Performance is certainly going to be a big focus as we move forward with the code base, but we're not quite there yet.

It is too early to do performance testing - the whole team is focused on function.

The changes we needed to make to the Node.js code base are minimal (trivial), if you go peek at the repository https://github.com/andrewlow/node you can see they are focused on a couple of endian issues and simply tweaking the GYP scripting to allow it to build with the right options.

Of course that is ignoring the port of V8 to PowerPC. You can find the code embedded in the repository above, or look here for the latest version: https://github.com/andrewlow/v8ppc All the development we're doing is in the open, the GitHub repositories are the master code base the team is working against day to day.

In terms of performance on PowerPC - there are going to be two large contributing factors. The quality of the code produced by GCC (and this may vary based on the level, there is the Advance Toolchain to consider here). The other factor is the V8 code (and quality) of the optimizations it performs. Lower down on the list will be tweaks to the openssl (assembly) and other open source projects that have optional assembly for optimization. 

There is still some low hanging fruit in our V8 port to PowerPC - we'll try to pick that sooner than later, but the real performance stuff is going to come after we've successfully got the V8 and Node code we've created adopted more broadly by the community - ideally we'll get our code into the master repositories making it easy for everyone to get it and help keep it current.

This is by no means a closed project, the code is there on GitHub. Fork it. Log issues. Contribute patches. 

If you're looking for PowerPC resources to work with - consider http://osuosl.org/services 

am_p1

unread,
Sep 18, 2013, 9:54:39 AM9/18/13
to nod...@googlegroups.com
Would love to try it out but unfortunately I don't have a PowerLinux box sitting around anywhere. Got one I can use for free? :-)

Andrew Low

unread,
Sep 19, 2013, 8:59:19 AM9/19/13
to nod...@googlegroups.com
The OSUSL systems (http://osuosl.org/services) are a shared resource, but still pretty impressive considering you can get a free account

For example, the http://v8ppc.osuosl.org:8080 machine is a 32core POWER7 at 3.5GHz.

You are correct, some of the latest, hottest hardware isn't easily available unless you're willing to pay the price. That shouldn't surprise anyone.

Carlos Arija

unread,
Oct 11, 2013, 8:00:15 PM10/11/13
to nod...@googlegroups.com
I gave them a try in an old G4 iBook running Debian, and all I got was an "Illegal instruction" message
Same result compiling the source files.
¿Any idea?

Louis Santillan

unread,
Oct 12, 2013, 10:58:30 AM10/12/13
to nod...@googlegroups.com
This seems to be for much newer PPC boxes.

Carlos Arija

unread,
Oct 13, 2013, 3:47:03 AM10/13/13
to nod...@googlegroups.com
I thought so. 
I just wanted to know if anyone had made it work in that hardware.
Thank you.

Andrew Low

unread,
Oct 15, 2013, 9:21:37 AM10/15/13
to nod...@googlegroups.com
We only have test / dev hardware that is more 'current' - but our goal is to be as inclusive as possible. I personally like old hardware and get a kick out of making it do useful stuff.

I suspect that you might be hitting a similar issue as the one logged here. https://github.com/andrewlow/v8ppc/issues/93 I'm still chipping away at that problem, but the hardware is remote and very slow. 

A G4 PowerMac I might be able to scare up locally - so I'll add that to the list of things to try. If you were enthusiastic and wanted to contribute, open a new issue on GitHub specific to your hardware/OS combination and I'll try to help with suggestions but you'll have to get your hands dirty with gdb etc.

Andrew Low

unread,
Oct 15, 2013, 4:15:28 PM10/15/13
to nod...@googlegroups.com
I've got some good news and some bad news.

Bad news - I can't replicate your problem.

Good news - I was able to dig up an old PowerMac running Ubuntu.

$ cat /etc/issue
Ubuntu 10.04.4 LTS \n \l

Unfortunately it appears to be a G5, not a G4.

$ cat /proc/cpuinfo
processor       : 0
cpu             : PPC970FX, altivec supported
clock           : 1800.000000MHz
revision        : 3.0 (pvr 003c 0300)

processor       : 1
cpu             : PPC970FX, altivec supported
clock           : 1800.000000MHz
revision        : 3.0 (pvr 003c 0300)

timebase        : 33333333
platform        : PowerMac
model           : PowerMac7,3
machine         : PowerMac7,3
motherboard     : PowerMac7,3 MacRISC4 Power Macintosh
detected as     : 336 (PowerMac G5)
pmac flags      : 00000000
L2 cache        : 512K unified
pmac-generation : NewWorld

FWIW - v8 seems to bootstrap just fine

$ ./out/ppc.debug/d8
V8 version 3.14.5 (candidate) [console: dumb]
d8> 3+4
7
d8>



Carlos Arija

unread,
Oct 16, 2013, 7:10:37 AM10/16/13
to nod...@googlegroups.com
First of all, please do not put much time in this problem. It is just a test.
Any way, here are the iBook G4 specs, if they are of any use to you.
And if I could be of any help in your project, just tell me.

/etc/issue
Debian GNU/Linux 7 \n \l

/proc/cpuinfo
processor : 0
cpu : 7447A, altivec supported
clock : 1199.999000MHz
revision : 1.2 (pvr 8003 0102)
bogomips : 73.72
timebase : 18432000
platform : PowerMac
model : PowerBook6,5
machine : PowerBook6,5
motherboard : PowerBook6,5 MacRISC3 Power Macintosh 
detected as : 287 (iBook G4)
pmac flags : 0000001b
L2 cache : 512K unified
pmac-generation : NewWorld
Memory : 1280 MB

Attachment: result of ./node -trace, until the program crashed with an "illegal instruction"
trace.txt

Andrew Low

unread,
Oct 16, 2013, 9:19:28 AM10/16/13
to nod...@googlegroups.com
Chasing this is a side-project, I've got plenty of other stuff I'm working on too :) 

The main reason that this is interesting is that it might help me resolve:  https://github.com/andrewlow/v8ppc/issues/93 -> but only if I can wrangle up some local hardware. Working over the wire is ok, but very very slow. These types of problems require a lot of iterations.

Thanks for the details on your iBook. One of the guys here has an old G4 we can try out, but we need to install Linux on it.

The trace is informative as well. It shows that "lots" of code is running, but you hit something specific causing a problem. This is not likely an issue with the Node code, but something in V8 (the JS runtime engine used by Node).

If you want to tinker - build the V8 code and run it.

cd v8ppc
make dependencies
make ppc

Then run the resulting d8 shell.

./out/ppc.debug/d8

If that works, you can try some simple JS code (either type it in to the shell, or pass a foo.js file in on the command line).

To run the V8 test suite, try: 

tools/run-tests.py -j 12 --progress=dots --no-presubmit --arch-and-mode=ppc.debug

When you have a crash case - running the scenario under gdb and capturing some info from there will be helpful.

gdb out/ppc.debug/d8

inside gdb:
r <optional command line args>
... it crashes..
bt                   <- generates a back trace, likely corrupted
x/20i $pc-16      <- dump instructions around the crash location
i r                     <- dump registers

That data will help isolate the issue.

Matt

unread,
Oct 16, 2013, 9:43:48 AM10/16/13
to nod...@googlegroups.com
If you really want to get this working, I could donate my G4 MacBook Pro to you. Email me off-list if you're interested. No idea where you're located so delivery might be an issue.


Andrew Low

unread,
Oct 16, 2013, 9:54:07 AM10/16/13
to nod...@googlegroups.com
Matt, that's an awesome (and generous) offer. Find someone near by and get them to give you a pat on the back or a big high five.

I'm in Ottawa, Canada for reference, but while I do really want to get this working - I'm pretty sure I can source a G4 locally. If that fails and the priority of this problem grows, I'll reach out.

Thanks

Matt

unread,
Oct 16, 2013, 1:35:25 PM10/16/13
to nod...@googlegroups.com
I'm in Toronto fwiw, so let me know if you don't find one locally.

Andrew Low

unread,
Oct 16, 2013, 2:43:46 PM10/16/13
to nod...@googlegroups.com
I decided to take another kick at my G5 as my assumption initially was that it was crashing immediately. The node trace output got me thinking that maybe it was a more isolated problem.

Running the V8 test suite gives me:

=== 45 tests failed
=== 45 tests CRASHED

Out of the nearly 9000 tests.

Looking at one of them...

$ ./out/ppc.release/d8 --test --stress-opt --always-opt --nobreak-on-abort --nodead-code-elimination ./test/mjsunit/mjsunit.js ./test/mjsunit/regress/regress-2185-2.js
============ Stress 1/5 ============
Illegal instruction

So I've got something to debug here.

Andrew Low

unread,
Oct 16, 2013, 4:53:52 PM10/16/13
to nod...@googlegroups.com
I'm going to stop cluttering up this thread with debug - and move this into a GitHub issue.
Please see https://github.com/andrewlow/v8ppc/issues/96 for updates. When / if I resolve the issue I'll update this thread.

Robert Steckroth

unread,
Oct 16, 2013, 8:19:39 PM10/16/13
to nodejs
Ya, that may be a wise direction to take. Although, it does not look as juicy as some of the other UI based platforms. 


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
<surgemcgee> Systems/Software Engineer



Michael Tunnicliffe

unread,
Oct 23, 2013, 11:40:29 AM10/23/13
to nod...@googlegroups.com
Hi Carlos

I've implemented a fix for this, documented in https://github.com/andrewlow/v8ppc/issues/96 but I want to check that it will be applied for you.
Can you run the following command on your machine and report the results, so I can check it is covered?
   
LD_SHOW_AUXV=1 /bin/true

Thanks
Mike


Message has been deleted

Carlos Arija

unread,
Oct 24, 2013, 3:00:20 AM10/24/13
to nod...@googlegroups.com
AT_DCACHEBSIZE:  0x20
AT_ICACHEBSIZE:  0x20
AT_UCACHEBSIZE:  0x0
AT_SYSINFO_EHDR: 0x100000
AT_HWCAP:        mmu fpu altivec ppc32
AT_PAGESZ:       4096
AT_CLKTCK:       100
AT_PHDR:         0x10000034
AT_PHENT:        32
AT_PHNUM:        9
AT_BASE:         0x48000000
AT_FLAGS:        0x0
AT_ENTRY:        0x10000c9c
AT_UID:          1000
AT_EUID:         1000
AT_GID:          1000
AT_EGID:         1000
AT_SECURE:       0
AT_RANDOM:       0xbfa3ee60
AT_EXECFN:       /bin/true
AT_PLATFORM:     ppc7450
AT_BASE_PLATFORM:ppc7450

Michael Tunnicliffe

unread,
Oct 24, 2013, 10:30:32 AM10/24/13
to nod...@googlegroups.com
Hi Carlos

Excellent, your machine should be covered by the fix documented in https://github.com/andrewlow/v8ppc/issues/96 (which covers AT_PLATFORM values of "ppc7450" and "ppc970"), please do try it out and let me know if it works for you.

Regards
Mike

Carlos Arija

unread,
Oct 26, 2013, 8:37:16 AM10/26/13
to nod...@googlegroups.com
Hi Mike.

It works. Great job.
Test's output in the attached file. Quite a bunch of crashed and failed tests.

Regards.
Carlos
v8Tests.tar.gz

Michael Tunnicliffe

unread,
Oct 28, 2013, 2:11:41 PM10/28/13
to nod...@googlegroups.com
Hi Carlos

Thanks for the output. I have just double-checked and the tests run clean on the G5 hardware we have here. We are in the process of setting up some G4 hardware and I will be testing on that as soon as it is ready. I'll keep you posted on the progress.

Regards
Mike

Carlos Arija

unread,
Oct 28, 2013, 5:33:44 PM10/28/13
to nod...@googlegroups.com
Hi Mike.

Thank you for your effort.
Although from now on I won't have much time to play with NODEJS in the PPC, I'll follow your progress with great interest.

I hope to hear from you soon.
Carlos.

tio00

unread,
Dec 23, 2013, 4:34:28 AM12/23/13
to nod...@googlegroups.com
Hi all!

I'm totally new to this, and first off I would like to thank everyone for the awesome work you are doing!

I, too, love using old hardware, which is why I recently took an old Titanium Powerbook G4 and installed Linux Mint PPC on it:

cat /etc/issue
Linux MintPPC 11 \n \l

It works great, and it blew me away when I found that you guys are porting node.js to ppc. I downloaded the release version and it compiled successfully, but I received an "Illegal instruction" imediately when trying to run node and npm. I found this thread and followed your instructions, and below is the info I got (I removed the comments before the PrintF's in is_processor to check that the processor was correctly identified):


LD_SHOW_AUXV=1 /bin/true
AT_DCACHEBSIZE:  0x20
AT_ICACHEBSIZE:  0x20
AT_UCACHEBSIZE:  0x0
AT_SYSINFO_EHDR: 0x100000
AT_HWCAP:        mmu fpu altivec ppc32
AT_PAGESZ:       4096
AT_CLKTCK:       100
AT_PHDR:         0x10000034
AT_PHENT:        32
AT_PHNUM:        9
AT_BASE:         0x48000000
AT_FLAGS:        0x0
AT_ENTRY:        0x10000c9c
AT_UID:          1000
AT_EUID:         1000
AT_GID:          1000
AT_EGID:         1000
AT_SECURE:       0
AT_RANDOM:       0xbf9356e0
AT_EXECFN:       /bin/true
AT_PLATFORM:     ppc7450
AT_BASE_PLATFORM:ppc7450

cat /proc/cpuinfo 
processor : 0
cpu : 7455, altivec supported
clock : 867.000000MHz
revision : 3.2 (pvr 8001 0302)
bogomips : 86.64
timebase : 33330863
platform : PowerMac
model : PowerBook3,5
machine : PowerBook3,5
motherboard : PowerBook3,5 MacRISC2 MacRISC Power Macintosh
detected as : 80 (PowerBook Titanium IV)
pmac flags : 0000001b
L2 cache : 256K unified
pmac-generation : NewWorld
Memory : 1024 MB

gdb out/ppc.debug/d8GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /home/toro/Development/v8ppc/out/ppc.debug/d8...done.
(gdb) r --test --stress-opt --always-opt --nobreak-on-abort --nodead-code-elimination --enable-slow-asserts --debug-code --verify-heap /home/toro/Development/v8ppc/test/mjsunit/mjsunit.js /home/toro/Development/v8ppc/test/mjsunit/regress/regress-crbug-3184.js
Starting program: /home/toro/Development/v8ppc/out/ppc.debug/d8 --test --stress-opt --always-opt --nobreak-on-abort --nodead-code-elimination --enable-slow-asserts --debug-code --verify-heap /home/toro/Development/v8ppc/test/mjsunit/mjsunit.js /home/toro/Development/v8ppc/test/mjsunit/regress/regress-crbug-3184.js
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc-linux-gnu/libthread_db.so.1".
============ Stress 1/2 ============
cpu_type = ppc7450
cpu_type = ppc7450
[New Thread 0x48938480 (LWP 18960)]

Program received signal SIGILL, Illegal instruction.
0x4aa0e98c in ?? ()
(gdb) bt
#0  0x4aa0e98c in ?? ()
#1  0x4aa47e18 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) x/20i $pc-16
   0x4aa0e97c: stw     r0,0(r1)
   0x4aa0e980: stw     r10,4(r1)
   0x4aa0e984: lfd     f6,0(r1)
   0x4aa0e988: addi    r1,r1,8
=> 0x4aa0e98c: fcfid   f6,f6
   0x4aa0e990: fcmpu   cr7,f7,f6
   0x4aa0e994: bso     cr7,0x4aa0e9b8
   0x4aa0e998: beq     cr7,0x4aa0e9a8
   0x4aa0e99c: blt     cr7,0x4aa0e9b0
   0x4aa0e9a0: li      r3,1
   0x4aa0e9a4: blr
   0x4aa0e9a8: li      r3,0
   0x4aa0e9ac: blr
   0x4aa0e9b0: li      r3,-1
   0x4aa0e9b4: blr
   0x4aa0e9b8: li      r3,-1
   0x4aa0e9bc: blr
   0x4aa0e9c0: lwz     r5,-1(r3)
   0x4aa0e9c4: lbz     r5,7(r5)
   0x4aa0e9c8: cmpwi   cr7,r5,166
(gdb) 

Seems like its stopping at a fcfid, which seems to be a 64 bit instruction...

I'd like to help, but I'm pretty much a noob. But anything I can do, please let me know. I have everything set up, so I just need a pointer in the right direction.

Again, thanks for all your hard work.

Andrew Low

unread,
Dec 23, 2013, 7:42:11 AM12/23/13
to nod...@googlegroups.com

This is the same problem as https://github.com/andrewlow/v8ppc/issues/97

The G4 processor lacks some of the machine instructions the code uses. If you look we've already fixed the G5 that also has a few missing, but not as many as the G4.

If you want to help please coordinate via the issue. It might be a bit slow as we're in the holiday season.

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/ivGMr-C_m1Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

tio00

unread,
Dec 23, 2013, 7:51:20 AM12/23/13
to nod...@googlegroups.com
Great! Thanks for your quick reply. Just one more quick question:

I've found several calls to fcfid, what would be the accepted way of adding an exception for the g4 in the code, in general?

Andrew Low

unread,
Dec 23, 2013, 9:31:02 AM12/23/13
to nod...@googlegroups.com
Here is the commit for the G5 changes, and the processor detection code.

Again, I'll encourage you to take this up in the issue.

Michael Tunnicliffe

unread,
Dec 23, 2013, 3:40:38 PM12/23/13
to nod...@googlegroups.com
Hi guys, I've also been looking at this as a side-project. I got as far as getting a no crash run on G4 hardware with a few test failures. It requires a number of functions to be changed to remove usage of fsqrt and fcfid, as well as altering the instruction cache size to 32. The code changes I have are not quite in a form where they are ready to go in to the main branch, but I will try and get them on github in either a separate branch or on my fork of the project.

Regards
Mike T

Alexander Post

unread,
Jan 10, 2014, 4:36:53 PM1/10/14
to nod...@googlegroups.com
Hi Andrew,

I tried to compile your node.js port on a Synology DS213+ (PPC). There is currently only GCC 4.3 available for this system and I get the following error:

make -C out BUILDTYPE=Release V=1

make[1]: Entering directory `/volume1/public/node/out'

  cc '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D_GNU_SOURCE' '-DHAVE_CONFIG_H' '-DCARES_STATICLIB' -I../deps/cares/include -I../deps/cares/src -I../deps/cares/config/linux  -Wall -Wextra -Wno-unused-parameter -pthread -m32 -g --std=gnu89 -pedantic -Wall -Wextra -Wno-unused-parameter -O2 -fno-strict-aliasing -fno-tree-sink  -MMD -MF /volume1/public/node/out/Release/.deps//volume1/public/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o.d.raw  -c -o /volume1/public/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o ../deps/cares/src/ares_cancel.c

cc1: error: unrecognized command line option "-fno-tree-sink"

make[1]: *** [/volume1/public/node/out/Release/obj.target/cares/deps/cares/src/ares_cancel.o] Error 1

make[1]: Leaving directory `/volume1/public/node/out'

make: *** [node] Error 2


I'm not very familiar with linux and I would be happy if you could help me.


Thanks 


Alex

Andrew Low

unread,
Jan 10, 2014, 9:35:07 PM1/10/14
to nod...@googlegroups.com
It looks like the Synology DS213+ (PPC) is a Freescale e500 class chip.

We've discovered there are issues with this chip and our assumptions in the code for PowerPC. See issues https://github.com/andrewlow/v8ppc/issues/99 and https://github.com/andrewlow/v8ppc/issues/100. We do intend to address this, but it's not a key platform for our team.

You've also apparently hit some compiler limitations - this will require some hacking the .gyp / .gypi files that are used to generate the makefiles. You can learn a bit about GYP here https://code.google.com/p/gyp/ -- or just grep around for the offending flag and remove it.(that might get you past the immediate issue).

There is some hope. In issue #99 I show how to build a 'simulated' version of the code (with performance implications!) which might get you limping until we get around to really supporting the e500. If you're more keen - issue #100 has a fair bit of detail and links to a starting point to make the right fixes.





--

Russell York

unread,
Jan 21, 2014, 7:24:21 PM1/21/14
to nod...@googlegroups.com
I have the following issue on my G4 mac mini.
I'll try rebuilding glib and see if that gets rid of the libthread message.
 
mcmini v8ppc # uname -a
Linux mcmini 3.10.25-gentoo #1 Sun Jan 19 13:33:29 EST 2014 ppc 7447A, altivec supported PowerMac10,1 GNU/Linux
mcmini v8ppc # cat /proc/cpuinfo
processor       : 0
cpu             : 7447A, altivec supported
clock           : 1249.999995MHz

revision        : 1.2 (pvr 8003 0102)
bogomips        : 83.24
timebase        : 41620997
platform        : PowerMac
model           : PowerMac10,1
machine         : PowerMac10,1
motherboard     : PowerMac10,1 MacRISC3 Power Macintosh
detected as     : 287 (Mac mini)
pmac flags      : 00000010

L2 cache        : 512K unified
pmac-generation : NewWorld
Memory          : 512 MB
mcmini v8ppc # gdb  out/ppc.debug/d8
GNU gdb (Gentoo 7.5.1 p2) 7.5.1

Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-unknown-linux-gnu".

For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /var/tmp/v8ppc/out/ppc.debug/d8...done.
(gdb) r --test --stress-opt --always-opt --nobreak-on-abort --nodead-code-elimination ./test/mjsunit/mjsunit.js ./test/mjsunit/regress/regress-2185-2.js
Starting program: /var/tmp/v8ppc/out/ppc.debug/d8 --test --stress-opt --always-opt --nobreak-on-abort --nodead-code-elimination ./test/mjsunit/mjsunit.js ./test/mjsunit/regress/regress-2185-2.js
warning: Could not load shared library symbols for linux-vdso32.so.1.
Do you need "set solib-search-path" or "set sysroot"?

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
============ Stress 1/2 ============
[New Thread 0x4882a480 (LWP 5107)]


Program received signal SIGILL, Illegal instruction.
0x54943298 in ?? ()
(gdb) bt
#0  0x54943298 in ?? ()
#1  0x54942d14 in ?? ()

Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) x/20i $pc-16  
   0x54943288:  stw     r0,0(r1)
   0x5494328c:  stw     r10,4(r1)
   0x54943290:  lfd     f6,0(r1)
   0x54943294:  addi    r1,r1,8
=> 0x54943298:  .long 0xfcc0369c
   0x5494329c:  fcmpu   cr7,f7,f6
   0x549432a0:  bso-    cr7,0x549432c4
   0x549432a4:  beq-    cr7,0x549432b4
   0x549432a8:  blt-    cr7,0x549432bc
   0x549432ac:  li      r3,1
   0x549432b0:  blr
   0x549432b4:  li      r3,0
   0x549432b8:  blr
   0x549432bc:  li      r3,-1
   0x549432c0:  blr
   0x549432c4:  li      r3,-1
   0x549432c8:  blr
   0x549432cc:  lwz     r6,-1(r3)
   0x549432d0:  lbz     r5,7(r6)
   0x549432d4:  cmpwi   cr7,r5,132
(gdb) i r
r0             0x0      0
r1             0xbfffe93c       3221219644
r2             0x48030820       1208158240
r3             0x0      0
r4             0x3f714421       1064387617
r5             0x0      0
r6             0x0      0
r7             0x84     132
r8             0x0      0
r9             0x549433c1       1418998721
r10            0x0      0
r11            0xbfffe8e8       3221219560
r12            0x10020744       268568388
r13            0x100261c4       268591556
r14            0xc      12
r15            0xfb05554        263214420
r16            0xbfffe918       3221219608
r17            0x0      0
r18            0x0      0
r19            0x0      0
r20            0x5342a709       1396877065
r21            0x1001f044       268562500
r22            0x53408091       1396736145
r23            0x0      0
r24            0x0      0
r25            0x0      0
r26            0x0      0
r27            0x480206d0       1208092368
r28            0xbfffeaac       3221220012
r29            0xbfffeab0       3221220016
r30            0xffe1b78        268311416
r31            0xbfffe944       3221219652
pc             0x54943298       0x54943298
msr            0x8d932  579890
cr             0x28000422       671089698
lr             0x54942d14       0x54942d14
ctr            0x549431e0       1418998240
xer            0x0      0
orig_r3        0x1006f000       268890112
trap           0x700    1792
(gdb)

Andrew Low

unread,
Jan 21, 2014, 8:44:56 PM1/21/14
to nod...@googlegroups.com

You are hitting a known issue. Please see https://github.com/andrewlow/v8ppc/issues/97

The G4 is an old processor that doesn't support all the instructions we're using.

Michael Deschu

unread,
Jan 28, 2014, 8:40:13 AM1/28/14
to nod...@googlegroups.com
Hi, Andrew, Little off topic from Node.js (which is awesome) but I noticed that you were able to get Jenkins to run on a Linux based PowerPC. How were you able to get that up and running since Jenkins relies on at least Java 1.5?  I could not find any Java package from Oracle on PowerPC. Were you able to use an alternative JVM like OpenJDK? I wanted to setup Jenkins but realized that we are currently building on PowerMac G5s.

Andrew Low

unread,
Jan 28, 2014, 1:55:46 PM1/28/14
to nod...@googlegroups.com
I'm using Linux on Power as my host of http://v8ppc.osuosl.org:8080/
There is an IBM version of Java available for this platform (dig around here and you'll find it) http://www.ibm.com/developerworks/java/

If you're on a G5, then the IBM version won't work as it's not compiled on that platform.  know there has been work on OpenJDK and Power. I see a blog post here that looks sort of hopeful http://javaevangelist.blogspot.com/2012/02/openjdk-7-on-apple-g5-powerpc-on-mac-os.html

Michael Deschu

unread,
Jan 28, 2014, 3:05:55 PM1/28/14
to nod...@googlegroups.com
Ok we may end up grabbing another Power7 anyway =). But for now that's good news. OpenJDK is the suggested JVM for Jenkins anyhow. gcj is the one that is not so well behaved.. Thank you for the info.

Niels Liisberg

unread,
Mar 21, 2014, 4:26:57 AM3/21/14
to nod...@googlegroups.com
Hi Andrew, 

Why haven't I found you before :) This is what I have been waiting for in years...  

Have you also made it for the PASE environment on the IBMi?

Regards

Niels




Andrew Low

unread,
Mar 24, 2014, 10:18:12 AM3/24/14
to nod...@googlegroups.com
Niels,

You can find AIX 7.1 builds here: http://v8ppc.osuosl.org:8080/ - but these won't work as it under the PACE environment which is targeted at AIX 6.1.

I do know that "some" of the code has been made to work by someone working against our source repository on github. IBM doesn't yet have an easy to download version for IBM iSeries - but as my job is to bring Node.js and V8 to IBM Platforms, my plan is to achieve exactly that.

If you want to take a shot and getting it going yourself, I'd be happy to accept issues logged against the github projects

https://github.com/andrewlow/v8ppc

as you discover / resolve issues. I'll make a few suggestions here to start anyone off who wants to tackle this task

1) You probably want a recent version of GCC (like: 4.8.2)
2) v8ppc/src/platform-aix.cc  may need some tweaks for mprotect

Specifically..

replace 

 if (mprotect(base, size, prot) == -1) return false; 


with


  if (mprotect(base, size, prot) == -1) {                                          

    perror("mprotect"); 

    return false;                                              

  }   


and 


void* reservation = mmap(OS::GetRandomMmapAddr(),         

                         request_size,                    

                         PROT_NONE,                       

                         MAP_PRIVATE | MAP_ANONYMOUS,     

                         kMmapFd,                         

                         kMmapFdOffset);         


the mprotect with PROT_READ|PROT_WRITE will fail.


Change the PROT_NONE to PROT_READ | PROT_WRITE


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/ivGMr-C_m1Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marco Dac

unread,
Apr 3, 2014, 4:44:45 PM4/3/14
to nod...@googlegroups.com
Hi, after finding out about this porting, I wanted to give it a try, but now I'm stuck, here is what i've done until now.
I've an iBook G4 with Debian.

After some trying I've find out and managed to compile V8ppc (the g4compat branch), I've it working in my home directory.
Then I've decided to move to node and I've downloaded and builded the v0.10.26 as it is it's, but it doesn't start: Illegal instruction.
I've read that this problem can be given by the v8 version that is not fully compatible with my G4, so I've substituted the deps/v8pp in the node repository with the v8ppc g4compat and then launched the build, but it give me this error:

/node/out/Release/obj/gen/debug-support.cc:41:34: error: 'kTransitionsIndex' is not a member of 'v8::internal::DescriptorArray'
/node/out/Release/obj/gen/debug-support.cc:44:37: error: 'MAP_TRANSITION' was not declared in this scope
/node/out/Release/obj/gen/debug-support.cc:334:50: error: 'kInstanceDescriptorsOrBitField3Offset' is not a member of 'v8::internal::Map'
make[1]: *** [/node/out/Release/obj.target/v8_base/gen/debug-support.o] Error 1
make[1]: Leaving directory `/node/out'

make: *** [node] Error 2

I think I'm loosing something here but I'm not very familiar with the building process.

Maybe some of you can give me some direction on how to proceed.
Thanks,
Marco

Jérémy Lal

unread,
Apr 3, 2014, 4:47:43 PM4/3/14
to nod...@googlegroups.com
Le jeudi 03 avril 2014 à 13:44 -0700, Marco Dac a écrit :
> Hi, after finding out about this porting, I wanted to give it a try, but
> now I'm stuck, here is what i've done until now.
> I've an iBook G4 with Debian.

Hold your breath ! libv8-3.14 ppc patches are coming to debian/sid soon.

Jérémy.


Andrew Low

unread,
Apr 4, 2014, 3:15:09 PM4/4/14
to nod...@googlegroups.com
Cool - thanks Jérémy Lal. The Ubuntu builds have the PowerPC code merged in here: https://launchpad.net/ubuntu/trusty/+source/libv8-3.14/3.14.5.8-5ubuntu2 

As you probably know - I've got a libv8 branch here: https://github.com/andrewlow/v8ppc/tree/libv8-3.14

However, Marco Dac is building on a G4 based chip - this is not yet supported in our main code streams. He'll need to look at the slightly behind https://github.com/andrewlow/v8ppc/tree/g4compat branch.

Also, it sounds like Marco is trying to build Node.js with V8 statically linked in. There is a little bit of magic here most of which you'll find in this patch done by the node folks https://github.com/andrewlow/node/commit/e2385839d7bde937334e34da082293cae877fe2f

If you look through the git log you'll find the v8 patches applied etc, as Node will backport some changes into the older stream they have in deps. 

The easier way to get running is to build v8 as a shared library pass "library=shared" along on the make command line.

Then for Node - you need to pass --shared-v8 into ./configure and probably also --shared-v8-libpath to point to where it is.  You may need to also set LD_LIBRARY_PATH depending on where the libv8 is installed.



Marco Dac

unread,
Apr 5, 2014, 6:45:34 AM4/5/14
to nod...@googlegroups.com
Thanks four your support, but i've to bother you with another question, i've recompiled v8ppc with the "library=shared" args and it's all fine.
I've copied the contents of ppc.release in the /usr/lib/v8ppc folder, here is the content:

dac@ibook:/usr/lib/v8ppc$ ls -l
total 22992
-rwxr-xr-x  1 root root 17979178 Apr  5 11:47 cctest
-rwxr-xr-x  1 root root    52202 Apr  5 11:47 d8
drwxr-xr-x  2 root root     4096 Apr  5 11:47 lib.target
-rwxr-xr-x  1 root root    19690 Apr  5 11:47 lineprocessor
-rwxr-xr-x  1 root root  5189321 Apr  5 11:47 mksnapshot
drwxr-xr-x  3 root root     4096 Apr  5 11:47 obj
drwxr-xr-x 17 root root     4096 Apr  5 11:47 obj.target
-rwxr-xr-x  1 root root   226143 Apr  5 11:47 preparser
-rwxr-xr-x  1 root root    36560 Apr  5 11:47 process
-rwxr-xr-x  1 root root    19273 Apr  5 11:47 shell

(Since i was not sure about what i really needed i copied it all...)
I've also configured the LD_LIBRARY_PATH in my .profile

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/v8ppc/lib.target/libv8.so

Now I've cloned the node git repo and I'm trying to build it following the Andrew Low suggestion, I've done:

sudo ./configure --shared-v8 --shared-v8-libpath=/usr/lib/v8ppc/lib.target/libv8.so 

This is the ./configure output
dac@ibook:~/Labs/nodejsLibrary/node$ sudo ./configure --shared-v8 --shared-v8-libpath=/usr/lib/v8ppc/lib.target/libv8.so
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': [ '-L/usr/lib/v8ppc/lib.target/libv8.so',
                                      '-lv8']},
  'variables': { 'clang': 0,
                 'gcc_version': 46,
                 'host_arch': 'ppc',
                 'node_byteorder': 'big',
                 'node_install_npm': 'true',
                 'node_prefix': '',
                 'node_shared_cares': 'false',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_v8': 'true',
                 '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': 'ppc',
                 'v8_enable_gdbjit': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_use_snapshot': 'true'}}
creating  ./config.gypi
creating  ./config.mk

And then:
sudo make

But here is the a problem, seems like the compiler doesn't found the v8.h file:

/Labs/nodejsLibrary/node/out/Release/obj.target/node/src/fs_event_wrap.o ../src/fs_event_wrap.cc
In file included from ../src/fs_event_wrap.cc:22:0:
../src/node.h:62:16: fatal error: v8.h: No such file or directory
compilation terminated.
make[1]: *** [/home/dac/Labs/nodejsLibrary/node/out/Release/obj.target/node/src/fs_event_wrap.o] Error 1
make[1]: Leaving directory `/home/dac/Labs/nodejsLibrary/node/out'
make: *** [node] Error 2

There is something else I'm missing? I've to put also the source code together with the library folder?

Andrew Low

unread,
Apr 6, 2014, 9:11:20 AM4/6/14
to nod...@googlegroups.com
I think you're close. I suggest you read the configure script that's in the root of the node source tree, it'll help figure out the options.

I think all you need is --shared-v8-includes

Marco Dac

unread,
Apr 6, 2014, 4:56:18 PM4/6/14
to nod...@googlegroups.com
Thank you for the support, I just finished to compile node and seems it's working fine.
If you need me to run some test on this old machine just ask.
In the mean time i will start my little project with NodeJs.

David Stancu

unread,
Dec 21, 2014, 12:54:51 PM12/21/14
to nod...@googlegroups.com
Andrew,

Thank you very kindly for this. I've just successfully built both v8 and node on my PowerMac G5 (latest Debian)! Awesome!
Reply all
Reply to author
Forward
0 new messages