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: # Build "GCCSDK":https://www.riscos.info/index.php/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) # Fetch the cross-tools <pre><code> git clone https://gitlab.riscosopen.org/Products/CrossTools.git cd CrossTools git submodule update --init --remote export CROSSTOOLS=$(pwd) </code></pre> # Configure your environment for building tools using native GCC/etc <pre><code> export GCCSDK_INSTALL_CROSSBIN=/home/riscos/cross/bin cd $CROSSTOOLS/RiscOS/Env/ROOL source CrossTools.sh </code></pre> # Export symbols from some libraries <pre><code> cd $CROSSTOOLS/RiscOS/Sources/Lib/RISC_OSLib make export cd $CROSSTOOLS/RiscOS/Sources/Lib/CLXLite make export </code></pre> # Build srcbuild <pre><code> cd $CROSSTOOLS mkdir -p RiscOS/Utilities/Release git clone https://gitlab.riscosopen.org/RiscOS/Utilities/Release/srcbuild.git RiscOS/Utilities/Release/srcbuild cd $CROSSTOOLS/RiscOS/Utilities/Release/srcbuild make install </code></pre> # Create a new terminal (for a fresh build environment) and run the below in it # Fetch the sources you want to build (eg BCM2835 for Raspberry Pi) <pre><code> git clone https://gitlab.riscosopen.org/Products/BCM2835.git cd BCM2835 git submodule update --init --remote export TREE=$(pwd) </code></pre> # Symlink the srcbuild binary into this new tree and add it to your PATH <pre><code> 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 </code></pre> # You can now use srcbuild to perform build actions, eg: <pre><code> 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 </code></pre> srcbuild is designed to orchestrate the stages of the build process, in the same way as [[Builder|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... h2. See also "Cross-build forum thread from 2010":https://www.riscosopen.org/forum/forums/3/topics/394 "riscos.info wiki article from 2008-12":https://www.riscos.info/index.php/RISC_OS_Open_Support