am 55f3c4c2
: Merge "Fix AddressSanitizer link order and multilib setup."
* commit '55f3c4c25e4ec9cf80331aa512df8daf8d601fdf': Fix AddressSanitizer link order and multilib setup.
This commit is contained in:
@@ -66,3 +66,7 @@ $(clang_2nd_arch_prefix)RS_TRIPLE_CFLAGS :=
|
|||||||
$(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := armv7-none-linux-gnueabi
|
$(clang_2nd_arch_prefix)RS_COMPAT_TRIPLE := armv7-none-linux-gnueabi
|
||||||
|
|
||||||
$(clang_2nd_arch_prefix)TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-arm-android.a
|
$(clang_2nd_arch_prefix)TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-arm-android.a
|
||||||
|
|
||||||
|
# Address sanitizer clang config
|
||||||
|
$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_RUNTIME_LIBRARY := libclang_rt.asan-arm-android
|
||||||
|
$(clang_2nd_arch_prefix)ADDRESS_SANITIZER_RPATH := /system/lib/asan
|
||||||
|
@@ -64,3 +64,7 @@ RS_TRIPLE_CFLAGS :=
|
|||||||
RS_COMPAT_TRIPLE := aarch64-linux-android
|
RS_COMPAT_TRIPLE := aarch64-linux-android
|
||||||
|
|
||||||
TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-aarch64-android.a
|
TARGET_LIBPROFILE_RT := $(LLVM_RTLIB_PATH)/libclang_rt.profile-aarch64-android.a
|
||||||
|
|
||||||
|
# Address sanitizer clang config
|
||||||
|
ADDRESS_SANITIZER_RUNTIME_LIBRARY := libclang_rt.asan-arm64-android
|
||||||
|
ADDRESS_SANITIZER_RPATH := /system/lib64/asan
|
||||||
|
@@ -144,12 +144,10 @@ clang_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
|
|||||||
include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk
|
include $(BUILD_SYSTEM)/clang/TARGET_$(TARGET_2ND_ARCH).mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Address sanitizer clang config
|
|
||||||
ADDRESS_SANITIZER_RUNTIME_LIBRARY := libclang_rt.asan_$(TARGET_ARCH)_android
|
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fno-omit-frame-pointer
|
ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -fno-omit-frame-pointer
|
||||||
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 $(ADDRESS_SANITIZER_RUNTIME_LIBRARY)
|
ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES := libdl
|
||||||
ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES := libasan
|
ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES := 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
|
||||||
|
@@ -80,8 +80,12 @@ ifneq ($(filter address,$(my_sanitize)),)
|
|||||||
# libraries needed with -fsanitize=address. http://b/18650275 (WAI)
|
# libraries needed with -fsanitize=address. http://b/18650275 (WAI)
|
||||||
my_ldlibs += -ldl -lpthread
|
my_ldlibs += -ldl -lpthread
|
||||||
else
|
else
|
||||||
my_shared_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES)
|
# ASan runtime library must be the first in the link order.
|
||||||
|
my_shared_libraries := $($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_RUNTIME_LIBRARY) \
|
||||||
|
$(my_shared_libraries) \
|
||||||
|
$(ADDRESS_SANITIZER_CONFIG_EXTRA_SHARED_LIBRARIES)
|
||||||
my_static_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES)
|
my_static_libraries += $(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES)
|
||||||
|
my_ldflags += -Wl,-rpath,$($(LOCAL_2ND_ARCH_VAR_PREFIX)ADDRESS_SANITIZER_RPATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user