--- old/src/os/bsd/vm/os_bsd.cpp 2015-10-15 12:36:18.818446170 -0400 +++ new/src/os/bsd/vm/os_bsd.cpp 2015-10-15 12:36:18.194411075 -0400 @@ -442,6 +442,10 @@ 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) { @@ -1390,6 +1394,9 @@ #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 @@ -1401,9 +1408,13 @@ 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 @@ -1576,6 +1587,7 @@ } return NULL; +#endif // STATIC_BUILD } #endif // !__APPLE__