linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: add -fcf-protection=none to retpoline flags
@ 2019-07-09 18:49 Seth Forshee
  2019-07-15 12:21 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Seth Forshee @ 2019-07-09 18:49 UTC (permalink / raw)
  To: Masahiro Yamada, Michal Marek; +Cc: linux-kbuild, linux-kernel

-mindirect-branch and -fcf-protection are not compatible, and
so kernel builds fail with a gcc build where -fcf-protection is
enabled by default. Add -fcf-protection=none to the retpoline
flags to fix this.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 3e4868a6498b..050f11d19777 100644
--- a/Makefile
+++ b/Makefile
@@ -636,6 +636,10 @@ 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)))
 RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
+# -mindirect-branch is incompatible with -fcf-protection, so ensure the
+# latter is disabled
+RETPOLINE_CFLAGS += $(call cc-option,-fcf-protection=none,)
+RETPOLINE_VDSO_CFLAGS += $(call cc-option,-fcf-protection=none,)
 export RETPOLINE_CFLAGS
 export RETPOLINE_VDSO_CFLAGS
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] kbuild: add -fcf-protection=none to retpoline flags
  2019-07-09 18:49 [PATCH] kbuild: add -fcf-protection=none to retpoline flags Seth Forshee
@ 2019-07-15 12:21 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2019-07-15 12:21 UTC (permalink / raw)
  To: Seth Forshee
  Cc: Michal Marek, Linux Kbuild mailing list, Linux Kernel Mailing List

On Wed, Jul 10, 2019 at 3:49 AM Seth Forshee <seth.forshee@canonical.com> wrote:
>
> -mindirect-branch and -fcf-protection are not compatible, and
> so kernel builds fail with a gcc build where -fcf-protection is
> enabled by default. Add -fcf-protection=none to the retpoline
> flags to fix this.
>
> Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
> ---

Applied to linux-kbuild. Thanks.



>  Makefile | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 3e4868a6498b..050f11d19777 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -636,6 +636,10 @@ 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)))
>  RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG)))
> +# -mindirect-branch is incompatible with -fcf-protection, so ensure the
> +# latter is disabled
> +RETPOLINE_CFLAGS += $(call cc-option,-fcf-protection=none,)
> +RETPOLINE_VDSO_CFLAGS += $(call cc-option,-fcf-protection=none,)
>  export RETPOLINE_CFLAGS
>  export RETPOLINE_VDSO_CFLAGS
>
> --
> 2.20.1
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-15 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-09 18:49 [PATCH] kbuild: add -fcf-protection=none to retpoline flags Seth Forshee
2019-07-15 12:21 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).