< prev index next >

src/os/bsd/vm/os_bsd.cpp

Print this page

        

@@ -440,10 +440,14 @@
     *(strrchr(buf, '/')) = '\0'; // Get rid of /libjvm.so.
     pslash = strrchr(buf, '/');
     if (pslash != NULL) {
       *pslash = '\0';            // Get rid of /{client|server|hotspot}.
     }
+#ifdef STATIC_BUILD
+    strcat(buf, "/lib");
+#endif
+
     Arguments::set_dll_dir(buf);
 
     if (pslash != NULL) {
       pslash = strrchr(buf, '/');
       if (pslash != NULL) {

@@ -1388,10 +1392,13 @@
 // in case of error it checks if .dll/.so was built for the
 // same architecture as Hotspot is running on
 
 #ifdef __APPLE__
 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
+#ifdef STATIC_BUILD
+  return os::get_default_process_handle();
+#else
   void * result= ::dlopen(filename, RTLD_LAZY);
   if (result != NULL) {
     // Successful loading
     return result;
   }

@@ -1399,13 +1406,17 @@
   // Read system error message into ebuf
   ::strncpy(ebuf, ::dlerror(), ebuflen-1);
   ebuf[ebuflen-1]='\0';
 
   return NULL;
+#endif // STATIC_BUILD
 }
 #else
 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
+#ifdef STATIC_BUILD
+  return os::get_default_process_handle();
+#else
   void * result= ::dlopen(filename, RTLD_LAZY);
   if (result != NULL) {
     // Successful loading
     return result;
   }

@@ -1574,10 +1585,11 @@
                  arch_array[running_arch_index].name);
     }
   }
 
   return NULL;
+#endif // STATIC_BUILD
 }
 #endif // !__APPLE__
 
 void* os::get_default_process_handle() {
 #ifdef __APPLE__
< prev index next >