GCC for RISC OS

From RISC OS

(Difference between revisions)
Jump to: navigation, search
(Additional clarification on version requirement for SCL)
m (Fix URL after breakage in http://www.riscos.info/index.php?title=GCC_for_RISC_OS&oldid=4230)
Line 52: Line 52:
* Iconv module (only needed when your code is using iconv routines) : http://netsurf.sourceforge.net/iconv/
* Iconv module (only needed when your code is using iconv routines) : http://netsurf.sourceforge.net/iconv/
* CryptRandom module (only needed when random data is read via /dev/(u)random device) : http://www.markettos.org.uk/
* 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) : [ http://www.riscos.info/packages/MiscDetails.html#UnixHome !UnixHome]. The !UnixHome application should be 'seen' by the RISC OS Filer before they can make use of it.
+
* !UnixHome application (typically required by some ported Unix programs wishing to store configuration files and settings in the Unix user's home directory) : [http://www.riscos.info/packages/MiscDetails.html#UnixHome !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 sufficiently high version number. So as a programmer you don't need to RMEnsure those module versions in your programs.
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 sufficiently high version number. So as a programmer you don't need to RMEnsure those module versions in your programs.

Revision as of 00:39, 8 May 2008

Contents

Using GCC under RISC OS

Prerequisites

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.

Setup

GCC is very easy to setup on RISC OS. The following is what you need to get started with a fully working C compiler.

Additional languages and tools

You will almost certainly need at least 'make' from the following package.

You may also wish to install one or more of the following components as well :

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.

SharedCLibrary

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.

UnixLib

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. Appropriate error message will be returned when these modules are not available or when they do not have a sufficiently high version number. So as a programmer you don't need to RMEnsure those module versions in your programs.

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.

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.

Links

GCC and GCCSDK pages
GCC under RISC OS

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