Don't load compiler_rt if renderscript is disabled

Bug: 206676167
Test: Verified on aosp_cf_riscv64_slim target, which doesn't support RS,
that this library loads and fails by default, but skips load when the
config.disable_renderscript flag is enabled.

Change-Id: If3f516f5e38c39b35b26d102ebdc9a4816be60a3
This commit is contained in:
Prashanth Swaminathan
2023-03-14 18:19:46 -07:00
parent b7c18f231a
commit 48b8152515

View File

@@ -185,8 +185,13 @@ public class ZygoteInit {
private static void preloadSharedLibraries() {
Log.i(TAG, "Preloading shared libraries...");
System.loadLibrary("android");
System.loadLibrary("compiler_rt");
System.loadLibrary("jnigraphics");
// TODO(b/206676167): This library is only used for renderscript today. When renderscript is
// removed, this load can be removed as well.
if (!SystemProperties.getBoolean("config.disable_renderscript", false)) {
System.loadLibrary("compiler_rt");
}
}
native private static void nativePreloadAppProcessHALs();