From c72f39664d6e6a9d15b912cd72e7bcef121fcc11 Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 11 Jun 2012 14:53:34 -0700 Subject: [PATCH] EXPERIMENTAL: Add libcompiler-rt-extras.a to device builds. Change-Id: I463217aef573a28069469514ad94cd85a7f38bea --- core/binary.mk | 5 +++++ core/llvm_config.mk | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index 04ac90b72..87a5b5f42 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -132,6 +132,11 @@ ifeq ($(strip $(LOCAL_ADDRESS_SANITIZER)),true) LOCAL_STATIC_LIBRARIES += $(ADDRESS_SANITIZER_CONFIG_EXTRA_STATIC_LIBRARIES) endif +# Add in libcompiler-rt for all device builds +ifndef LOCAL_IS_HOST_MODULE + LOCAL_STATIC_LIBRARIES += $(COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES) +endif + my_compiler_dependencies := ifeq ($(strip $(LOCAL_CLANG)),true) LOCAL_CFLAGS += $(CLANG_CONFIG_EXTRA_CFLAGS) diff --git a/core/llvm_config.mk b/core/llvm_config.mk index 41450280f..33cf6d1ae 100644 --- a/core/llvm_config.mk +++ b/core/llvm_config.mk @@ -71,3 +71,9 @@ ADDRESS_SANITIZER_CONFIG_EXTRA_CFLAGS := -faddress-sanitizer 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 + +# This allows us to use the superset of functionality that compiler-rt +# provides to Clang (for supporting features like -ftrapv). +ifneq ($(TARGET_ARCH),mips) +COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES := libcompiler-rt-extras +endif