templatize ld.config.txt
am: ecc703c792
Change-Id: Ic9dc2f35a4a9a2c2a56cb24a9ac02e9373ed78df
This commit is contained in:
commit
324f3ed393
2 changed files with 50 additions and 15 deletions
|
@ -193,17 +193,52 @@ bcp_dep :=
|
|||
# ld.config.txt
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
_enforce_vndk_at_runtime := false
|
||||
|
||||
ifdef BOARD_VNDK_VERSION
|
||||
ifneq ($(BOARD_VNDK_RUNTIME_DISABLE),true)
|
||||
_enforce_vndk_at_runtime := true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(_enforce_vndk_at_runtime),true)
|
||||
LOCAL_MODULE := ld.config.txt
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
||||
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
|
||||
include $(BUILD_SYSTEM)/base_rules.mk
|
||||
vndk_lib_md5 := $(word 1, $(shell echo $(LLNDK_LIBRARIES) $(VNDK_SAMEPROCESS_LIBRARIES) | $(MD5SUM)))
|
||||
vndk_lib_dep := $(intermediates)/$(vndk_lib_md5).dep
|
||||
$(vndk_lib_dep):
|
||||
$(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.dep && touch $@
|
||||
|
||||
llndk_libraries := $(subst $(space),:,$(addsuffix .so,$(LLNDK_LIBRARIES)))
|
||||
|
||||
vndk_sameprocess_libraries := $(subst $(space),:,$(addsuffix .so,$(VNDK_SAMEPROCESS_LIBRARIES)))
|
||||
|
||||
vndk_core_libraries := $(subst $(space),:,$(addsuffix .so,$(VNDK_CORE_LIBRARIES)))
|
||||
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_LLNDK_LIBRARIES := $(llndk_libraries)
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_VNDK_SAMEPROCESS_LIBRARIES := $(vndk_sameprocess_libraries)
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_LLNDK_PRIVATE_LIBRARIES := $(llndk_private_libraries)
|
||||
$(LOCAL_BUILT_MODULE): PRIVATE_VNDK_CORE_LIBRARIES := $(vndk_core_libraries)
|
||||
$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/etc/ld.config.txt.in $(vndk_lib_dep)
|
||||
@echo "Generate: $< -> $@"
|
||||
@mkdir -p $(dir $@)
|
||||
$(hide) sed -e 's?%LLNDK_LIBRARIES%?$(PRIVATE_LLNDK_LIBRARIES)?g' $< >$@
|
||||
$(hide) sed -i -e 's?%VNDK_SAMEPROCESS_LIBRARIES%?$(PRIVATE_VNDK_SAMEPROCESS_LIBRARIES)?g' $@
|
||||
$(hide) sed -i -e 's?%VNDK_CORE_LIBRARIES%?$(PRIVATE_VNDK_CORE_LIBRARIES)?g' $@
|
||||
|
||||
vndk_lib_md5 :=
|
||||
vndk_lib_dep :=
|
||||
llndk_libraries :=
|
||||
vndk_sameprocess_libraries :=
|
||||
vndk_core_libraries :=
|
||||
else # if _enforce_vndk_at_runtime is not true
|
||||
|
||||
LOCAL_MODULE := ld.config.txt
|
||||
ifeq ($(PRODUCT_FULL_TREBLE)|$(SANITIZE_TARGET),true|)
|
||||
ifdef BOARD_VNDK_VERSION
|
||||
ifeq ($(BOARD_VNDK_RUNTIME_DISABLE),true)
|
||||
LOCAL_SRC_FILES := etc/ld.config.txt
|
||||
else
|
||||
LOCAL_SRC_FILES := etc/ld.config.vndk.txt
|
||||
endif
|
||||
else
|
||||
LOCAL_SRC_FILES := etc/ld.config.txt
|
||||
endif
|
||||
else
|
||||
LOCAL_SRC_FILES := etc/ld.config.legacy.txt
|
||||
endif
|
||||
|
@ -211,3 +246,4 @@ LOCAL_MODULE_CLASS := ETC
|
|||
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)
|
||||
LOCAL_MODULE_STEM := $(LOCAL_MODULE)
|
||||
include $(BUILD_PREBUILT)
|
||||
endif
|
||||
|
|
|
@ -65,10 +65,10 @@ namespace.sphal.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}
|
|||
namespace.sphal.links = default,vndk,rs
|
||||
|
||||
# WARNING: only NDK libs can be listed here.
|
||||
namespace.sphal.link.default.shared_libs = libEGL.so:libm.so:libandroid_net.so:libvndksupport.so:libc.so:libGLESv1_CM.so:liblog.so:libsync.so:libnativewindow.so:libGLESv3.so:libdl.so:libGLESv2.so
|
||||
namespace.sphal.link.default.shared_libs = %LLNDK_LIBRARIES%
|
||||
|
||||
# WARNING: only VNDK-SP libs can be listed here. DO NOT EDIT this line.
|
||||
namespace.sphal.link.vndk.shared_libs = libhardware.so:libc++.so:libhidlbase.so:libhwbinder.so:libhidltransport.so:libbase.so:libhidlmemory.so:libRS.so:libRSDriver.so:libcutils.so:libion.so:libRSCpuRef.so:android.hardware.graphics.common@1.0.so:android.hardware.graphics.mapper@2.0.so:android.hidl.memory@1.0.so:libbcinfo.so:android.hardware.graphics.allocator@2.0.so:android.hardware.renderscript@1.0.so:libutils.so:libz.so
|
||||
namespace.sphal.link.vndk.shared_libs = %VNDK_SAMEPROCESS_LIBRARIES%
|
||||
|
||||
# Renderscript gets separate namespace
|
||||
namespace.sphal.link.rs.shared_libs = libRS_internal.so
|
||||
|
@ -90,8 +90,8 @@ namespace.rs.asan.search.paths = /data/asan/vendor/${LIB}/vndk-sp:/vendor/${LIB}
|
|||
namespace.rs.asan.permitted.paths = /data/asan/vendor/${LIB}:/vendor/${LIB}:/data
|
||||
|
||||
namespace.rs.links = default,vndk
|
||||
namespace.rs.link.default.shared_libs = libEGL.so:libm.so:libandroid_net.so:libvndksupport.so:libc.so:libGLESv1_CM.so:liblog.so:libsync.so:libnativewindow.so:libGLESv3.so:libdl.so:libGLESv2.so:libmediandk.so:libft2.so
|
||||
namespace.rs.link.vndk.shared_libs = libhardware.so:libc++.so:libhidlbase.so:libhwbinder.so:libhidltransport.so:libbase.so:libhidlmemory.so:libRS.so:libRSDriver.so:libcutils.so:libion.so:libRSCpuRef.so:android.hardware.graphics.common@1.0.so:android.hardware.graphics.mapper@2.0.so:android.hidl.memory@1.0.so:libbcinfo.so:android.hardware.graphics.allocator@2.0.so:android.hardware.renderscript@1.0.so:libutils.so:libz.so
|
||||
namespace.rs.link.default.shared_libs = %LLNDK_LIBRARIES%
|
||||
namespace.rs.link.vndk.shared_libs = %VNDK_SAMEPROCESS_LIBRARIES%
|
||||
|
||||
###############################################################################
|
||||
# "vndk" namespace
|
||||
|
@ -109,7 +109,7 @@ namespace.vndk.asan.permitted.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}
|
|||
# to the default namespace. This is possible since their ABI is stable across
|
||||
# Android releases.
|
||||
namespace.vndk.links = default
|
||||
namespace.vndk.link.default.shared_libs = libEGL.so:libm.so:libandroid_net.so:libvndksupport.so:libc.so:libGLESv1_CM.so:liblog.so:libsync.so:libnativewindow.so:libGLESv3.so:libdl.so:libGLESv2.so
|
||||
namespace.vndk.link.default.shared_libs = %LLNDK_LIBRARIES%
|
||||
|
||||
###############################################################################
|
||||
# Namespace config for vendor processes. In O, no restriction is enforced for
|
||||
|
@ -135,7 +135,7 @@ namespace.default.asan.search.paths = /data/asan/vendor/${LIB}/hw:/vendor/${LIB}
|
|||
namespace.default.asan.permitted.paths = /data/asan/vendor:/vendor:/data/asan/system/${LIB}/vndk:/system/${LIB}/vndk:/data/asan/system/${LIB}/vndk-sp:/system/${LIB}/vndk-sp
|
||||
|
||||
namespace.default.links = system
|
||||
namespace.default.link.system.shared_libs = libEGL.so:libm.so:libandroid_net.so:libvndksupport.so:libc.so:libGLESv1_CM.so:liblog.so:libsync.so:libnativewindow.so:libGLESv3.so:libdl.so:libGLESv2.so:libmedia.so:libandroid_runtime.so
|
||||
namespace.default.link.system.shared_libs = %LLNDK_LIBRARIES%:libmedia.so:libandroid_runtime.so
|
||||
# libmedia.so must be removed after we have fix for lib-dplmedia.so (b/64427765)
|
||||
# libandroid_runtime.so must be removed after we have a fix for qseeproxydaemon (b/64820887)
|
||||
|
||||
|
@ -150,4 +150,3 @@ namespace.system.permitted.paths = /system/${LIB}
|
|||
|
||||
namespace.system.asan.search.paths = /data/asan/system/${LIB}:/system/${LIB}
|
||||
namespace.system.asan.permitted.paths = /data/asan/system/${LIB}:/system/${LIB}
|
||||
|
Loading…
Reference in a new issue