Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 799ef298 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes Ic06f85d3,I6b2c100b into msm-next

* changes:
  ANDROID: kasan, LLVMLinux: add clang-specific CFLAGS_KASAN
  ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
parents 52803c0f c62cdce5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -379,7 +379,6 @@ LDFLAGS_vmlinux =
CFLAGS_GCOV	:= -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
CFLAGS_KCOV	:= $(call cc-option,-fsanitize-coverage=trace-pc,)


# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE    := \
		-I$(srctree)/arch/$(hdr-arch)/include/uapi \
@@ -699,7 +698,8 @@ KBUILD_CFLAGS += $(stackp-flag)

ifeq ($(cc-name),clang)
ifneq ($(CROSS_COMPILE),)
CLANG_TARGET	:= -target $(notdir $(CROSS_COMPILE:%-=%))
CLANG_TRIPLE	?= $(CROSS_COMPILE)
CLANG_TARGET	:= -target $(notdir $(CLANG_TRIPLE:%-=%))
GCC_TOOLCHAIN	:= $(realpath $(dir $(shell which $(LD)))/..)
endif
ifneq ($(GCC_TOOLCHAIN),)
+8 −0
Original line number Diff line number Diff line
@@ -9,10 +9,18 @@ KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)

CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address

ifeq ($(cc-name),clang)
CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \
		-mllvm \
		-asan-mapping-offset=$(KASAN_SHADOW_OFFSET) \
		-asan-stack=1 -asan-globals=1 \
		-asan-instrumentation-with-call-threshold=$(call_threshold))
else
CFLAGS_KASAN := $(call cc-option, -fsanitize=kernel-address \
		-fasan-shadow-offset=$(KASAN_SHADOW_OFFSET) \
		--param asan-stack=1 --param asan-globals=1 \
		--param asan-instrumentation-with-call-threshold=$(call_threshold))
endif

ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),)
   ifneq ($(CONFIG_COMPILE_TEST),y)