From c8f57d92ff6647eded87d3c8bf00a372ae69e470 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 18 Apr 2017 20:15:14 +0900 Subject: [PATCH] make libprotobuf-cpp-* libs VNDK libprotobuf-cpp-* libs are VNDK, However, since the '.vendor' prefix is added before libprotobuf-cpp-* libs are added to my-*-libraries by LOCAL_PROTOC_OPTIMIZE_TYPE, the clients are still linked against to the platform version of the protobuf libs. As a result, link type error occurs. In order to avoid this, '.vendor' prefix is appended after my-*-*libraries are all updated. Test: normal build successfull Test: add vendor_provided:true to libprotobuf-cpp-* and build successful with BOARD_VNDK_VERSION=true Change-Id: I1ed7978f03e0db56b4cbee86e286c0787f7a3afc --- core/binary.mk | 61 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/core/binary.mk b/core/binary.mk index e28db7ee67..8d5a6efd8a 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -514,37 +514,6 @@ endif ########################################################### my_asflags += -D__ASSEMBLY__ -########################################################### -## When compiling against the VNDK, use LL-NDK libraries -########################################################### -ifneq ($(LOCAL_USE_VNDK),) - #################################################### - ## Soong modules may be built twice, once for /system - ## and once for /vendor. If we're using the VNDK, - ## switch all soong libraries over to the /vendor - ## variant. - #################################################### - ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) - # Soong-built libraries should always use the .vendor variant - my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries)) - my_static_libraries := $(addsuffix .vendor,$(my_static_libraries)) - my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries)) - my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries)) - my_header_libraries := $(addsuffix .vendor,$(my_header_libraries)) - else - my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\ - $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l))) - my_static_libraries := $(foreach l,$(my_static_libraries),\ - $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l))) - my_shared_libraries := $(foreach l,$(my_shared_libraries),\ - $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) - my_system_shared_libraries := $(foreach l,$(my_system_shared_libraries),\ - $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) - my_header_libraries := $(foreach l,$(my_header_libraries),\ - $(if $(SPLIT_VENDOR.HEADER_LIBRARIES.$(l)),$(l).vendor,$(l))) - endif -endif - ########################################################### ## Define PRIVATE_ variables from global vars ########################################################### @@ -1343,6 +1312,36 @@ $(call track-src-file-obj,$(asm_sources_asm),$(asm_objects_asm)) asm_objects += $(asm_objects_asm) endif +########################################################### +## When compiling against the VNDK, use LL-NDK libraries +########################################################### +ifneq ($(LOCAL_USE_VNDK),) + #################################################### + ## Soong modules may be built twice, once for /system + ## and once for /vendor. If we're using the VNDK, + ## switch all soong libraries over to the /vendor + ## variant. + #################################################### + ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) + # Soong-built libraries should always use the .vendor variant + my_whole_static_libraries := $(addsuffix .vendor,$(my_whole_static_libraries)) + my_static_libraries := $(addsuffix .vendor,$(my_static_libraries)) + my_shared_libraries := $(addsuffix .vendor,$(my_shared_libraries)) + my_system_shared_libraries := $(addsuffix .vendor,$(my_system_shared_libraries)) + my_header_libraries := $(addsuffix .vendor,$(my_header_libraries)) + else + my_whole_static_libraries := $(foreach l,$(my_whole_static_libraries),\ + $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l))) + my_static_libraries := $(foreach l,$(my_static_libraries),\ + $(if $(SPLIT_VENDOR.STATIC_LIBRARIES.$(l)),$(l).vendor,$(l))) + my_shared_libraries := $(foreach l,$(my_shared_libraries),\ + $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) + my_system_shared_libraries := $(foreach l,$(my_system_shared_libraries),\ + $(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l))) + my_header_libraries := $(foreach l,$(my_header_libraries),\ + $(if $(SPLIT_VENDOR.HEADER_LIBRARIES.$(l)),$(l).vendor,$(l))) + endif +endif ########################################################## ## Set up installed module dependency