diff --git a/core/binary.mk b/core/binary.mk index 0b03f6a87..be008e68a 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -181,6 +181,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)