(Redirected from GCC)
Jump to: navigation, search



GCC for RISC OS is a complete, free and fully-featured compiler solution for RISC OS based on the GNU Compiler Collection. It can compile C and C++ using modern standards and assemble ARM code. It also includes support for RISC OS modules, and usage of the native RISC OS Shared C Library, or the bundled Unix-compatibility library UnixLib as runtime library. It aims to be feature complete above and beyond the commercial Castle Technology Ltd's C/C++ compiler suite.

There also exist front ends for other languages, such as Fortran, Objective C, Ada 9X, Modula-3, Pascal, Cobol and Java, however these have not been ported to run on RISC OS at this time. Some of these are present, but unsupported, in older versions of RISC OS GCC.

The current version of GCC for RISC OS is 4.7.4 release 2 which is based on the ELF Object format and binutils. Previous releases were based on GCC 3.4 and targeted the traditional RISC OS AOF and AIF targets.

GCCSDK is a cross-compile environment that permits compiling of RISC OS programs under other Unix-like operating systems, taking advantage of the speed and tools available on those platforms. It is also able to cross-compile a large body of ported software, and easy porting of new packages and libraries. See its documentation for more details.

Using GCC under RISC OS


An APCS-32 supporting Shared C Library (version 5.17 or later) is required to run GCC. This means that only pre-RISC OS 4.39 (Select 3i4) users need an update of their Shared C Library which they can get from Castle, see below. All later versions of RISC OS have this prerequisite fulfilled.


GCC is very easy to setup on RISC OS. It is available via PackMan as a package from riscos.info and this will automatically take care of all dependencies on other packages. It can also be downloaded directly and unpacked manually but here you need to take care of loading and unpacking all necessary dependencies yourself.

Base Install

This is dependent on (handled by PackMan):

Additional languages and tools

It is also recommended you download the 'make' utility either via PackMan or directly:

C++ support is in the gcc4-c++ package:

Additional tools such as flex, bison, etc which were previously bundled with the GCC compiler are available in separate packages.

Shared Library Support

For ELF runtime and shared library support, you will need the SharedLibs packages:


If you're interested in the sources (an alternative is to do download them from our SVN server):

RISC OS GCC Tutorials and information

In addition, the !GCC application itself contains a number of examples (inside !GCC.Examples).

Distributing GCC compiled programs

GCC can compile programs using either the SharedCLibrary or UnixLib as runtime libraries. In case UnixLib runtime library is used as shared library, additional requirements are needed to run the distributed program.


When you distribute a GCC compiled program and are using the SharedCLibrary as runtime library (i.e. using option -mlibscl), then no additional support files generally need to be made available with your program.

GCC does produce code which requires an APCS-32 supporting version of the SharedCLibrary (version 5.17 or later), however, so you should check (in the !Run file) that your user has a suitably up-to-date version installed. See the Castle documentation for details of this and the IYONIX pc download page for recent versions of SharedCLibrary suitable for RISC OS versions prior to RISC OS 4.39 (Select 3i4).

Note that all new RISC OS platforms ship with a sufficiently up-to-date version of the module present already.


When you are using UnixLib as runtime library (and that's the default runtime library), then an up-to-date version of some UnixLib support modules need to be used together with your program. The following is an overview of these support modules :

The modules SharedUnixLibrary, Digital Renderer, Iconv and CryptRandom will be RMEnsure'd with their minimal needed version number by the UnixLib code at the moment their functionality is needed. Error message will be returned when these modules are not available or are too old, so programmers don't need to RMEnsure those module versions.

When you distribute a copy of these UnixLib support modules with your program, please also mention the URLs in documentation and/or installation notes or program where up-to-date versions can be found.

Shared libraries

When the built program is using shared libraries, a copy of the shared libraries is needed to run the program. Instead of distributing the shared libraries together with your program, we strongly recommend to refer to the following URLs where the latest up-to-date copy of the shared libraries can be found:

The C++ shared libraries are available as an extra package:

Useful programs

The following list contains useful programs helping you to develop with GCC on RISC OS :

  • Sourcery : Sourcery will manage the source code that makes up a project but it will also manage the various resources files that are required to produce a RISC OS application. These include Sprite, Message and Template files.
  • ProfileMod : ProfileMod can be used to profile your code at expense of having to recompile it with the GCC option -finstrument-functions.
  • dmalloc port : dmalloc can be used to find memory leaks or memory corruptions due to wrong malloc()/free()/etc. use. It has been ported to RISC OS and is currently located in GCCSDK Autobuilder in the develop/dmalloc subdirectory.


GCC and GCCSDK pages

GCC for RISC OS, GCC tutorial, GCC common switches, GCC for beginners, UnixLib, ELFLoader
GCCSDK and Unix porting
GCCSDK, GCCSDK Releases, GCCSDK Development, Using GCCSDK, Autobuilder Development and Packaging Cygwin setup, Accelerating autobuilder with apt-proxy, ChoX11, Developer help wanted

Personal tools