From 9cd4aff30497ddc2d358e3dbcf9cb09570b2c337 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Wed, 31 Mar 2021 03:25:26 +0000 Subject: [PATCH] Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt" This reverts commit 85a121323285c9c3b5852c64e9c4ff1550142967. Reason for revert: b/184095989 Change-Id: I4643a7bb2fea6411d7c673ec4017fdbab6070b9d --- core/binary.mk | 5 ++++- core/cxx_stl_setup.mk | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index 0d7206f1a..2c20eed60 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -266,7 +266,10 @@ ifneq ($(LOCAL_SDK_VERSION),) endif endif - my_ndk_stl_static_lib += $(my_libcxx_libdir)/libunwind.a + ifneq (,$(filter armeabi armeabi-v7a,$(my_cpu_variant))) + my_ndk_stl_static_lib += $(my_libcxx_libdir)/libunwind.a + endif + my_ldlibs += -ldl else # LOCAL_NDK_STL_VARIANT must be none # Do nothing. diff --git a/core/cxx_stl_setup.mk b/core/cxx_stl_setup.mk index 0d557c7d3..f71ef72f5 100644 --- a/core/cxx_stl_setup.mk +++ b/core/cxx_stl_setup.mk @@ -82,7 +82,15 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),) endif endif else ifeq ($(my_cxx_stl),ndk) - # Using an NDK STL. Handled in binary.mk. + # Using an NDK STL. Handled in binary.mk, except for the unwinder. + # TODO: Switch the NDK over to the LLVM unwinder for non-arm32 architectures. + ifeq (arm,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) + my_static_libraries += libunwind_llvm + my_ldflags += -Wl,--exclude-libs,libunwind_llvm.a + else + my_static_libraries += libgcc_stripped + my_ldflags += -Wl,--exclude-libs,libgcc_stripped.a + endif else ifeq ($(my_cxx_stl),libstdc++) $(error $(LOCAL_PATH): $(LOCAL_MODULE): libstdc++ is not supported) else ifeq ($(my_cxx_stl),none)