Current UBSan kernel image with Clang build will be too large and overlap other partition in memory layout. Google will fix it on Clang so we need a workaround before it's fixed to disable some sanitizer option to reduce kernel image size 1. remove object-size sanitizer Change-Id: I8f64336827a8f6b57daedcd3daf7bb2daf87a26b Signed-off-by: James Hsu <james.hsu@mediatek.com> CR-Id: ALPS04724079 Feature: Kernel Sanitizer
21 lines
927 B
Makefile
21 lines
927 B
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
ifdef CONFIG_UBSAN
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=shift)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=integer-divide-by-zero)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=unreachable)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=vla-bound)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=signed-integer-overflow)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=bounds)
|
|
# CFLAGS_UBSAN += $(call cc-option, -fsanitize=object-size)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=bool)
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=enum)
|
|
|
|
ifdef CONFIG_UBSAN_ALIGNMENT
|
|
CFLAGS_UBSAN += $(call cc-option, -fsanitize=alignment)
|
|
endif
|
|
|
|
# -fsanitize=* options makes GCC less smart than usual and
|
|
# increase number of 'maybe-uninitialized false-positives
|
|
CFLAGS_UBSAN += $(call cc-option, -Wno-maybe-uninitialized)
|
|
endif
|