X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Makefile;h=0fc511aac61cc9d965c96e496505d1cbe909ed7f;hb=e7dbd4d5369df7d101d6fde5595229df7060939d;hp=08510230b42f335ae0b2fce4813aa4c3a3635e39;hpb=1dbfae0113f1423b42c304989a3cc8a7dd0ea53e;p=uclinux-h8%2Flinux.git diff --git a/Makefile b/Makefile index 08510230b42f..0fc511aac61c 100644 --- a/Makefile +++ b/Makefile @@ -688,17 +688,6 @@ ifdef CONFIG_FUNCTION_TRACER CC_FLAGS_FTRACE := -pg endif -ifdef CONFIG_CC_IS_GCC -RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register) -RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register) -endif -ifdef CONFIG_CC_IS_CLANG -RETPOLINE_CFLAGS := -mretpoline-external-thunk -RETPOLINE_VDSO_CFLAGS := -mretpoline -endif -export RETPOLINE_CFLAGS -export RETPOLINE_VDSO_CFLAGS - include $(srctree)/arch/$(SRCARCH)/Makefile ifdef need-config @@ -953,6 +942,11 @@ KBUILD_CFLAGS += -Wvla # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += -Wno-pointer-sign +# In order to make sure new function cast mismatches are not introduced +# in the kernel (to avoid tripping CFI checking), the kernel should be +# globally built with -Wcast-function-type. +KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) + # disable stringop warnings in gcc 8+ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)