Fix[nsbypass]: prevent vulkan loader deadlock on EMUI devices

This commit is contained in:
Vera-Firefly 2023-10-11 00:57:13 +08:00 committed by GitHub
parent e9d1810be4
commit 13d38e2765
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,12 @@ bool linker_ns_load(const char* lib_search_path) {
// FoldCraft got trolled because they copied the
// old broken code verbatim and didn't even test it thoroughly
android_link_namespaces(driver_namespace, NULL, "ld-android.so");
// Also establish links to use the libnativeloader(_lazy).so libraries
// from the global namespace. This is a workaround for an EMUI issue where
// the newly loaded libnativeloader_lazy for some unknown reason links
// to itself and causes a deadlock when loading the vulkan driver.
android_link_namespaces(driver_namespace, NULL, "libnativeloader.so");
android_link_namespaces(driver_namespace, NULL, "libnativeloader_lazy.so");
dlclose(ld_android_handle);
return true;
#endif