Load GL graphics drivers explicitly from sphal namespace
In Treble term, GL wrappers (libEGL.so, libGLES*.so, ...) are called SP-NDK and actual drivers (libEGL_*.so, libGLESv2_*.so, ...) are called SP-HALs. (SP = Same-Process). SP-HALs are developed by vendors and thus they can use only a subset of framework libraries that we call vndk-stable and subset of NDK libraries. It consists of libc, libm, liblog, libz, libnativewindow, libc++, ..., but not framework-only libraries such as libui, libandroid, etc. In order to enforce such restriction at run-time, we will use the linker namespace. Specifically, we create a new namespace named 'sphal' and configure it so that... 1) it can only search and load libraries from /vendor/lib, 2) it redirects the load/link request to the default namespace when the allowed list of libraries are requested from the caller, and 3) it rejects to search/load any library other than 1) and 2). The problem here is, GL wrapper need to tell the linker to load the drivers from the separate namespace (the 'sphal' namespace other than the default namespace. To specify the namespace, we need to use android_dlopen_ext() instead of dlopen().` Bug: 34407260 Bug: 37049319 Test: none, no op for now since we haven't create sphal namespace. Change-Id: I376dd9e5cc904452f669c27eb85c59b30b43dc39
Loading
Please register or sign in to comment