For building your own software, OpenRISC is supported by a 32-bit GNU toolchain offering C and C++ support. The toolchain is available in several forms, depending on your use case:
or1k-elf for bare metal use, based on the newlib library.
or1k-linux-uclibc for Linux application use, based on the uClibc library.
To run multiple applications in parallel and to use their rich features there is an up-to-date support for a few operating systems:
Linux is a widely used general purpose operating system.
RTEMS is a real-time operating system for embedded systems.
A cross-compiler toolchain is used to compile your software code for the OpenRISC processor. The toolchain is executed on the the host computer and generates a program or library that can be executed on the processor then. There is a baremetal toolchain that is based on the Newlib C library. Other toolchains to compile programs to be run on an operating system can be found below.
Basic Tool and Compiler Support
Some basic tools form an actual toolchain:
Binutils: Binutils contains tools needed for linking programs and libraries, compiling assembler code etc. The binutils distribution contains support for OpenRISC (
or1k). Beside this a development repository is used to test new features before submitting it to the binutils project.
Newlib is a C library for embedded
systems. Our baremetal toolchain
or1k-elf is built on it. The
library provides the basic functions like
printf and memory
libgloss is the part of newlib that does the actual
hardware handling: It configures the processor, the UART and sets the
stack according to the available physical memory. For this it depends
on some external symbols, which are defined by board libraries and may
Beside the basic C library functionality, the
libgloss port for
OpenRISC defines some helper functions for exception and interrupt
handling, timers and other peripherals. The latest releases and
documentation can be found on the
or1k-elf newlib website.
The musl toolchain is the preferred toolchain for build programs that should run on Linux. The exceptions to this is software that depend on extensions only found in glibc. For example, building Debian requires glibc.
The RTEMS port was dead for a few years, but has been re-established in 2014 during a Google Summer of Code project. The student documented his work in his blog and the work is part of the RTEMS project now.