Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) CFLAGS_KASAN_NOSANITIZE := -fno-builtin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) KASAN_SHADOW_OFFSET ?= $(CONFIG_KASAN_SHADOW_OFFSET)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) ifdef CONFIG_KASAN_STACK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) 	stack_enable := 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) 	stack_enable := 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) ifdef CONFIG_KASAN_GENERIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) ifdef CONFIG_KASAN_INLINE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	call_threshold := 10000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	call_threshold := 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) # -fasan-shadow-offset fails without -fsanitize
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 			-fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 			$(call cc-option, -fsanitize=kernel-address \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 			-mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	# Now add all the compiler specific options that are valid standalone
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	 $(call cc-param,asan-globals=1) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	 $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	 $(call cc-param,asan-stack=$(stack_enable)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	 $(call cc-param,asan-instrument-allocas=1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) endif # CONFIG_KASAN_GENERIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) ifdef CONFIG_KASAN_SW_TAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) ifdef CONFIG_KASAN_INLINE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)     instrumentation_flags := $(call cc-param,hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)     instrumentation_flags := $(call cc-param,hwasan-instrument-with-calls=1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) CFLAGS_KASAN := -fsanitize=kernel-hwaddress \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 		$(call cc-param,hwasan-instrument-stack=$(stack_enable)) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 		$(call cc-param,hwasan-use-short-granules=0) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 		$(instrumentation_flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) endif # CONFIG_KASAN_SW_TAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) export CFLAGS_KASAN CFLAGS_KASAN_NOSANITIZE