about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/openjdk/fix-library-path-jdk17.patch
blob: 4c38aca2b48a9491d0404574f3c2312db0022afc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -412,18 +412,8 @@ void os::init_system_properties_values() {
   //        1: ...
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
-#ifndef OVERRIDE_LIBPATH
-  #if defined(_LP64)
-    #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
-  #else
-    #define DEFAULT_LIBPATH "/lib:/usr/lib"
-  #endif
-#else
-  #define DEFAULT_LIBPATH OVERRIDE_LIBPATH
-#endif
 
 // Base path of extensions installed on the system.
-#define SYS_EXT_DIR     "/usr/java/packages"
 #define EXTENSIONS_DIR  "/lib/ext"
 
   // Buffer that fits several sprintfs.
@@ -431,7 +421,7 @@ void os::init_system_properties_values() {
   // by the nulls included by the sizeof operator.
   const size_t bufsize =
     MAX2((size_t)MAXPATHLEN,  // For dll_dir & friends.
-         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(SYS_EXT_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
+         (size_t)MAXPATHLEN + sizeof(EXTENSIONS_DIR) + sizeof(EXTENSIONS_DIR)); // extensions dir
   char *buf = NEW_C_HEAP_ARRAY(char, bufsize, mtInternal);
 
   // sysclasspath, java_home, dll_dir
@@ -478,26 +468,22 @@ void os::init_system_properties_values() {
     // should always exist (until the legacy problem cited above is
     // addressed).
     const char *v = ::getenv("LD_LIBRARY_PATH");
-    const char *v_colon = ":";
-    if (v == NULL) { v = ""; v_colon = ""; }
+    if (v == NULL) { v = ""; }
     // That's +1 for the colon and +1 for the trailing '\0'.
     char *ld_library_path = NEW_C_HEAP_ARRAY(char,
-                                             strlen(v) + 1 +
-                                             sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1,
+                                             strlen(v) + 1,
                                              mtInternal);
-    sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
+    sprintf(ld_library_path, "%s", v);
     Arguments::set_library_path(ld_library_path);
     FREE_C_HEAP_ARRAY(char, ld_library_path);
   }
 
   // Extensions directories.
-  sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
+  sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
   Arguments::set_ext_dirs(buf);
 
   FREE_C_HEAP_ARRAY(char, buf);
 
-#undef DEFAULT_LIBPATH
-#undef SYS_EXT_DIR
 #undef EXTENSIONS_DIR
 }