From 2936a1e84b665d45a01b6b93c2bb91c457a9c67e Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 14 Sep 2016 16:08:04 -0700 Subject: [PATCH 1/2] Always link libdl with libc++ for the NDK. libc++ requires libdl whether it's statically linked or not. Test: make checkbuild tests Bug: None Change-Id: I8abdcfaef779b358196716ab1193cebe278317ac --- core/binary.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index b9cff6555..828dcdb78 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -216,7 +216,6 @@ ifdef LOCAL_SDK_VERSION ifneq (,$(filter r10 r11,$(LOCAL_NDK_VERSION))) ifeq (c++_static,$(LOCAL_NDK_STL_VARIANT)) my_ndk_stl_static_lib := $(my_libcxx_libdir)/libc++_static.a - my_ldlibs += -ldl else my_ndk_stl_shared_lib_fullpath := $(my_libcxx_libdir)/libc++_shared.so endif @@ -225,7 +224,6 @@ ifdef LOCAL_SDK_VERSION my_ndk_stl_static_lib := \ $(my_libcxx_libdir)/libc++_static.a \ $(my_libcxx_libdir)/libc++abi.a - my_ldlibs += -ldl else my_ndk_stl_shared_lib_fullpath := $(my_libcxx_libdir)/libc++_shared.so endif @@ -236,6 +234,8 @@ ifdef LOCAL_SDK_VERSION endif endif + my_ldlibs += -ldl + my_ndk_stl_cppflags := -std=c++11 else # LOCAL_NDK_STL_VARIANT is not c++_* either ifneq (,$(filter gnustl_%, $(LOCAL_NDK_STL_VARIANT))) From c28e4bcb1cbe76ac1bb90c8f38eb5240ca0c1386 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 14 Sep 2016 16:08:48 -0700 Subject: [PATCH 2/2] Use libcompiler-rt_extras with NDK builds. We want to build things in CTS (things built against the NDK) with integer overflow checks. Some projects in the tree also make explicit calls to the overflow checked builtins, and those projects need to be built with the NDK (external/dng_sdk is the specific example that brought this up). Test: make checkbuild tests Bug: None Change-Id: Iab27dd0d931f723140de242049fa72f3b1ce0fb8 --- core/binary.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/binary.mk b/core/binary.mk index 828dcdb78..058c7e480 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -418,7 +418,7 @@ include $(BUILD_SYSTEM)/config_sanitizers.mk ifneq ($(LOCAL_NO_LIBCOMPILER_RT),true) # Add in libcompiler_rt for all regular device builds -ifeq (,$(LOCAL_SDK_VERSION)$(WITHOUT_LIBCOMPILER_RT)) +ifeq (,$(WITHOUT_LIBCOMPILER_RT)) my_static_libraries += $(COMPILER_RT_CONFIG_EXTRA_STATIC_LIBRARIES) endif endif