RISC OS Open
Safeguarding the past, present and future of RISC OS for everyone
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Cross-building RISC OS

RISC OS’ sources have some support for cross-building from a Unix-style environment. At present support is somewhat incomplete, neglected, broken and undocumented. This page aims to document some deduction of the process by trial and error. It is likely there are mistakes – feel free to correct them.

RISC OS’ primary toolchain is its own Desktop Development Environment and the closed-source Norcroft compiler. When cross-building, the favoured compiler is a build of Norcroft for Linux or other platform. However it’s possible to make some progress using GCC.

The build involves sourcing some scripts into your shell environment – supposedly this will work with several shells, but for now we’ll assume you’re using bash on Linux (or WSL). Other platforms may run into different issues.

To set up the build tools:

  1. Build GCCSDK for your chosen platform. We’ll assume you have installed it in /home/riscos for the purposes of this guide (ie the cross compiler in /home/riscos/cross and other tools in /home/riscos/env)
  2. Fetch the cross-tools
    
    git clone https://gitlab.riscosopen.org/Products/CrossTools.git
    cd CrossTools
    git submodule update --init --remote
    export CROSSTOOLS=$(pwd)
    
  3. Configure your environment for building tools using native GCC/etc
    
    export GCCSDK_INSTALL_CROSSBIN=/home/riscos/cross/bin
    cd $CROSSTOOLS/RiscOS/Env/ROOL
    source CrossTools.sh
    
  4. Export symbols from some libraries
    
    cd $CROSSTOOLS/RiscOS/Sources/Lib/RISC_OSLib
    make export
    cd $CROSSTOOLS/RiscOS/Sources/Lib/CLXLite
    make export
    
  5. Build srcbuild (currently using a fork until PR7 is merged)
    
    cd $CROSSTOOLS
    mkdir -p RiscOS/Utilities/Release
    #git clone https://gitlab.riscosopen.org/RiscOS/Utilities/Release/srcbuild.git RiscOS/Utilities/Release/srcbuild
    git clone https://gitlab.riscosopen.org/tmarkettos/srcbuild.git RiscOS/Utilities/Release/srcbuild
    cd $CROSSTOOLS/RiscOS/Utilities/Release/srcbuild
    git checkout cross-execvpe
    make install
    
  6. Create a new terminal (for a fresh build environment) and run the below in it
  7. Fetch the sources you want to build (eg BCM2835 for Raspberry Pi)
    
    git clone https://gitlab.riscosopen.org/Products/BCM2835.git
    cd BCM2835
    git submodule update --init --remote
    export TREE=$(pwd)
    
  8. Symlink the srcbuild binary into this new tree and add it to your PATH
    
    export CROSSTOOLS=<path to your CrossTools folder>
    cd $TREE
    mkdir -p RiscOS/Install/srcbuild
    ln -s $CROSSTOOLS/RiscOS/Install/srcbuild/srcbuild $TREE/RiscOS/Install/srcbuild/srcbuild
    export PATH=$PATH:$TREE/RiscOS/Install/srcbuild
    
  9. You can now use srcbuild to perform build actions, eg:
    
    export GCCSDK_INSTALL_CROSSBIN=/home/riscos/cross/bin
    export TOOLCHAIN=GNU  # don't use Norcroft
    source $TREE/RiscOS/Env/ROOL/BCM2835.sh
    cd $TREE/RiscOS
    srcbuild list
    

srcbuild is designed to orchestrate the stages of the build process, in the same way as Builder . However, at this point can’t go much further because some of the Makefiles are no longer cross-compile friendly. A task for the eager reader is to fix them up…

See also

Cross-build forum thread from 2010
riscos.info wiki article from 2008-12

Revised on November 16, 2022 16:49:23 by Theo Markettos (89)? (5.65.107.147)
Edit | Back in time (2 revisions) | See changes | History | Views: Print | Source

Search the Wiki

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
  • Export
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys