Re: [patch 05/16] kasan: fix hwasan build for gcc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 09, 2021 at 01:58PM -0700, Andrew Morton wrote:
> On Fri, 9 Apr 2021 22:39:46 +0200 Andrey Konovalov <andreyknvl@xxxxxxxxx> wrote:
> 
> > >
> > >  endif # CONFIG_KASAN_SW_TAGS
> > > _
> > 
> > Hi,
> > 
> > As I commented on the patch, this breaks SW_TAGS build with Clang for me with:
> > 
> > arch/arm64/include/asm/current.h:19: undefined reference to `__hwasan_tls'
> > 
> > The reason for this is that cc-param is only defined for
> > KASAN_GENERIC, the definition needs to be moved.
> > 
> 
> Oh.  I thought that had been fixed.
> 
> Please send a patch?

I think we need something like the below.

Unless a fixed version has already been sent, feel free to squash
(applies immediately after "kasan: fix hwasan build for gcc", and before
the conflicting "kasan: remove redundant config option").

Thanks,
-- Marco

------ >8 ------

From: Marco Elver <elver@xxxxxxxxxx>
Date: Sun, 11 Apr 2021 21:32:01 +0200
Subject: [PATCH] fixup for "kasan: fix hwasan build for gcc"

Signed-off-by: Marco Elver <elver@xxxxxxxxxx>
---
 scripts/Makefile.kasan | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan
index 0a2789783d1b..127012f45166 100644
--- a/scripts/Makefile.kasan
+++ b/scripts/Makefile.kasan
@@ -2,6 +2,8 @@
 CFLAGS_KASAN_NOSANITIZE := -fno-builtin
 KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
 
+cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1)))
+
 ifdef CONFIG_KASAN_GENERIC
 
 ifdef CONFIG_KASAN_INLINE
@@ -12,8 +14,6 @@ endif
 
 CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address
 
-cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1)))
-
 # -fasan-shadow-offset fails without -fsanitize
 CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \
 			-fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \
-- 
2.31.1.295.g9ea45b61b8-goog





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux