< prev index next >

hotspot/src/os/solaris/vm/os_solaris.cpp

Print this page

        

*** 532,548 **** // Base path of extensions installed on the system. #define SYS_EXT_DIR "/usr/jdk/packages" #define EXTENSIONS_DIR "/lib/ext" - char cpu_arch[12]; // Buffer that fits several sprintfs. // Note that the space for the colon and the trailing null are provided // by the nulls included by the sizeof operator. const size_t bufsize = MAX3((size_t)MAXPATHLEN, // For dll_dir & friends. ! sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch), // invariant ld_library_path (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal); // sysclasspath, java_home, dll_dir { --- 532,547 ---- // Base path of extensions installed on the system. #define SYS_EXT_DIR "/usr/jdk/packages" #define EXTENSIONS_DIR "/lib/ext" // Buffer that fits several sprintfs. // Note that the space for the colon and the trailing null are provided // by the nulls included by the sizeof operator. const size_t bufsize = MAX3((size_t)MAXPATHLEN, // For dll_dir & friends. ! sizeof(SYS_EXT_DIR) + sizeof("/lib/"), // invariant ld_library_path (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir char *buf = (char *)NEW_C_HEAP_ARRAY(char, bufsize, mtInternal); // sysclasspath, java_home, dll_dir {
*** 559,575 **** Arguments::set_dll_dir(buf); if (pslash != NULL) { pslash = strrchr(buf, '/'); if (pslash != NULL) { - *pslash = '\0'; // Get rid of /<arch>. - pslash = strrchr(buf, '/'); - if (pslash != NULL) { *pslash = '\0'; // Get rid of /lib. } } - } Arguments::set_java_home(buf); set_boot_path('/', ':'); } // Where to look for native libraries. --- 558,570 ----
*** 621,645 **** // Eventually, all the library path setting will be done here. // // However, to prevent the proliferation of improperly built native // libraries, the new path component /usr/jdk/packages is added here. - // Determine the actual CPU architecture. - sysinfo(SI_ARCHITECTURE, cpu_arch, sizeof(cpu_arch)); - #ifdef _LP64 - // If we are a 64-bit vm, perform the following translations: - // sparc -> sparcv9 - // i386 -> amd64 - if (strcmp(cpu_arch, "sparc") == 0) { - strcat(cpu_arch, "v9"); - } else if (strcmp(cpu_arch, "i386") == 0) { - strcpy(cpu_arch, "amd64"); - } - #endif - // Construct the invariant part of ld_library_path. ! sprintf(common_path, SYS_EXT_DIR "/lib/%s", cpu_arch); // Struct size is more than sufficient for the path components obtained // through the dlinfo() call, so only add additional space for the path // components explicitly added here. size_t library_path_size = info->dls_size + strlen(common_path); --- 616,627 ---- // Eventually, all the library path setting will be done here. // // However, to prevent the proliferation of improperly built native // libraries, the new path component /usr/jdk/packages is added here. // Construct the invariant part of ld_library_path. ! sprintf(common_path, SYS_EXT_DIR "/lib"); // Struct size is more than sufficient for the path components obtained // through the dlinfo() call, so only add additional space for the path // components explicitly added here. size_t library_path_size = info->dls_size + strlen(common_path);
*** 2074,2108 **** if (strncmp(p, "/jre/lib/", 9) != 0) { // Look for JAVA_HOME in the environment. char* java_home_var = ::getenv("JAVA_HOME"); if (java_home_var != NULL && java_home_var[0] != 0) { - char cpu_arch[12]; char* jrelib_p; int len; ! sysinfo(SI_ARCHITECTURE, cpu_arch, sizeof(cpu_arch)); ! #ifdef _LP64 ! // If we are on sparc running a 64-bit vm, look in jre/lib/sparcv9. ! if (strcmp(cpu_arch, "sparc") == 0) { ! strcat(cpu_arch, "v9"); ! } else if (strcmp(cpu_arch, "i386") == 0) { ! strcpy(cpu_arch, "amd64"); ! } ! #endif // Check the current module name "libjvm.so". p = strrchr(buf, '/'); assert(strstr(p, "/libjvm") == p, "invalid library name"); realpath(java_home_var, buf); // determine if this is a legacy image or modules image // modules image doesn't have "jre" subdirectory len = strlen(buf); assert(len < buflen, "Ran out of buffer space"); jrelib_p = buf + len; ! snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch); if (0 != access(buf, F_OK)) { ! snprintf(jrelib_p, buflen-len, "/lib/%s", cpu_arch); } if (0 == access(buf, F_OK)) { // Use current module name "libjvm.so" len = strlen(buf); --- 2056,2081 ---- if (strncmp(p, "/jre/lib/", 9) != 0) { // Look for JAVA_HOME in the environment. char* java_home_var = ::getenv("JAVA_HOME"); if (java_home_var != NULL && java_home_var[0] != 0) { char* jrelib_p; int len; ! // Check the current module name "libjvm.so". p = strrchr(buf, '/'); assert(strstr(p, "/libjvm") == p, "invalid library name"); realpath(java_home_var, buf); // determine if this is a legacy image or modules image // modules image doesn't have "jre" subdirectory len = strlen(buf); assert(len < buflen, "Ran out of buffer space"); jrelib_p = buf + len; ! snprintf(jrelib_p, buflen-len, "/jre/lib"); if (0 != access(buf, F_OK)) { ! snprintf(jrelib_p, buflen-len, "/lib"); } if (0 == access(buf, F_OK)) { // Use current module name "libjvm.so" len = strlen(buf);
< prev index next >