From f9f035de197e10929dc20e74655c588302a90a9f Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 16 Jul 2020 17:12:07 -0700 Subject: [PATCH] Use the soong-built NDK CRT objects. Test: treehugger Bug: http://b/159925977 Change-Id: I9f0109ccd6c5ccd8c4ff0eaf6b34e5004db86161 --- core/binary.mk | 2 ++ core/executable_internal.mk | 6 +++--- core/shared_library_internal.mk | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index a70a047a6..df13d39ee 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -130,6 +130,8 @@ ifneq ($(LOCAL_SDK_VERSION),) my_ndk_api := $(call math_max,$(my_ndk_api),$(my_min_sdk_version)) endif + my_ndk_crt_version := $(my_ndk_api) + my_ndk_hist_api := $(my_ndk_api) ifeq ($(my_ndk_api),current) # The last API level supported by the old prebuilt NDKs. diff --git a/core/executable_internal.mk b/core/executable_internal.mk index 32e56dd27..c6a8fafc2 100644 --- a/core/executable_internal.mk +++ b/core/executable_internal.mk @@ -56,9 +56,9 @@ my_target_crtbegin_static_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT my_target_crtend_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtend_android) endif ifneq ($(LOCAL_SDK_VERSION),) -my_target_crtbegin_dynamic_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_dynamic.o) -my_target_crtbegin_static_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_static.o) -my_target_crtend_o := $(wildcard $(my_ndk_sysroot_lib)/crtend_android.o) +my_target_crtbegin_dynamic_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtbegin_dynamic.sdk.$(my_ndk_crt_version)) +my_target_crtbegin_static_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtbegin_static.sdk.$(my_ndk_crt_version)) +my_target_crtend_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtend_android.sdk.$(my_ndk_crt_version)) endif $(linked_module): PRIVATE_TARGET_LIBCRT_BUILTINS := $(my_target_libcrt_builtins) $(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic) diff --git a/core/shared_library_internal.mk b/core/shared_library_internal.mk index 219772a1e..12b7f44f4 100644 --- a/core/shared_library_internal.mk +++ b/core/shared_library_internal.mk @@ -51,8 +51,8 @@ my_target_crtbegin_so_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crt my_target_crtend_so_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtend_so) endif ifneq ($(LOCAL_SDK_VERSION),) -my_target_crtbegin_so_o := $(wildcard $(my_ndk_sysroot_lib)/crtbegin_so.o) -my_target_crtend_so_o := $(wildcard $(my_ndk_sysroot_lib)/crtend_so.o) +my_target_crtbegin_so_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtbegin_so.sdk.$(my_ndk_crt_version)) +my_target_crtend_so_o := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJECT_crtend_so.sdk.$(my_ndk_crt_version)) endif $(linked_module): PRIVATE_TARGET_LIBCRT_BUILTINS := $(my_target_libcrt_builtins) $(linked_module): PRIVATE_TARGET_LIBATOMIC := $(my_target_libatomic)