I've included the GCC version 8.2.0 for the raspberry pi 3, compiled by skarnet: http://skarnet.org/toolchains This toolchain will compile binaries that are supported by the pi 3 and upward models. By default, the compiler in this toolchain will not look in the following directories: /lib /include /usr/lib /usr/include So I've created a specs file (which I've added to the toolchain) using: # gcc -dumpspecs > specs and edited it to look into the above directories. # Location of the specs file: $(TOOLCHAIN)/lib/gcc/$(ARCH)-linux-musl/$(GCC_VERSION)/ so that it will look for the above directories on purpose and will save most people (including me) from linking nightmares. I typically place the compiler in "/" for easy compiler access, followed by modification to $PATH. I also added /usr/local/bin directly after the toolchain $PATH and then I added symlinks to ccache in /usr/local/bin. There's no need to make symlinks in /bin as gcc is now already in $PATH. mkdir -p /usr/local/bin ln -s /bin/ccache /usr/local/bin/cc ln -s /bin/ccache /usr/local/bin/c++ ln -s /bin/ccache /usr/local/bin/gcc ln -s /bin/ccache /usr/local/bin/g++