As a temporary workaround I changed the compile flags in /usr/src/linux-headers-foo/Makefile around line 634 to
RETPOLINE_CFLAGS_GCC := -mindirect-branch-register RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch-register
and now it compiled with gcc9
As a temporary workaround I changed the compile flags in /usr/src/ linux-headers- foo/Makefile around line 634 to
RETPOLINE_ CFLAGS_ GCC := -mindirect- branch- register VDSO_CFLAGS_ GCC := -mindirect- branch- register
RETPOLINE_
and now it compiled with gcc9