https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84908
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Jason Vas Dias from comment #2) > Thanks H.J. - > > RE: > > vDSO isn't compiled with -mindirect-branch=thunk-extern in kernel > > 4.16-rc5. Why isn't it the case for you? > > All I know is , when submitting a patched vclock_gettime.c > in which the switch in vdso_clock_gettime() had 6 clauses > instead of 5, I received in response a mail from 4.16-rc5 has ifdef CONFIG_RETPOLINE ifneq ($(RETPOLINE_CFLAGS),) KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE endif endif vDSO isn't compiled with $(KBUILD_CFLAGS). Why does your kernel do it? > > But I don't want my patch to have to depend on this being removed - > the removal of these flags effectively removes retpoline support, no ? > It is a shame to have to do that after it was carefully added. > > My gripe is really that nothing in GCC should work with a switch > with < 6 clauses, and fail with a switch with >= 6 clauses. > This is if statement vs jump table for switch implementation.