Skip to content

Instantly share code, notes, and snippets.

@SeppoTakalo
Last active November 8, 2019 11:39
Show Gist options
  • Save SeppoTakalo/1103350736200c6fbfae6c5a88811931 to your computer and use it in GitHub Desktop.
Save SeppoTakalo/1103350736200c6fbfae6c5a88811931 to your computer and use it in GitHub Desktop.

Install ccache for Arm GCC

  1. Download GNU Arm Embedded Toolchain
  2. Unpack: tar xf arm-none-eabi-gcc-<version>.tar.bz2
  3. Edit your .bashrc or .bash_profile or similar:
    1. Add to PATH as a LAST member: export PATH="$PATH:$HOME/gcc-arm-none-eabi-9-2019-q4-major/bin"
    2. Create ~/bin and add to PATH as a first member: PATH=$HOME/bin:$PATH
  4. Install ccache: sudo apt install ccache or brew install ccache
  5. Add links to $HOME/bin:
cd ~/bin
for tool in gcc g++ cpp c++;do ln -s $(which ccache) arm-none-eabi-$tool;done

Mbed developer

Do not add GCC_ARM path into mbed config, this will skip the PATH end effectively skip the ccache.

Add following to your .bashrc:

export MBED_BUILD_TIMESTAMP=hardcoded_value_to_enable_ccache

This allows ccache to kick in on the preprocessor phase as well, because timestamps do not change anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment