OSDN Git Service

Remove no-op call to android_update_LD_LIBRARY_PATH
authorDimitry Ivanov <dimitry@google.com>
Tue, 24 May 2016 00:16:55 +0000 (17:16 -0700)
committerDimitry Ivanov <dimitry@google.com>
Tue, 24 May 2016 16:42:13 +0000 (09:42 -0700)
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

index ca5efe5..ba71dc3 100644 (file)
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
-#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();