This is an old revision of the document!


Many or even most tasks can be implemented using the integrated SDK with the C-like scripting language and the router API functions.


However, if for some reasons you want or have to cross-compile a C application, you will find a PowerPC cross-compilation toolchain on our FTP server. This toolchain consists of a compiler ( GNU Compiler Collection (GCC) version 4.4.5), a assembler and linker ( GNU binutils) and a C standard library ( uClibc version 0.9.31), all built to produce binaries for NetModule Routers with Freescale/Motorola PowerPC (MPC830x) CPUs, namely NB1600, NB2700, NB2710, NB3700, and NB3710.

For the ARM based products NB2800, NB3701, NB3711 and NB3800 the toolchain is available on ARM cross-compilation toolchain.

For further introduction to GCC please refer to An Introduction to GCC, chapter 2 and following ones.

Please be ware that NetModule can not support systems with customer extensions.

Getting Started

1. Download and install the toolchain on your Linux x86 PC

tar -xvf toolchain-ppc-4.4.5-x86_64.tar.bz2 -C /opt
export PATH=$PATH:/opt/toolchain-ppc-4.4.5-x86_64/bin

2. Write a program

int main()
    printf("Hello World\n");
    #ifdef __UCLIBC__
    printf("We are coding against uClibc\n");
    printf("uClibc v%i %i.%i\n",__UCLIBC_MAJOR__, __UCLIBC_MINOR__, __UCLIBC_SUBLEVEL__);
    return 0;

The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user-space programs. Section 2 documents the system calls provided by the Linux kernel and section 3 documents the functions provided by the standard C library. Another reference guide for the C standard library can be found here.

3. Compile it

powerpc-openwrt-linux-gcc -Wall hello.c -o hello

4. Copy it to the router (e.g. via SCP) and run it.

Example: Compile a program from Source

This example shows you how to compile a program from source. The program in this example is jq

tar -xzf jq-1.5.tar.gz
cd jq-1.5
CC=powerpc-openwrt-linux-gcc ./configure --host=powerpc --disable-maintainer-mode

Note: Patch required to fix y0, y1, j0 and j1 related build issue on uClibc
Our default uClibc configuration does not have DO_XSI_MATH=y, so it lacks certain math functions. jq generates some wrappers for the libm functions, even for functions that are not actually used by jq. By simply removing those wrappers, we get jq to build on uClibc that have DO_XSI_MATH disabled.

We can now check the file type and we see, that the program has been compiled for PowerPC. Now we can copy jq to NB1600 and run it.

file jq
jq: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0402, not stripped

Oracle Virtual Box Image

For small projects or if you don't have a Linux environement you can also use the very small Virtual Box Image. The image uses Tiny Core Linux ( Please read the startup message carefully. This is only valid for the NB1600, NB2700/2710, NB3700/3710.