diff options
author | Evgeniy Stepanov <eugenis@google.com> | 2014-02-21 18:10:53 +0400 |
---|---|---|
committer | Evgeniy Stepanov <eugenis@google.com> | 2014-04-16 10:52:10 +0000 |
commit | 5d8029f234669cf1688739437810db11dcdb403d (patch) | |
tree | 6c0e3e09ec99871621f42296baab52ee75d52aad | |
parent | 105ed03cf01f2ece0aca279d4d53151b4fd4784e (diff) | |
download | build-5d8029f234669cf1688739437810db11dcdb403d.zip build-5d8029f234669cf1688739437810db11dcdb403d.tar.gz build-5d8029f234669cf1688739437810db11dcdb403d.tar.bz2 |
Update ASan configuration.
Change runtime library name to keep in sync with upstream.
Enable frame pointers in instrumented code for fast stack unwind.
Change-Id: I815912bb856c56c399639ea76ad4cb6b97961840
-rw-r--r-- | core/binary.mk | 2 | ||||
-rw-r--r-- | core/clang/config.mk | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/core/binary.mk b/core/binary.mk index 7e0ad2d..9fc91fb 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -133,6 +133,8 @@ endif ifeq ($(strip $(LOCAL_ADDRESS_SANITIZER)),true) LOCAL_CLANG := true + # Frame pointer based unwinder in ASan requires ARM frame setup. + LOCAL_ARM_MODE := arm my_cflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS) my_ldflags += $(ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS) my_shared_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES) diff --git a/core/clang/config.mk b/core/clang/config.mk index c471f7e..94dcdb0 100644 --- a/core/clang/config.mk +++ b/core/clang/config.mk @@ -67,9 +67,10 @@ CLANG_CONFIG_EXTRA_HOST_C_INCLUDES := $(LLVM_PREBUILTS_HEADER_PATH) CLANG_CONFIG_EXTRA_TARGET_C_INCLUDES := $(LLVM_PREBUILTS_HEADER_PATH) $(TARGET_OUT_HEADERS)/clang # Address sanitizer clang config -ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fsanitize=address +ADDRESS_SANITIZER_RUNTIME_LIBRARY := libclang_rt.asan_$(TARGET_ARCH)_android +ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fsanitize=address -fno-omit-frame-pointer ADDRESS_SANITIZER_CONFIG_EXTRA_LDFLAGS := -Wl,-u,__asan_preinit -ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES := libdl libasan_preload +ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES := libdl $(ADDRESS_SANITIZER_RUNTIME_LIBRARY) ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES := libasan # This allows us to use the superset of functionality that compiler-rt |