From 8667747a0e573926df3040e1a13ff69a9be0f6f9 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Thu, 29 Mar 2018 14:08:48 +0800 Subject: [PATCH] Allow VNDK-SP extensions to use vendor lib This commit adds a wildcard linker namespace link between the "vndk" namespace and the "sphal" namespace of the system processes. This is created for VNDK-SP-Ext to load vendor libs in "sphal" namespace. Bug: 77249955 Test: lunch aosp_walleye-userdebug && make -j8 # runs unit tests Test: lunch aosp_sailfish-userdebug && make -j8 # runs unit tests Test: Create a VNDK-SP-Ext, link to vendor libs, and run it. Change-Id: I71b0fb604a84272156aa119130c272f891847008 --- rootdir/etc/ld.config.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rootdir/etc/ld.config.txt b/rootdir/etc/ld.config.txt index 94465f4a1..ba96cc84a 100644 --- a/rootdir/etc/ld.config.txt +++ b/rootdir/etc/ld.config.txt @@ -218,13 +218,20 @@ namespace.vndk.asan.permitted.paths += /vendor/${LIB}/egl namespace.vndk.asan.permitted.paths += /data/asan/system/${LIB}/vndk-sp%VNDK_VER%/hw namespace.vndk.asan.permitted.paths += /system/${LIB}/vndk-sp%VNDK_VER%/hw +# The "vndk" namespace links to "default" namespace for LLNDK libs and links to +# "sphal" namespace for vendor libs. The ordering matters. The "default" +# namespace has higher priority than the "sphal" namespace. +namespace.vndk.links = default,sphal + # When these NDK libs are required inside this namespace, then it is redirected # 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 = %LLNDK_LIBRARIES% namespace.vndk.link.default.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% +# Allow VNDK-SP extensions to use vendor libraries +namespace.vndk.link.sphal.allow_all_shared_libs = true + ############################################################################### # Namespace config for vendor processes. In O, no restriction is enforced for # them. However, in O-MR1, access to /system/${LIB} will not be allowed to