RISC OS Open Support


(Difference between revisions)
Jump to: navigation, search
m (Building ROOL Sources with GCC: ROOL internal link updated to correct gap in wiki)
Line 10: Line 10:
== Building ROOL Sources with GCC ==
== Building ROOL Sources with GCC ==
I have been looking at the problem of compiling the RISC OS sources from [[ROOL]] using GCC.  There are a number of distinct problems to be solved.  This documents the issues.
I have been looking at the problem of compiling the RISC OS sources from [[RISC OS Open Ltd|ROOL]] using GCC.  There are a number of distinct problems to be solved.  This documents the issues.
=== Aim ===
=== Aim ===

Revision as of 08:06, 18 May 2010

This page is in support of tools and functionality used by RISC OS Open sources.



bzip2 is required to access ROOL archives. This can found here:

Building ROOL Sources with GCC

I have been looking at the problem of compiling the RISC OS sources from ROOL using GCC. There are a number of distinct problems to be solved. This documents the issues.


Allow build of all, or at least, significant parts of the RISC OS sources sufficient to build a minimal ROM, or to allow improvement of the core RISC OS apps (Paint, Draw, etc). For the ROM target, a reasonable choice is the IOMD build (RiscPC/A7000), since I can easily test this under RPCEmu. The goal here is to build using the GCCSDK cross compiler on Linux, but also at least be able to build some of the components natively under RISC OS using GCC. It is imperative that the source continues to be build using the native Acorn C/C++ suite.


CVS Names

The C files in the ROOL CVS are in RISC OS format, which is an issue when trying cross compile. That is, c.progname (where c is a directory name), rather than the Unix format progname.c. In many cases, using CVS or Subversion under RISC OS will deal directly with Unix format names, and convert locally to RISC OS format (which is why this isn't generally an issue). But it's not really convenient to a source-wide rename. It would be possible to modify the GCC cross compiler to understand these names, but it still causes problems for 'make' and precludes use of other tools later on (e.g. lint).

The solution I have taken is instead to have a script that creates a symlink of the sources into the canonical names. This script do other things such as linking "Makefile.GCC" to just "Makefile" in the symlinked directory. It also allows separation of native build objects from the cross ones.


Many C #includes refer to "h.filename", rather than "filename.h". Again, GCC could probably be patched to understand this, but it's better to simply fix them up. In my local sources I have done this in an automated fashion, and have several hundred pending changes to CVS.

There are some wackier names, like "h.dirname.filename", which really require some manual path changes in CVS. This only occurs in a few places, but I have pending changes for these also.

Finally, because of the case-insensitivity of the RISC OS filename handling, in many instances, the #include names do not match in case. This is generally a manual fix as I go along.

Some of these same issues apply to assembler, such as reversing s.filename in GET statements.

C Compatibility

All the C in RISC OS is written or modified to work with Norcroft (Acorn C/C++). This is tolerant of a few things that GCC will not accept (say, passing NULL instead of 0), so those will need to be fixed up. Other issues include occasional inline assembler, which will need to be rewritten using the GCC equivalent (and then #ifdefed).

Finally, the source for the RISC OS SharedCLibrary contains many Norcroft C peculiarities and platform-specific references, and does not readily build with GCC. Fortunately, RISC OS GCC contains its own SharedCLibrary headers and stubs, so building programs against it (which is pretty much everything C in the ROOL sources) is not a problem. Then SCL is still a problem, since it is required to generated a ROM, and should it prove too difficult, it could potentially be substituted with Graham Shaw's version.

Assembler Compatibility

The GCC assembler - in particular, the one included with the original AOF GCC rather than the binutils 'gas', and is now called 'asasm' - supports the vast majority of objasm syntax, or almost everything that is found in normal programs. The RISC OS sources however make extensive used of its more arcane features, and although 'asasm' has received major improvements, it still does not assemble everything, and for the moment, this precludes building some of the core assembler parts of RISC OS.

Main Components


This is the main historic C library used for RISC OS C apps. This builds without issue.


This is the other main C library used by the RISC OS sources. I have not built this yet, but do not expect issue.

Assembler Headers

These rely upon Hdr$Path (or HDR_PATH when cross compiling) to find various assembler includes. Unfortunately, the mechanism we have to do this when cross assembling does not readily support multiple entries in this value as it does natively, so I will instead use a single Hdr directly which is a symlink farm.

Platform Configuration Files

These are a mix of RISC OS Obey files and others, so this needs an equivalent under Linux.

Makefiles and Build System

More to come.

Personal tools