162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci# Enable available and selected UBSAN features. 462306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_ALIGNMENT) += -fsanitize=alignment 562306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_BOUNDS_STRICT) += -fsanitize=bounds-strict 662306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_ARRAY_BOUNDS) += -fsanitize=array-bounds 762306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_LOCAL_BOUNDS) += -fsanitize=local-bounds 862306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_SHIFT) += -fsanitize=shift 962306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_DIV_ZERO) += -fsanitize=integer-divide-by-zero 1062306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_UNREACHABLE) += -fsanitize=unreachable 1162306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_BOOL) += -fsanitize=bool 1262306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_ENUM) += -fsanitize=enum 1362306a36Sopenharmony_ciubsan-cflags-$(CONFIG_UBSAN_TRAP) += -fsanitize-undefined-trap-on-error 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ciexport CFLAGS_UBSAN := $(ubsan-cflags-y) 16