From 4ac4231ca1eb2513bfd6bacd974a0aa190a76d2d Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 20 Jul 2016 11:02:18 -0700 Subject: [PATCH] Add LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES. This allows a module to avoid being installed to the common library directory. Test: Prevents copying of NDK libraries with the NDK sysroot patches. Bug: http://b/27533932 Change-Id: I24f11d5a70595bcd524ac5bd85034c226d2de211 --- core/clear_vars.mk | 1 + core/prebuilt_internal.mk | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 31b337a13..562a27260 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -199,6 +199,7 @@ LOCAL_NOTICE_FILE:= # to avoid installing the presigned apks with classes.dex unstripped. LOCAL_REPLACE_PREBUILT_APK_INSTALLED:= LOCAL_NDK_VERSION:=current +LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES:= LOCAL_LOGTAGS_FILES:= # arch specific variables diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 90e9547b3..701414a77 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -46,9 +46,18 @@ my_pack_module_relocations := $(firstword \ $(LOCAL_PACK_MODULE_RELOCATIONS)) ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)) - # Put the built targets of all shared libraries in a common directory - # to simplify the link line. - OVERRIDE_BUILT_MODULE_PATH := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES) + # LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES indicates that this prebuilt should be + # installed to the common directory of libraries. This is needed for the NDK + # shared libraries built by soong, as we build many different versions of each + # library (one for each API level). Since they all have the same basename, + # they'd clobber each other (as well as any platform libraries by the same + # name). + ifneq ($(LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES),false) + # Put the built targets of all shared libraries in a common directory + # to simplify the link line. + OVERRIDE_BUILT_MODULE_PATH := \ + $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATE_LIBRARIES) + endif ifeq ($(LOCAL_IS_HOST_MODULE)$(my_strip_module),) # Strip but not try to add debuglink my_strip_module := no_debuglink