lkml.org 
[lkml]   [2017]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 2/5] kasan/Makefile: Support LLVM style asan parameters.
From
Date

On 12/02/2017 12:36 AM, Paul Lawrence wrote:
>

Missing:
From: Andrey Ryabinin <aryabinin@virtuozzo.com>

Please, don't change authorship of the patches.

> LLVM doesn't understand GCC-style paramters ("--param asan-foo=bar"),
> thus we currently we don't use inline/globals/stack instrumentation
> when building the kernel with clang.
>
> Add support for LLVM-style parameters ("-mllvm -asan-foo=bar") to
> enable all KASAN features.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
> scripts/Makefile.kasan | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
> index 1ce7115aa499..7c00be9216f4 100644
> --- a/scripts/Makefile.kasan
> +++ b/scripts/Makefile.kasan
> @@ -10,10 +10,7 @@ KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
>



> + # -fasan-shadow-offset fails without -fsanitize
> + CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \
> + -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \
> + $(call cc-option, -fsanitize=kernel-address \
> + -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET)))
> +
> + ifeq ("$(CFLAGS_KASAN_SHADOW)"," ")

This not how it was in my original patch. Why you changed this?
Condition is always false now, so it breaks kasan with 4.9.x gcc.

> + CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
> + else
> + # Now add all the compiler specific options that are valid standalone
> + CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
> + $(call cc-param,asan-globals=1) \

\
 
 \ /
  Last update: 2017-12-04 17:15    [W:0.100 / U:0.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site