Cross-compiling PowerPC

There are a lot of different variants of the PowerPC architectures out there. This is what worked for me when cross compiling for the Freescale P2041 processor. The P2041 contains four e500mc cores. e500mc cores are not the same thing as e500v2. My test platform was the Freescale P2041RDB development board. The development board is running a custom port of Linux. My host platform is a virtual machine running Ubuntu 14.04.2 LTS.

Cross compile tool chain

The cross compile tool chain that I used was version 5.5.3 of the ELDK tool kit. When downloading the tool kit you need eldk-5.5.3-powerpc.iso. When I installed the tool kit I used the command line

./install -r "lsb-dev" powerpc

libsodium

The ELDK tool kit does not come with a pre-compiled version of libsodim and you have to build your own. Download libsodium from libsodium. I used libsodium-1.0.3.tar.gz. Extract libsodium to a local directory. I used the following command line to build the library.

This places the compiled library files in a directory /opt/eldk-5.5.3/powerpc/sysroots/powerpc-linux The actual location is going to vary based upon the cross compile tool chain that you use. The make install command must be executed from a root shell if you are using Ubuntu as your host machine. When I used "sudo make install" the install failed. To start a root shell execute the command

sudo gnome-terminal

zeromq

Download the source for zeromq. I used zeromq-4.1.2.tar.gz. Extract to a local directory. I used the following command line to build the library

I then copied the entire directory chassisStaging, which contained hwserver, hwclient over to my target.

For the server

~/work/chassisStaging$ ./hwserver
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
Received Hello
^C

For the client

~/work/chassisStaging$ ./client
Connecting to hello world server...
Sending Hello 0...
Received World 0
Sending Hello 1...
Received World 1
Sending Hello 2...
Received World 2
Sending Hello 3...
Received World 3
Sending Hello 4...
Received World 4
Sending Hello 5...
Received World 5
Sending Hello 6...
Received World 6
Sending Hello 7...
Received World 7
Sending Hello 8...
Received World 8
Sending Hello 9...
Received World 9

Written: 07 Mar 2016 10:35Revised: 07 Mar 2016 10:37

If you found this page useful, please rate it up so others will find it.