Be careful when switching the toolchain

  • Newer Buildroot versions use ccache. This is a wrapper for GCC that caches compiler runs to speed up subsequent builds. This is done by generating some hashes over the source files. If the hashes don't change, the file is not actually recompiled and a cached version of the object file is used instead. This is considerable faster than a recompilation.

    However this whole mechanism will fail, if the toolchain is replaced. Because then the hashes remain the same, and then the files are still taken from the cache instead of newly built. And this cached code does not fit to any newly compiled files and the result will most probably fail to run. So in this case, you have to clean the cache. This is done by deleting the whole directory ~/.buildroot-ccache.

    Lets do an example. Let's assume on our i.MX6 boards you have always compiled buildroot with the Freescale GCC4.4.4 toolchain. Now you want to switch to the F&S toolchain based on GCC 4.7.2. Before recompiling buildroot, you should call

    1. rm -r ~/.buildroot-ccache

    Then you can start a new build:

    1. make clean
    2. make

    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.