sdm660-common: vndk: Enable runtime isolation

Change-Id: I027556b1a760242da957b9c3a9c270bd9f20def7
Co-authored-by: Angga Satya Putra <anggasp@hotmail.com>
This commit is contained in:
Arian 2019-12-01 14:32:53 +01:00 committed by Max Weffers
parent be221519b8
commit ca9897e1f6
No known key found for this signature in database
GPG key ID: 795F73D22FB93FAE
4 changed files with 56 additions and 60 deletions

View file

@ -241,7 +241,6 @@ BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/private
TARGET_USES_ALTERNATIVE_MANUAL_NETWORK_SELECT := true TARGET_USES_ALTERNATIVE_MANUAL_NETWORK_SELECT := true
# Treble # Treble
BOARD_VNDK_RUNTIME_DISABLE := true
BOARD_VNDK_VERSION := current BOARD_VNDK_VERSION := current
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
PRODUCT_FULL_TREBLE_OVERRIDE := true PRODUCT_FULL_TREBLE_OVERRIDE := true

View file

@ -480,7 +480,7 @@ PRODUCT_PACKAGES += \
# VNDK # VNDK
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
libdng_sdk.vendor_32 \ libdng_sdk.vendor_32 \
libstdc++.vendor \ libstdc++.vendor_32 \
vndk-ext \ vndk-ext \
vndk_package vndk_package

View file

@ -1,74 +1,45 @@
#
# Copyright (C) 2019 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir) LOCAL_PATH := $(call my-dir)
# b/69526027: This VNDK-SP install routine must be removed. Instead, we must include $(LOCAL_PATH)/vndk-ext-libs.mk
# build vendor variants of the VNDK-SP modules.
ifndef BOARD_VNDK_VERSION define define-vndk-lib
# The libs with "vndk: {enabled: true, support_system_process: true}" will be
# added VNDK_SP_LIBRARIES automatically. And the core variants of the VNDK-SP
# libs will be copied to vndk-sp directory.
# However, some of those libs need FWK-ONLY libs, which must be listed here
# manually.
VNDK_SP_LIBRARIES := \
libdexfile \
libdexfile_external \
libdexfile_support \
libartbase \
libartpalette \
libziparchive
install_in_hw_dir := \
android.hidl.memory@1.0-impl
vndk_sp_dir := vndk-sp-$(PLATFORM_VNDK_VERSION)
define define-vndk-sp-lib
include $$(CLEAR_VARS) include $$(CLEAR_VARS)
LOCAL_MODULE := $1.vndk-sp-gen LOCAL_MODULE := $1.vndk-ext-gen
LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,,)/$1.so LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$3,)/$1.so
LOCAL_STRIP_MODULE := false LOCAL_STRIP_MODULE := false
LOCAL_MULTILIB := first LOCAL_MULTILIB := $2
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_INSTALLED_MODULE_STEM := $1.so LOCAL_INSTALLED_MODULE_STEM := $$(basename $1).so
LOCAL_MODULE_SUFFIX := .so LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_RELATIVE_PATH := $(vndk_sp_dir)$(if $(filter $1,$(install_in_hw_dir)),/hw) LOCAL_VENDOR_MODULE := true
LOCAL_CHECK_ELF_FILES := false
include $$(BUILD_PREBUILT) include $$(BUILD_PREBUILT)
ifneq ($$(TARGET_2ND_ARCH),)
ifneq ($$(TARGET_TRANSLATE_2ND_ARCH),true)
include $$(CLEAR_VARS)
LOCAL_MODULE := $1.vndk-sp-gen
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_PREBUILT_MODULE_FILE := $$(call intermediates-dir-for,SHARED_LIBRARIES,$1,,,$$(TARGET_2ND_ARCH_VAR_PREFIX),)/$1.so
LOCAL_STRIP_MODULE := false
LOCAL_MULTILIB := 32
LOCAL_MODULE_TAGS := optional
LOCAL_INSTALLED_MODULE_STEM := $1.so
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_RELATIVE_PATH := $(vndk_sp_dir)$(if $(filter $1,$(install_in_hw_dir)),/hw)
LOCAL_CHECK_ELF_FILES := false
include $$(BUILD_PREBUILT)
endif # TARGET_TRANSLATE_2ND_ARCH is not true
endif # TARGET_2ND_ARCH is not empty
endef endef
# Add VNDK-SP libs to the list if they are missing $(foreach lib,$(EXTRA_VENDOR_LIBRARIES_32),\
$(foreach lib,$(VNDK_SAMEPROCESS_LIBRARIES),\ $(eval $(call define-vndk-lib,$(lib),32,$(TARGET_2ND_ARCH_VAR_PREFIX))))
$(if $(filter $(lib),$(VNDK_SP_LIBRARIES)),,\
$(eval VNDK_SP_LIBRARIES += $(lib))))
$(foreach lib,$(VNDK_SP_LIBRARIES),\ $(foreach lib,$(EXTRA_VENDOR_LIBRARIES_64),\
$(eval $(call define-vndk-sp-lib,$(lib)))) $(eval $(call define-vndk-lib,$(lib),first,)))
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := vndk-sp LOCAL_MODULE := vndk-ext
LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional
LOCAL_REQUIRED_MODULES := $(addsuffix .vndk-sp-gen,$(VNDK_SP_LIBRARIES)) LOCAL_REQUIRED_MODULES := $(addsuffix .vndk-ext-gen,$(EXTRA_VENDOR_LIBRARIES_32) $(EXTRA_VENDOR_LIBRARIES_64))
include $(BUILD_PHONY_PACKAGE) include $(BUILD_PHONY_PACKAGE)
install_in_hw_dir :=
vndk_sp_dir :=
endif

26
vndk/vndk-ext-libs.mk Normal file
View file

@ -0,0 +1,26 @@
#
# Copyright (C) 2019 The LineageOS Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
EXTRA_VENDOR_LIBRARIES_32 := \
libandroidicu \
libft2 \
libharfbuzz_ng \
libicuuc \
libstdc++
EXTRA_VENDOR_LIBRARIES_64 := \
libicuuc \
libstdc++