1# Copyright (C) 2019 The Android Open Source Project 2# 3# Bionic loader config file for the media swcodec APEX. 4# 5# There are no versioned APEX paths here - this APEX module does not support 6# having several versions mounted. 7 8dir.swcodec = /apex/com.android.media.swcodec/bin/ 9 10[swcodec] 11additional.namespaces = platform,sphal 12 13############################################################################### 14# "default" namespace 15# 16# This namespace is for the binaries and libraries on the swcodec APEX. 17############################################################################### 18 19namespace.default.isolated = true 20namespace.default.visible = true 21 22namespace.default.search.paths = /apex/com.android.media.swcodec/${LIB} 23namespace.default.asan.search.paths = /apex/com.android.media.swcodec/${LIB} 24 25# Below lines are required to be able to access libs in APEXes which are 26# actually symlinks to the files under /system/lib. The symlinks exist for 27# bundled APEXes to reduce space. 28namespace.default.permitted.paths = /system/${LIB} 29namespace.default.asan.permitted.paths = /system/${LIB} 30 31namespace.default.links = platform 32 33# TODO: replace the following when apex has a way to auto-generate this list 34# namespace.default.link.platform.shared_libs = %LLNDK_LIBRARIES% 35# namespace.default.link.platform.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% 36namespace.default.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libandroid_net.so:libc.so:libcgrouprc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.asan-arm-android.so:libclang_rt.hwasan-aarch64-android.so:libclang_rt.asan-i686-android.so:libclang_rt.asan-x86_64-android.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libsync.so:libvndksupport.so:libdl_android.so:libvulkan.so:libbinder_ndk.so 37 38############################################################################### 39# "platform" namespace 40# 41# This namespace is for linking to LLNDK and ASAN libraries on the system. 42############################################################################### 43 44namespace.platform.isolated = true 45 46namespace.platform.search.paths = /system/${LIB} 47namespace.platform.asan.search.paths = /data/asan/system/${LIB} 48namespace.platform.asan.search.paths += /system/${LIB} 49 50# TODO(b/140790209): These directories are wrong in R and later because they 51# only contain Bionic internal libraries dependencies that should not be 52# accessed from the outside. However, they may be necessary for APEX builds that 53# are pushed to Q. Remove them as soon as Q compatibility is no longer required. 54namespace.platform.search.paths += /apex/com.android.runtime/${LIB} 55namespace.platform.asan.search.paths += /apex/com.android.runtime/${LIB} 56 57# /system/lib/libc.so, etc are symlinks to /apex/com.android.lib/lib/bionic/libc.so, etc. 58# Add /apex/... path to the permitted paths because linker uses realpath(3) 59# to check the accessibility of the lib. We could add this to search.paths 60# instead but that makes the resolution of bionic libs be dependent on 61# the order of /system/lib and /apex/... in search.paths. If /apex/... 62# is after /system/lib, then /apex/... is never tried because libc.so 63# is always found in /system/lib but fails to pass the accessibility test 64# because of its realpath. It's better to not depend on the ordering if 65# possible. 66namespace.platform.permitted.paths = /apex/com.android.runtime/${LIB}/bionic 67namespace.platform.asan.permitted.paths = /apex/com.android.runtime/${LIB}/bionic 68 69############################################################################### 70# "sphal" namespace 71# 72############################################################################### 73namespace.sphal.isolated = true 74namespace.sphal.visible = true 75 76# Keep the below in sync with "sphal" namespace in system's /etc/ld.config.txt 77# Codec2 has dependencies on some SP-hals (eg. android.hardware.graphics.mapper@2.0) 78# These are dlopen'ed by libvndksupport.so. 79namespace.sphal.search.paths = /odm/${LIB} 80namespace.sphal.search.paths += /vendor/${LIB} 81 82namespace.sphal.permitted.paths = /odm/${LIB} 83namespace.sphal.permitted.paths += /vendor/${LIB} 84namespace.sphal.permitted.paths += /vendor/${LIB}/hw 85namespace.sphal.permitted.paths += /system/vendor/${LIB} 86 87namespace.sphal.asan.search.paths = /data/asan/odm/${LIB} 88namespace.sphal.asan.search.paths += /odm/${LIB} 89namespace.sphal.asan.search.paths += /data/asan/vendor/${LIB} 90namespace.sphal.asan.search.paths += /vendor/${LIB} 91 92namespace.sphal.asan.permitted.paths = /data/asan/odm/${LIB} 93namespace.sphal.asan.permitted.paths += /odm/${LIB} 94namespace.sphal.asan.permitted.paths += /data/asan/vendor/${LIB} 95namespace.sphal.asan.permitted.paths += /vendor/${LIB} 96 97# Keep the below in sync with "vndk" namespace in system's /etc/ld.config.txt 98# System's sphal namespace links to vndk namespace for %VNDK_SAMEPROCESS_LIBRARIES%, 99# since we don't have a good way to auto-expand %VNDK_SAMEPROCESS_LIBRARIES%, 100# we'll add the vndk paths below. 101 102namespace.sphal.search.paths += /odm/${LIB}/vndk-sp 103namespace.sphal.search.paths += /vendor/${LIB}/vndk-sp 104namespace.sphal.search.paths += /system/${LIB}/vndk-sp${VNDK_VER} 105 106namespace.sphal.permitted.paths += /odm/${LIB}/hw 107namespace.sphal.permitted.paths += /odm/${LIB}/egl 108namespace.sphal.permitted.paths += /vendor/${LIB}/hw 109namespace.sphal.permitted.paths += /vendor/${LIB}/egl 110namespace.sphal.permitted.paths += /system/vendor/${LIB}/hw 111namespace.sphal.permitted.paths += /system/vendor/${LIB}/egl 112# This is exceptionally required since android.hidl.memory@1.0-impl.so is here 113namespace.sphal.permitted.paths += /system/${LIB}/vndk-sp${VNDK_VER}/hw 114 115namespace.sphal.asan.search.paths += /data/asan/odm/${LIB}/vndk-sp 116namespace.sphal.asan.search.paths += /odm/${LIB}/vndk-sp 117namespace.sphal.asan.search.paths += /data/asan/vendor/${LIB}/vndk-sp 118namespace.sphal.asan.search.paths += /vendor/${LIB}/vndk-sp 119namespace.sphal.asan.search.paths += /data/asan/system/${LIB}/vndk-sp${VNDK_VER} 120namespace.sphal.asan.search.paths += /system/${LIB}/vndk-sp${VNDK_VER} 121 122namespace.sphal.asan.permitted.paths += /data/asan/odm/${LIB}/hw 123namespace.sphal.asan.permitted.paths += /odm/${LIB}/hw 124namespace.sphal.asan.permitted.paths += /data/asan/odm/${LIB}/egl 125namespace.sphal.asan.permitted.paths += /odm/${LIB}/egl 126namespace.sphal.asan.permitted.paths += /data/asan/vendor/${LIB}/hw 127namespace.sphal.asan.permitted.paths += /vendor/${LIB}/hw 128namespace.sphal.asan.permitted.paths += /data/asan/vendor/${LIB}/egl 129namespace.sphal.asan.permitted.paths += /vendor/${LIB}/egl 130 131namespace.sphal.asan.permitted.paths += /data/asan/system/${LIB}/vndk-sp${VNDK_VER}/hw 132namespace.sphal.asan.permitted.paths += /system/${LIB}/vndk-sp${VNDK_VER}/hw 133 134# Once in this namespace, access to libraries in /system/lib is restricted. Only 135# libs listed here can be used. 136namespace.sphal.links = platform 137 138# TODO: replace the following when apex has a way to auto-generate this list 139# namespace.sphal.link.platform.shared_libs = %LLNDK_LIBRARIES% 140# namespace.sphal.link.platform.shared_libs += %SANITIZER_RUNTIME_LIBRARIES% 141namespace.sphal.link.platform.shared_libs = libEGL.so:libGLESv1_CM.so:libGLESv2.so:libGLESv3.so:libandroid_net.so:libc.so:libcgrouprc.so:libclang_rt.asan-aarch64-android.so:libclang_rt.asan-arm-android.so:libclang_rt.hwasan-aarch64-android.so:libclang_rt.asan-i686-android.so:libclang_rt.asan-x86_64-android.so:libdl.so:libft2.so:liblog.so:libm.so:libmediandk.so:libnativewindow.so:libneuralnetworks.so:libsync.so:libvndksupport.so:libvulkan.so:libbinder_ndk.so 142 143# Add a link for libz.so which is llndk on devices where VNDK is not enforced. 144namespace.sphal.link.platform.shared_libs += libz.so 145 146# With VNDK APEX, /system/${LIB}/vndk-sp${VNDK_VER} is a symlink to the following. 147# Add /apex/... path to the permitted paths because linker uses realpath(3) 148# to check the accessibility of the lib. 149namespace.sphal.permitted.paths += /apex/com.android.vndk.${VNDK_APEX_VER}/${LIB} 150namespace.sphal.asan.permitted.paths += /apex/com.android.vndk.${VNDK_APEX_VER}/${LIB} 151