Message ID | 20190916134157.32219-2-seth.forshee@canonical.com |
---|---|
State | New |
Headers | show |
Series | kbuild: add -fcf-protection=none when using retpoline flags | expand |
diff --git a/Makefile b/Makefile index 4c249a80dd17..d1e762787f5c 100644 --- a/Makefile +++ b/Makefile @@ -885,6 +885,12 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) # change __FILE__ to the relative path from the srctree KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +# ensure -fcf-protection is disabled when using retpoline as it is +# incompatible with -mindirect-branch=thunk-extern +ifdef CONFIG_RETPOLINE +KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) +endif + # use the deterministic mode of AR if available KBUILD_ARFLAGS := $(call ar-option,D)