GCC-9 and Ubuntu kernel error

if you Linux suddenly stop compiling the kernel or kernel modules from packages (nvidia, virtualbox) check that you are not using gcc-9 as default C compiler, it has a problem with some parameters needed to compile with protections for the last Intel bugs, showing in the broken compilation like this:

error: '-mindirect-branch' and '-fcf-protection' are not compatible

switching to gcc-8 should fix the problem:

sudo update-alternatives --install /usr/bin/gcc gcc  /usr/bin/gcc-8 1
This entry was posted in Uncategorized. Bookmark the permalink.