If I make the same changes to the Makefile as per the link in comment #16, then the kernel compiles fine and without the zillions of warnings I mentioned in comment #13. However I can not find this anywhere "upstream" as the notes seem to indicate.
doug@serv-ee:~/temp-k-git/linux$ git diff diff --git a/Makefile b/Makefile index 3e4868a6498b..d8ccc47215be 100644 --- a/Makefile +++ b/Makefile @@ -630,8 +630,8 @@ ifdef CONFIG_FUNCTION_TRACER CC_FLAGS_FTRACE := -pg endif -RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register -RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register +RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register -fcf-protection=none +RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register -fcf-protection=none RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) -- You received this bug notification because you are a member of Kernel Packages, which is subscribed to linux in Ubuntu. https://bugs.launchpad.net/bugs/1830961 Title: Kernels & kernel drivers fail to build with gcc-9 [error: ‘-mindirect- branch’ and ‘-fcf-protection’ are not compatible] Status in gcc-9 package in Ubuntu: Invalid Status in linux package in Ubuntu: Confirmed Status in nvidia-graphics-drivers-430 package in Ubuntu: Fix Committed Status in virtualbox package in Ubuntu: Confirmed Status in xtables-addons package in Ubuntu: New Bug description: Compiling kernels & kernel modules fails due to these errors: ./include/linux/compiler.h:193:1: error: ‘-mindirect-branch’ and ‘-fcf-protection’ are not compatible (This happens with any kernel modules.) This appears to be due to the changes in 9.1.0-3ubuntu1 enabling -fcf- protection by default on 19.10's gcc-9. Switching to gcc-8 allows compilation to proceed. WORKAROUND: sudo ln -fs gcc-8 /usr/bin/gcc To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-9/+bug/1830961/+subscriptions -- Mailing list: https://launchpad.net/~kernel-packages Post to : kernel-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~kernel-packages More help : https://help.launchpad.net/ListHelp