[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jKOqnAGkpgr0iY47gFYAuJXQnsF5dQO655D00voVkX5UQ@mail.gmail.com>
Date: Wed, 17 Feb 2016 15:03:35 -0800
From: Kees Cook <keescook@...omium.org>
To: Michal Marek <mmarek@...e.com>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
linux-kbuild <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH] kbuild: disable Android-specific compiler features
On Fri, Feb 5, 2016 at 4:44 PM, Kees Cook <keescook@...omium.org> wrote:
> The Android compilers enable some non-standard features by default. While
> most Android build systems inject the needed "-mno-android" option via
> KCFLAGS, it happens too late (at least on x86_64), since KBUILD_CFLAGS
> gains KCFLAGS after running (and failing) many cc-option tests. (For
> example, the stack-protector tests happen after arch-specific
> KBUILD_CFLAGS are added but before the external KCFLAGS are added.) As
> such, we should notice this option and immediately turn it on as the
> first cc-option test we run.
>
> Signed-off-by: Kees Cook <keescook@...omium.org>
Michal, is this okay? I'd like to get it into -next soon if possible.
Thanks!
-Kees
> ---
> Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 6c1a3c247988..126c98b582bb 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -393,6 +393,10 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> -Wno-format-security \
> -std=gnu89
>
> +# We must turn off the Android-specific compiler options as early as possible
> +# otherwise cc-option calls below may erroneously fail.
> +KBUILD_CFLAGS += $(call cc-option,-mno-android,)
> +
> KBUILD_AFLAGS_KERNEL :=
> KBUILD_CFLAGS_KERNEL :=
> KBUILD_AFLAGS := -D__ASSEMBLY__
> --
> 2.6.3
>
>
> --
> Kees Cook
> Chrome OS & Brillo Security
--
Kees Cook
Chrome OS & Brillo Security
Powered by blists - more mailing lists