GCCSDK
Introduction - GCC and GCCSDK
GCCSDK is really two closely related sub-projects - GCC for RISC OS and GCCSDK, the environment for developing GCC and porting programs to RISC OS. The documentation is split accordingly.
GCC
GCC is a complete, free and fully-featured compiler solution for RISC OS. It can compile C, C++, and Fortran using modern standards. 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. Bundled with it are several development tools such as GNU Make, and an assembler. It aims to be feature complete above and beyond the commercial Castle C/C++ compiler suite.
There also exist front ends for other languages, such as Objective C, Ada 9X, Modula-3, Pascal, Cobol and Java, however these have not been ported to run on RISC OS at this time.
[GCC for RISC OS]
GCCSDK
GCC Software Development Kit (GCCSDK) is a portable build environment for creating RISC OS executables to be run natively on RISC OS. The build environment is designed to be hosted on a Unix-like system, such as GNU/Linux, FreeBSD, Solaris, MacOS X or even Windows (under Cygwin). GCCSDK releases are tied-in with the corresponding GCC releases.
GCCSDK can be used to compile and develop GCC and UnixLib itself, or as the basis for a cross-compiling system. It includes a number of "porting scripts" which automate the process of building and configuring new ports, which would otherwise be difficult and error prone, and not possible when done natively under RISC OS.
GCCSDK Autobuilder
The autobuilder is a powerful system for automatically fetching, configuring and building of sources and dependencies for programs, making use of the porting scripts. Done manually, such a process would be tedious, time-consuming and error prone. Once a program is added to the autobuilder, other developers can easily reproduce the work, and concentrate on the important details.
The autobuilder presently includes instructions for building around 150 libraries and programs for RISC OS.
Using GCCSDK to cross-compile for RISC OS
Cross-compiling for RISC OS is done by using GCCSDK on Unix-alike host system, such as GNU/Linux, FreeBSD, Solaris, MacOS X or even Windows (under Cygwin). To get started, ensure you have a Subversion client installed for your system, and fetch the GCCSDK source:
mkdir gccsdk svn co svn://svn.riscos.info/gccsdk/branches/release_3_4_6/gcc gccsdk/gcc svn co svn://svn.riscos.info/gccsdk/trunk/autobuilder gccsdk/autobuilder
Detailed instructions are given in the file gccsdk/gcc/README, however they are essentially the following (this assumes that you can write to a directory named /home/riscos):
cd gccsdk/gcc autoconf ; autoheader ./do-configure make setup make build-cross make porting-scripts
Now use the autobuilder to build a package:
mkdir ~/build cd ~/build <path to gccsdk dir>/autobuilder/build -v wget
See autobuilder documentation gccsdk/autobuilder/AutoBuilder.html for more detailed instructions.
RISC OS GCC Related Information
Pages relevant to using GCC.
Distributing GCC compiled programs
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 need to be made available with your program.
On the other hand 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 :
- SharedUnixLibrary module (mandatory) : http://www.riscos.info/downloads/gccsdk/sharedunixlib/system.zip
- Digital Renderer module (only needed when your code is using the OSS sound interface via the /dev/dsp device) : http://www.riscos.info/downloads/gccsdk/sharedunixlib/system.zip
- Iconv module (only needed when your code is using iconv routines, note temporary separate A9 home version) : http://netsurf.sourceforge.net/iconv/
- CryptRandom module (only needed when random data is read via /dev/(u)random device) : http://www.markettos.org.uk/
- !UnixHome application (typically required by some ported Unix programs wishing to store configuration files and settings in the Unix user's home directory) : !UnixHome. The !UnixHome application should be 'seen' by the RISC OS Filer before they can make use of it.
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. Appropriate error message will be returned when these modules are not available or when they do not have a sufficent high enough version number.
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.
GCCSDK GCC Releases
All recent GCCSDK GCC Releases can be found at [1]. Details on what is changed in each release can be found at GCCSDK Releases.
Mailing list
A mailing list exists for GCCSDK discussions.
Bug reporting
To keep track of bugs in GCCSDK we are using a bug-tracking system. It is preferable to use this rather than e-mailing in order to avoid mails getting lost in our rather large inboxes and also in order to have an overview of any outstanding issues.
GCCSDK Source Repository
Until beginning of March 2006 all our GCCSDK source code was managed using CVS. At that point we converted our CVS repository into a Subversion repository and are no longer using CVS. Details how to access GCCSDK source repository can be found at our source repositories overview.