Make use of sanitizers without clang an error.
Previously using a sanitizer would imply clang. It should be an error instead so it's more obvious. Change-Id: I67c949bfda3718a0d19da7e358b5fde447fce334
This commit is contained in:
@@ -12,8 +12,10 @@ ifeq ($(my_sanitize_host),true)
|
|||||||
my_sanitize_host := address
|
my_sanitize_host := address
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# `LOCAL_CLANG := false` disables SANITIZE_HOST.
|
# SANITIZE_HOST is only in effect if the module is already using clang (host
|
||||||
ifeq ($(my_clang),false)
|
# modules that haven't set `LOCAL_CLANG := false` and device modules that have
|
||||||
|
# set `LOCAL_CLANG := true`.
|
||||||
|
ifneq ($(my_clang),true)
|
||||||
my_sanitize_host :=
|
my_sanitize_host :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -43,6 +45,13 @@ ifeq ($(my_sanitize),never)
|
|||||||
my_sanitize :=
|
my_sanitize :=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Sanitizers can only be used with clang.
|
||||||
|
ifneq ($(my_clang),true)
|
||||||
|
ifneq ($(my_sanitize),)
|
||||||
|
$(error $(LOCAL_PATH): $(LOCAL_MODULE): Use of sanitizers requires LOCAL_CLANG := true)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
unknown_sanitizers := $(filter-out address, \
|
unknown_sanitizers := $(filter-out address, \
|
||||||
$(filter-out undefined,$(my_sanitize)))
|
$(filter-out undefined,$(my_sanitize)))
|
||||||
|
|
||||||
@@ -51,8 +60,6 @@ ifneq ($(unknown_sanitizers),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(my_sanitize),)
|
ifneq ($(my_sanitize),)
|
||||||
my_clang := true
|
|
||||||
|
|
||||||
fsanitize_arg := $(subst $(space),$(comma),$(my_sanitize)),
|
fsanitize_arg := $(subst $(space),$(comma),$(my_sanitize)),
|
||||||
my_cflags += -fsanitize=$(fsanitize_arg)
|
my_cflags += -fsanitize=$(fsanitize_arg)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user