diff options
| author | 2023-03-14 18:19:46 -0700 | |
|---|---|---|
| committer | 2023-03-14 18:19:46 -0700 | |
| commit | 48b8152515969d8e4bfde3471fdaab68ac98e2bc (patch) | |
| tree | c881e961a15139b24fb7f5663cfdbe11591ed6d6 | |
| parent | b7c18f231ae263e735bd8c7522f16e7d7b52fe70 (diff) | |
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
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 076e4e118e66..1505ccce97a1 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -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(); |