Toolchains are a core part of OSMC. They are architecture specific packages containing a small userland and tools with a minimal set of packages to build other OSMC packages. They are exclusively used for building packages under the package/ directory.

Toolchains are built using debootstrap, and then using chroot() to configure the toolchain. These toolchains are then compiled in to a Debian package so that they can be easily redistributed.

Using pre-built toolchains

If you follow the instructions on Getting involved with OSMC Development, you will automatically be using a pre-built OSMC toolchain, which will be fetched from the OSMC APT repository.

We regularly update the toolchains as changes are made upstream. You should purge and update your toolchain at least once every six months to guarantee compatibility with OSMC.

Building your own toolchain

You may wish to build your own toolchain, either because you wish to make some changes, or because you'd like to see how it works.

To build a toolchain for ARMv7 based devices, you can run the following commands:

cd toolchain/armv7-toolchain-osmc

The output will then be a Debian based package which you can install by running dpkg -i. This will install the toolchain under /opt/osmc-tc.

Checking your toolchain version

You can check the version and installation status of all OSMC toolchains on your system by running the following command:

dpkg -l | grep toolchain-osmc

This will give output similar to the following:

ii  amd64-toolchain-osmc                        1.0.4                                               all          OSMC toolchain for amd64 architecture
ii  armv7-toolchain-osmc                        1.2.5                                               all          OSMC toolchain for ARMv7
ii  i386-toolchain-osmc                         1.2.5                                               all          OSMC toolchain for i386 architecture

ii means that the toolchain is installed.

Purging your own toolchain

Sometimes, it is necessary to purge your toolchain. There are a variety of reasons for this:

Please note that if you purge your toolchain and run another build, OSMC will automatically grab the latest toolchain again.

Toolchain design advantages

There are a number of advantages to our toolchain based approach.

  1. Easy to maintain build integrity -- just purge your toolchain before building a new package to guarantee that you have satisfied all build dependencies.
  2. Minimal footprint -- the OSMC build system fetches dependencies as they are needed, and toolchains only package a small amount of tools (compiler). This decoupling allows new build dependencies to be introduced quickly, or old ones to be changed without having to rebuild the toolchains. This also allows for a smaller toolchain size and a longer release cycle for toolchains.
  3. Contained package. Our toolchains ship as a single Debian package. This makes the toolchains easier to build, install and modify.