Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.
default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).
sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().
vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.
Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.
Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.
Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')
Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-05 07:24:14 +02:00
|
|
|
# Copyright (C) 2017 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Bionic loader config file.
|
|
|
|
# This gives the exactly the same namespace setup in pre-O.
|
|
|
|
#
|
|
|
|
|
|
|
|
# All binaries gets the same configuration 'legacy'
|
|
|
|
dir.legacy = /system
|
2018-11-28 07:15:16 +01:00
|
|
|
dir.legacy = /product
|
Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.
default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).
sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().
vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.
Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.
Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.
Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')
Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-05 07:24:14 +02:00
|
|
|
dir.legacy = /vendor
|
2017-09-27 09:40:59 +02:00
|
|
|
dir.legacy = /odm
|
Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.
default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).
sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().
vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.
Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.
Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.
Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')
Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-05 07:24:14 +02:00
|
|
|
dir.legacy = /sbin
|
|
|
|
|
2018-11-28 07:15:16 +01:00
|
|
|
# Except for /postinstall, where only /system and /product are searched
|
2018-03-19 17:12:31 +01:00
|
|
|
dir.postinstall = /postinstall
|
|
|
|
|
2019-03-26 17:30:23 +01:00
|
|
|
# Fallback entry to provide APEX namespace lookups for binaries anywhere else.
|
|
|
|
# This must be last.
|
|
|
|
dir.legacy = /data
|
|
|
|
|
Configure ld.config.txt for SP-HALs
Now, framework process (any process that is executing /system/bin/* or
/system/xbin/*) are started with three namespaces; default, sphal and
vndk.
default namespace is the namespace that is responsible for loading libs
from /system/lib. It can't load libs from other places such as
/vendor/lib. (However, we temporarily open the path since we haven't
finished the system partition cleanup, but will do eventually).
sphal namespace is the namespace where SP-HAL (Same-process HAL) is
loaded. SP-HAL are the only vendor libraries that are allowed to be
loaded inside framework processes. libEGL_<chipset>.so and
android.hardware.graphics.mapper@2.0-impl.so, etc are SP-HALs. When
framework needs to load those SP-HALs, it explicitly loads it from this
namespace using android_get_exported_namespace() and
android_dlopen_ext().
vndk namespace is the namespace for loading vndk-sp (Vendor-NDK for
Same-Process) libs, which is a small set of framework libraries that
SP-HALs can link against. These libraries are compiled for the same
version of Android that the vendor partition is compiled against.
SP-HALs can not use libraries other than vndk-sp and ndk libs.
Membership to vndk-sp and ndk are strictly closed.
Note that in a system, there are two copies of vndk-sp libs. One at
/system/lib and the other at /vendor/lib/vndk-sp. As a result, there can
be two instances of a same library in a process.
Also adds ld.config.legacy.txt which is used on non-Treble devices where
PRODUCT_FULL_TREBLE is not set to true.
Note, this split can be cleaned up further after b/37139976 is solved.
Bug: 34407260
Test: git diff HEAD:rootdir/etc/ld.config.legacy.txt
HEAD^:rootdir/etc/ld.config.txt => 0
Test: sailfish boots (because BOARD_VNDK_VERSION is not set to
'current')
Change-Id: I8331d94edc38f22c4f8abc66cdf2050af9d0605b
2017-04-05 07:24:14 +02:00
|
|
|
[legacy]
|
|
|
|
namespace.default.isolated = false
|
2019-04-25 17:20:32 +02:00
|
|
|
# Visible to allow links to be created at runtime, e.g. through
|
|
|
|
# android_link_namespaces in libnativeloader.
|
|
|
|
namespace.default.visible = true
|
2017-12-12 14:11:47 +01:00
|
|
|
|
|
|
|
namespace.default.search.paths = /system/${LIB}
|
2018-11-28 07:15:16 +01:00
|
|
|
namespace.default.search.paths += /product/${LIB}
|
2017-12-12 14:11:47 +01:00
|
|
|
namespace.default.search.paths += /vendor/${LIB}
|
|
|
|
namespace.default.search.paths += /odm/${LIB}
|
|
|
|
|
|
|
|
namespace.default.asan.search.paths = /data/asan/system/${LIB}
|
|
|
|
namespace.default.asan.search.paths += /system/${LIB}
|
2018-11-28 07:15:16 +01:00
|
|
|
namespace.default.asan.search.paths += /data/asan/product/${LIB}
|
|
|
|
namespace.default.asan.search.paths += /product/${LIB}
|
2017-12-12 14:11:47 +01:00
|
|
|
namespace.default.asan.search.paths += /data/asan/vendor/${LIB}
|
|
|
|
namespace.default.asan.search.paths += /vendor/${LIB}
|
2018-11-28 07:15:16 +01:00
|
|
|
namespace.default.asan.search.paths += /data/asan/odm/${LIB}
|
|
|
|
namespace.default.asan.search.paths += /odm/${LIB}
|
2018-03-19 17:12:31 +01:00
|
|
|
|
2019-01-24 22:20:20 +01:00
|
|
|
###############################################################################
|
|
|
|
# APEX related namespaces.
|
|
|
|
###############################################################################
|
|
|
|
|
2019-10-01 01:41:21 +02:00
|
|
|
additional.namespaces = art,conscrypt,media,neuralnetworks,resolv
|
2019-01-24 22:20:20 +01:00
|
|
|
|
2019-04-25 17:20:32 +02:00
|
|
|
# Keep in sync with the "platform" namespace in art/build/apex/ld.config.txt.
|
2019-01-29 04:52:41 +01:00
|
|
|
# If a shared library or an executable requests a shared library that
|
|
|
|
# cannot be loaded into the default namespace, the dynamic linker tries
|
2019-10-01 01:41:21 +02:00
|
|
|
# to load the shared library from the art namespace. And then, if the
|
|
|
|
# shared library cannot be loaded from the art namespace either, the
|
2019-01-29 04:52:41 +01:00
|
|
|
# dynamic linker tries to load the shared library from the resolv namespace.
|
|
|
|
# Finally, if all attempts fail, the dynamic linker returns an error.
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.default.links = art,resolv,neuralnetworks
|
|
|
|
namespace.default.asan.links = art,resolv,neuralnetworks
|
|
|
|
namespace.default.link.art.shared_libs = libandroidicu.so
|
|
|
|
namespace.default.link.art.shared_libs += libdexfile_external.so
|
|
|
|
namespace.default.link.art.shared_libs += libdexfiled_external.so
|
2019-06-06 15:11:04 +02:00
|
|
|
# TODO(b/120786417 or b/134659294): libicuuc.so and libicui18n.so are kept for app compat.
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.default.link.art.shared_libs += libicui18n.so
|
|
|
|
namespace.default.link.art.shared_libs += libicuuc.so
|
|
|
|
namespace.default.link.art.shared_libs += libnativebridge.so
|
|
|
|
namespace.default.link.art.shared_libs += libnativehelper.so
|
|
|
|
namespace.default.link.art.shared_libs += libnativeloader.so
|
2019-01-15 19:04:56 +01:00
|
|
|
|
|
|
|
# TODO(b/122876336): Remove libpac.so once it's migrated to Webview
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.default.link.art.shared_libs += libpac.so
|
2019-01-24 22:20:20 +01:00
|
|
|
|
2019-01-29 04:52:41 +01:00
|
|
|
# When libnetd_resolv.so can't be found in the default namespace, search for it
|
|
|
|
# in the resolv namespace. Don't allow any other libraries from the resolv namespace
|
|
|
|
# to be loaded in the default namespace.
|
2019-01-24 06:01:21 +01:00
|
|
|
namespace.default.link.resolv.shared_libs = libnetd_resolv.so
|
|
|
|
|
2019-07-10 13:08:57 +02:00
|
|
|
# LLNDK library moved into apex
|
|
|
|
namespace.default.link.neuralnetworks.shared_libs = libneuralnetworks.so
|
|
|
|
|
2019-01-24 22:20:20 +01:00
|
|
|
###############################################################################
|
2019-10-01 01:41:21 +02:00
|
|
|
# "art" APEX namespace
|
2019-01-24 22:20:20 +01:00
|
|
|
#
|
2019-10-01 01:41:21 +02:00
|
|
|
# This namespace exposes externally accessible libraries from the ART APEX.
|
|
|
|
# Keep in sync with the "art" namespace in art/build/apex/ld.config.txt.
|
2019-01-24 22:20:20 +01:00
|
|
|
###############################################################################
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.art.isolated = true
|
2019-04-25 17:20:32 +02:00
|
|
|
# Visible to allow links to be created at runtime, e.g. through
|
|
|
|
# android_link_namespaces in libnativeloader.
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.art.visible = true
|
2019-01-24 22:20:20 +01:00
|
|
|
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.art.search.paths = /apex/com.android.art/${LIB}
|
|
|
|
namespace.art.asan.search.paths = /apex/com.android.art/${LIB}
|
2019-10-09 09:40:15 +02:00
|
|
|
namespace.art.links = default,neuralnetworks
|
2019-02-27 22:40:42 +01:00
|
|
|
# Need allow_all_shared_libs because libart.so can dlopen oat files in
|
|
|
|
# /system/framework and /data.
|
|
|
|
# TODO(b/130340935): Use a dynamically created linker namespace similar to
|
|
|
|
# classloader-namespace for oat files, and tighten this up.
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.art.link.default.allow_all_shared_libs = true
|
2019-10-09 09:40:15 +02:00
|
|
|
namespace.art.link.neuralnetworks.shared_libs = libneuralnetworks.so
|
2019-01-24 22:20:20 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# "media" APEX namespace
|
|
|
|
#
|
|
|
|
# This namespace is for libraries within the media APEX.
|
|
|
|
###############################################################################
|
|
|
|
namespace.media.isolated = true
|
|
|
|
namespace.media.visible = true
|
|
|
|
|
|
|
|
namespace.media.search.paths = /apex/com.android.media/${LIB}
|
|
|
|
namespace.media.asan.search.paths = /apex/com.android.media/${LIB}
|
|
|
|
|
2019-02-22 09:47:13 +01:00
|
|
|
namespace.media.permitted.paths = /apex/com.android.media/${LIB}/extractors
|
|
|
|
|
2019-01-24 22:20:20 +01:00
|
|
|
namespace.media.links = default
|
2019-04-23 23:56:21 +02:00
|
|
|
namespace.media.link.default.shared_libs = libbinder_ndk.so
|
2019-03-15 22:43:07 +01:00
|
|
|
namespace.media.link.default.shared_libs += libc.so
|
2019-03-29 21:17:35 +01:00
|
|
|
namespace.media.link.default.shared_libs += libcgrouprc.so
|
2019-03-15 22:43:07 +01:00
|
|
|
namespace.media.link.default.shared_libs += libdl.so
|
|
|
|
namespace.media.link.default.shared_libs += liblog.so
|
|
|
|
namespace.media.link.default.shared_libs += libmediametrics.so
|
|
|
|
namespace.media.link.default.shared_libs += libmediandk.so
|
|
|
|
namespace.media.link.default.shared_libs += libm.so
|
|
|
|
namespace.media.link.default.shared_libs += libvndksupport.so
|
|
|
|
|
|
|
|
namespace.media.link.default.shared_libs += libclang_rt.asan-aarch64-android.so
|
|
|
|
namespace.media.link.default.shared_libs += libclang_rt.asan-arm-android.so
|
|
|
|
namespace.media.link.default.shared_libs += libclang_rt.asan-i686-android.so
|
|
|
|
namespace.media.link.default.shared_libs += libclang_rt.asan-x86_64-android.so
|
|
|
|
namespace.media.link.default.shared_libs += libclang_rt.hwasan-aarch64-android.so
|
2019-01-24 22:20:20 +01:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# "conscrypt" APEX namespace
|
|
|
|
#
|
|
|
|
# This namespace is for libraries within the conscrypt APEX.
|
2019-04-25 17:20:32 +02:00
|
|
|
# Keep in sync with the "conscrypt" namespace in art/build/apex/ld.config.txt.
|
2019-01-24 22:20:20 +01:00
|
|
|
###############################################################################
|
|
|
|
namespace.conscrypt.isolated = true
|
|
|
|
namespace.conscrypt.visible = true
|
|
|
|
|
|
|
|
namespace.conscrypt.search.paths = /apex/com.android.conscrypt/${LIB}
|
|
|
|
namespace.conscrypt.asan.search.paths = /apex/com.android.conscrypt/${LIB}
|
2019-10-01 01:41:21 +02:00
|
|
|
namespace.conscrypt.links = art,default
|
|
|
|
namespace.conscrypt.link.art.shared_libs = libandroidio.so
|
2019-01-24 22:20:20 +01:00
|
|
|
namespace.conscrypt.link.default.shared_libs = libc.so
|
|
|
|
namespace.conscrypt.link.default.shared_libs += libm.so
|
|
|
|
namespace.conscrypt.link.default.shared_libs += libdl.so
|
2019-02-08 20:55:36 +01:00
|
|
|
namespace.conscrypt.link.default.shared_libs += liblog.so
|
2019-01-24 22:20:20 +01:00
|
|
|
|
2019-01-24 06:01:21 +01:00
|
|
|
###############################################################################
|
|
|
|
# "resolv" APEX namespace
|
|
|
|
#
|
|
|
|
# This namespace is for libraries within the resolv APEX.
|
|
|
|
###############################################################################
|
|
|
|
namespace.resolv.isolated = true
|
|
|
|
namespace.resolv.visible = true
|
|
|
|
|
|
|
|
namespace.resolv.search.paths = /apex/com.android.resolv/${LIB}
|
|
|
|
namespace.resolv.asan.search.paths = /apex/com.android.resolv/${LIB}
|
|
|
|
namespace.resolv.links = default
|
|
|
|
namespace.resolv.link.default.shared_libs = libc.so
|
2019-03-29 21:17:35 +01:00
|
|
|
namespace.resolv.link.default.shared_libs += libcgrouprc.so
|
2019-01-24 06:01:21 +01:00
|
|
|
namespace.resolv.link.default.shared_libs += libm.so
|
|
|
|
namespace.resolv.link.default.shared_libs += libdl.so
|
|
|
|
namespace.resolv.link.default.shared_libs += libbinder_ndk.so
|
2019-02-08 20:55:36 +01:00
|
|
|
namespace.resolv.link.default.shared_libs += liblog.so
|
2019-02-08 23:00:35 +01:00
|
|
|
namespace.resolv.link.default.shared_libs += libvndksupport.so
|
2019-01-24 06:01:21 +01:00
|
|
|
|
2019-07-10 13:08:57 +02:00
|
|
|
###############################################################################
|
|
|
|
# "neuralnetworks" APEX namespace
|
|
|
|
#
|
|
|
|
# This namespace is for libraries within the NNAPI APEX.
|
|
|
|
###############################################################################
|
|
|
|
namespace.neuralnetworks.isolated = true
|
|
|
|
namespace.neuralnetworks.visible = true
|
|
|
|
|
|
|
|
namespace.neuralnetworks.search.paths = /apex/com.android.neuralnetworks/${LIB}
|
|
|
|
namespace.neuralnetworks.asan.search.paths = /apex/com.android.neuralnetworks/${LIB}
|
|
|
|
namespace.neuralnetworks.links = default
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs = libc.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libcgrouprc.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libdl.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += liblog.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libm.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libnativewindow.so
|
2019-09-17 15:00:10 +02:00
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libneuralnetworks_packageinfo.so
|
2019-07-10 13:08:57 +02:00
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libsync.so
|
|
|
|
namespace.neuralnetworks.link.default.shared_libs += libvndksupport.so
|
|
|
|
|
|
|
|
|
2018-03-19 17:12:31 +01:00
|
|
|
###############################################################################
|
|
|
|
# Namespace config for binaries under /postinstall.
|
|
|
|
# Only one default namespace is defined and it has no directories other than
|
2018-11-28 07:15:16 +01:00
|
|
|
# /system/lib and /product/lib in the search paths. This is because linker
|
|
|
|
# calls realpath on the search paths and this causes selinux denial if the
|
|
|
|
# paths (/vendor, /odm) are not allowed to the poinstall binaries.
|
|
|
|
# There is no reason to allow the binaries to access the paths.
|
2018-03-19 17:12:31 +01:00
|
|
|
###############################################################################
|
|
|
|
[postinstall]
|
|
|
|
namespace.default.isolated = false
|
2018-11-28 07:15:16 +01:00
|
|
|
namespace.default.search.paths = /system/${LIB}
|
|
|
|
namespace.default.search.paths += /product/${LIB}
|