From 41c3ad1f8bfb3e1f5fece6692d0e4bb2a2e8c4f4 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 14 May 2020 12:49:15 -0700 Subject: [PATCH] Don't check link type of Soong app JNI libraries Link type checking is already done within Soong, and SOONG_SDK_VARIANT_MODULES is not complete yet while parsing Soong modules, skip JNI link type checking for Soong apps. Bug: 156225490 Test: m checkbuild Change-Id: I2f6824b180ccdd62c26497bdca527540ca22f0d7 Merged-In: I2f6824b180ccdd62c26497bdca527540ca22f0d7 (cherry picked from commit 1c8d81e5d93274cd36bdb6708817084dabe47bc8) --- core/install_jni_libs_internal.mk | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/core/install_jni_libs_internal.mk b/core/install_jni_libs_internal.mk index b482eb59ba..48c93de45f 100644 --- a/core/install_jni_libs_internal.mk +++ b/core/install_jni_libs_internal.mk @@ -124,17 +124,15 @@ ifneq ($(strip $(LOCAL_JNI_SHARED_LIBRARIES)),) my_allowed_types := $(my_allowed_ndk_types) native:platform native:product native:vendor native:vndk native:vndk_private native:platform_vndk endif - ifneq (,$(LOCAL_SDK_VERSION)) - ifeq ($(SOONG_ANDROID_MK),$(LOCAL_MODULE_MAKEFILE)) - # SOONG_SDK_VARIANT_MODULES isn't complete yet while parsing Soong modules, and Soong has - # already ensured that apps link against the correct SDK variants, rewrite all JNI libraries - # to the SDK variant. - my_link_deps := $(addprefix SHARED_LIBRARIES:,$(addsuffix .sdk,$(LOCAL_JNI_SHARED_LIBRARIES))) - else - my_link_deps := $(addprefix SHARED_LIBRARIES:,$(call use_soong_sdk_libraries,$(LOCAL_JNI_SHARED_LIBRARIES))) - endif + ifeq ($(SOONG_ANDROID_MK),$(LOCAL_MODULE_MAKEFILE)) + # SOONG_SDK_VARIANT_MODULES isn't complete yet while parsing Soong modules, and Soong has + # already ensured that apps link against the correct SDK variants, don't check them. else - my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES)) + ifneq (,$(LOCAL_SDK_VERSION)) + my_link_deps := $(addprefix SHARED_LIBRARIES:,$(call use_soong_sdk_libraries,$(LOCAL_JNI_SHARED_LIBRARIES))) + else + my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES)) + endif endif my_common :=