This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| development:toolchain [2015/08/18 13:31] – hess | development:toolchain [2021/08/04 09:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| Many or even most tasks can be implemented using the integrated [[sdk:sdk | SDK]] with the C-like scripting language and the router API functions. | Many or even most tasks can be implemented using the integrated [[sdk:sdk | SDK]] with the C-like scripting language and the router API functions. | ||
| ===== Toolchain ===== | ===== Toolchain ===== | ||
| - | However, if for some reasons you want or have to cross-compile a C application, | + | However, if for some reasons you want or have to cross-compile a C application, |
| - | [[ftp:// | + | [[https:// |
| - | This toolchain | + | The toolchains |
| a assembler and linker ([[https:// | a assembler and linker ([[https:// | ||
| a [[wp>C standard library]] ([[http:// | a [[wp>C standard library]] ([[http:// | ||
| - | for NetModule Routers | + | for NetModule Routers. |
| + | |||
| + | The following Cross-Compilation toolchains are available: | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| For further introduction to GCC please refer to [[http:// | For further introduction to GCC please refer to [[http:// | ||
| + | **Please be ware that NetModule can not support systems with customer extensions.** | ||
| ==== Getting Started ==== | ==== Getting Started ==== | ||
| - | 1. Download and install the toolchain on your Linux x86 PC | + | 1. Download and install the corresponding |
| <code bash> | <code bash> | ||
| - | wget ftp:// | + | wget https:// |
| tar -xvf toolchain-ppc-4.4.5-x86_64.tar.bz2 -C /opt | tar -xvf toolchain-ppc-4.4.5-x86_64.tar.bz2 -C /opt | ||
| export PATH=$PATH:/ | export PATH=$PATH:/ | ||
| Line 42: | Line 50: | ||
| 3. Compile it | 3. Compile it | ||
| + | |||
| + | __PowerPC: | ||
| <code bash> | <code bash> | ||
| powerpc-openwrt-linux-gcc -Wall hello.c -o hello | powerpc-openwrt-linux-gcc -Wall hello.c -o hello | ||
| </ | </ | ||
| - | 4. Copy it to the router (e.g. via SCP) and run it. | + | __ARM:__ |
| + | <code bash> | ||
| + | arm-openwrt-linux-gcc -Wall hello.c -o hello | ||
| + | </ | ||
| - | ===== Oracle Virtual Box Image ===== | + | 4. Copy it to the router |
| - | For small projects or if you don't have a Linux environement you can also use the very small [[ftp:// | + | |
| - | ===== Example: Compile a program from Source | + | ==== Example: Compile a program from Source ==== |
| This example shows you how to compile a program from source. The program in this example is [[https:// | This example shows you how to compile a program from source. The program in this example is [[https:// | ||
| + | __PowerPC__ | ||
| <code bash> | <code bash> | ||
| wget https:// | wget https:// | ||
| Line 61: | Line 74: | ||
| make | make | ||
| </ | </ | ||
| + | |||
| + | __ARM__ | ||
| + | <code bash> | ||
| + | wget https:// | ||
| + | tar -xzf jq-1.5.tar.gz | ||
| + | cd jq-1.5 | ||
| + | CC=arm-openwrt-linux-gcc ./configure --host=arm --disable-maintainer-mode | ||
| + | make | ||
| + | </ | ||
| + | |||
| + | **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, | ||
| We can now check the file type and we see, that the program has been compiled for PowerPC. Now we can copy '' | We can now check the file type and we see, that the program has been compiled for PowerPC. Now we can copy '' | ||
| Line 67: | Line 92: | ||
| 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 | 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 [[https:// | ||