Add support for ASAN in host modules.
Change-Id: Id9ed83499e0eb995f06e845c3153a50677d768b8
This commit is contained in:
parent
28c2d3b985
commit
2daceaa83c
|
@ -181,8 +181,19 @@ ifeq ($(strip $(LOCAL_ADDRESS_SANITIZER)),true)
|
||||||
my_clang := true
|
my_clang := true
|
||||||
my_cflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS)
|
my_cflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS)
|
||||||
my_ldflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS)
|
my_ldflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS)
|
||||||
my_shared_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES)
|
ifdef LOCAL_IS_HOST_MODULE
|
||||||
my_static_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES)
|
my_ldlibs += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDLIBS_HOST)
|
||||||
|
my_shared_libraries += \
|
||||||
|
$(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES_HOST)
|
||||||
|
my_static_libraries += \
|
||||||
|
$(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES_HOST)
|
||||||
|
else
|
||||||
|
my_ldlibs += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDLIBS_TARGET)
|
||||||
|
my_shared_libraries += \
|
||||||
|
$(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES_TARGET)
|
||||||
|
my_static_libraries += \
|
||||||
|
$(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES_TARGET)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)WITHOUT_$(my_prefix)CLANG)),true)
|
ifeq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)WITHOUT_$(my_prefix)CLANG)),true)
|
||||||
|
|
|
@ -92,8 +92,14 @@ endif
|
||||||
# Address sanitizer clang config
|
# Address sanitizer clang config
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fsanitize=address
|
ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fsanitize=address
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS := -Wl,-u,__asan_preinit
|
ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS := -Wl,-u,__asan_preinit
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES := libdl libasan_preload
|
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES := libasan
|
ADDRESS_SANITIZER_CONFIG_EXTRA_LDLIBS_HOST := -lpthread -ldl
|
||||||
|
ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES_HOST :=
|
||||||
|
ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES_HOST := libasan
|
||||||
|
|
||||||
|
ADDRESS_SANITIZER_CONFIG_EXTRA_LDLIBS_TARGET :=
|
||||||
|
ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES_TARGET := libdl libasan_preload
|
||||||
|
ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES_TARGET := libasan
|
||||||
|
|
||||||
# This allows us to use the superset of functionality that compiler-rt
|
# This allows us to use the superset of functionality that compiler-rt
|
||||||
# provides to Clang (for supporting features like -ftrapv).
|
# provides to Clang (for supporting features like -ftrapv).
|
||||||
|
|
Loading…
Reference in New Issue