Revert "Use sdk variant of Soong modules when LOCAL_SDK_VERSION ..."

Revert "Add sdk mutator for native modules"

Revert submission 1242911-sdk_version_variant

Reason for revert: b/153394225
Reverted Changes:
Ife99745fb:Use libnativewindow for platform variant of libagq...
I1bae84c43:Use libnativewindow for platform variant of androi...
I6e6021ed3:Use stl to depend on libc++
Ife99745fb:Use libnativewindow for platform variant of libRSS...
I2c9f439b9:Fix static dependency on libprotobuf-cpp-lite-ndk
Iff2aff9cf:Set sdk_version for cc_genrules used by modules wi...
I7d72934aa:Add sdk mutator for native modules
Ief378a007:Use sdk variant of Soong modules when LOCAL_SDK_VE...

Bug: 149591340
Change-Id: I6cd4de221ece29e48d58a8b1297dc2512b2dad13
Fixes: 153394225
This commit is contained in:
Colin Cross 2020-04-07 04:21:21 +00:00
parent b934116994
commit 79e5a55122
4 changed files with 3 additions and 45 deletions

View file

@ -1136,18 +1136,6 @@ ifeq ($(LOCAL_USE_VNDK),)
$(if $(filter $(l),$(VENDOR_PUBLIC_LIBRARIES)),$(l).vendorpublic,$(l)))
endif
###########################################################
## When compiling against the NDK, use SDK variants of Soong libraries
###########################################################
ifneq ($(LOCAL_SDK_VERSION),)
my_whole_static_libraries := $(call use_soong_sdk_libraries,$(my_whole_static_libraries))
my_static_libraries := $(call use_soong_sdk_libraries,$(my_static_libraries))
my_shared_libraries := $(call use_soong_sdk_libraries,$(my_shared_libraries))
my_system_shared_libraries := $(call use_soong_sdk_libraries,$(my_system_shared_libraries))
my_header_libraries := $(call use_soong_sdk_libraries,$(my_header_libraries))
endif
##########################################################
## Set up installed module dependency
## We cannot compute the full path of the LOCAL_SHARED_LIBRARIES for

View file

@ -3321,9 +3321,3 @@ $(hide) CLANG_BIN="$(LLVM_PREBUILTS_PATH)" \
XZ="$(XZ)" \
$(LIBRARY_IDENTITY_CHECK_SCRIPT) $(SOONG_STRIP_PATH) $(1) $(2)
endef
# Convert Soong libraries that have SDK variant
define use_soong_sdk_libraries
$(foreach l,$(1),$(if $(filter $(l),$(SOONG_SDK_VARIANT_MODULES)),\
$(l).sdk,$(l)))
endef

View file

@ -12,18 +12,9 @@
# my_embedded_prebuilt_jni_libs, prebuilt jni libs embedded in prebuilt apk.
#
my_sdk_variant = $(1)
ifneq (,$(and $(my_embed_jni),$(LOCAL_SDK_VERSION)))
# Soong produces $(lib).so in $(lib).sdk_intermediates so that the library
# has the correct name for embedding in an APK. Append .sdk to the name
# of the intermediates directory, but not the .so name.
my_sdk_variant = $(call use_soong_sdk_libraries,$(1))
endif
my_jni_shared_libraries := $(strip \
$(foreach lib,$(LOCAL_JNI_SHARED_LIBRARIES), \
$(call intermediates-dir-for,SHARED_LIBRARIES,$(call my_sdk_variant,$(lib)),,,$(my_2nd_arch_prefix))/$(lib).so))
$(foreach lib,$(LOCAL_JNI_SHARED_LIBRARIES), \
$(call intermediates-dir-for,SHARED_LIBRARIES,$(lib),,,$(my_2nd_arch_prefix))/$(lib).so))
# App-specific lib path.
my_app_lib_path := $(dir $(LOCAL_INSTALLED_MODULE))lib/$(TARGET_$(my_2nd_arch_prefix)ARCH)
@ -124,18 +115,7 @@ 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
else
my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES))
endif
my_link_deps := $(addprefix SHARED_LIBRARIES:,$(LOCAL_JNI_SHARED_LIBRARIES))
my_common :=
include $(BUILD_SYSTEM)/link_type.mk

View file

@ -82,10 +82,6 @@ else
else ifeq ($(LOCAL_MODULE_CLASS),ETC)
# ETC modules may be uninstallable, yet still have a NOTICE file. e.g. apex components
module_installed_filename :=
else ifneq (,$(and $(filter %.sdk,$(LOCAL_MODULE)),$(filter $(patsubst %.sdk,%,$(LOCAL_MODULE)),$(SOONG_SDK_VARIANT_MODULES))))
# Soong produces uninstallable *.sdk shared libraries for embedding in APKs.
module_installed_filename := \
$(patsubst $(PRODUCT_OUT)/%,%,$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
else
$(error Cannot determine where to install NOTICE file for $(LOCAL_MODULE))
endif # JAVA_LIBRARIES