Google has traditionally been against upgrading the compiler as it comes with new warnings and potentially changes behavior. However, these are actually good reasons to upgrade, they help shake out undefined behavior.
In order to compile with a newer version of GCC, you'll need to do a few modifications to your kernel in addition to a new toolchain. I recommend using the ones available from Bootlin.
- Remove gcc-wrapper and any instances of
-Werror
: gcc-wrapper is CAF's shitty way of enabling-Werror
, which is unnecessary since regular-Werror
will suffice. We need to remove it for the time being because there will be new warnings to fix. Pick Google's revert of it (3.18, 4.4) then remove any other instances of-Werror
(such as in prima, qcacld-2.0, and qc