From 2e09bc1c5bb97ea2b9e4951d0fdb3853bfa8cdc6 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Mon, 23 May 2016 17:16:55 -0700 Subject: [PATCH] Remove no-op call to android_update_LD_LIBRARY_PATH With linker-namespaces enabled for all target sdk versions the call to android_update_LD_LIBRARY_PATH is no longer needed. Bug: http://b/26040253 Bug: http://b/27702070 Change-Id: I77c27c10a435e223824e1b69f727d0bc37a26306 (cherry picked from commit 1bd15f0311b6d7c5b28cf70914831006a9ef64c3) --- runtime/openjdkjvm/OpenjdkJvm.cc | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/runtime/openjdkjvm/OpenjdkJvm.cc b/runtime/openjdkjvm/OpenjdkJvm.cc index ca5efe554..ba71dc3c6 100644 --- a/runtime/openjdkjvm/OpenjdkJvm.cc +++ b/runtime/openjdkjvm/OpenjdkJvm.cc @@ -58,11 +58,6 @@ #include #include -#ifdef ART_TARGET_ANDROID -// This function is provided by android linker. -extern "C" void android_update_LD_LIBRARY_PATH(const char* ld_library_path); -#endif // ART_TARGET_ANDROID - #undef LOG_TAG #define LOG_TAG "artopenjdk" @@ -324,22 +319,6 @@ JNIEXPORT __attribute__((noreturn)) void JVM_Exit(jint status) { exit(status); } -static void SetLdLibraryPath(JNIEnv* env, jstring javaLdLibraryPath) { -#ifdef ART_TARGET_ANDROID - if (javaLdLibraryPath != nullptr) { - ScopedUtfChars ldLibraryPath(env, javaLdLibraryPath); - if (ldLibraryPath.c_str() != nullptr) { - android_update_LD_LIBRARY_PATH(ldLibraryPath.c_str()); - } - } - -#else - LOG(WARNING) << "android_update_LD_LIBRARY_PATH not found; .so dependencies will not work!"; - UNUSED(javaLdLibraryPath, env); -#endif -} - - JNIEXPORT jstring JVM_NativeLoad(JNIEnv* env, jstring javaFilename, jobject javaLoader, @@ -349,17 +328,6 @@ JNIEXPORT jstring JVM_NativeLoad(JNIEnv* env, return NULL; } - int32_t target_sdk_version = art::Runtime::Current()->GetTargetSdkVersion(); - - // Starting with N nativeLoad uses classloader local - // linker namespace instead of global LD_LIBRARY_PATH - // (23 is Marshmallow). This call is here to preserve - // backwards compatibility for the apps targeting sdk - // version <= 23 - if (target_sdk_version == 0) { - SetLdLibraryPath(env, javaLibrarySearchPath); - } - std::string error_msg; { art::JavaVMExt* vm = art::Runtime::Current()->GetJavaVM(); -- 2.11.0