Merge pull request #123708 from fzakaria/faridzakaria/nix-jdk8-library-path

jdk8: Remove default java.library.path
This commit is contained in:
Sandro 2021-06-01 20:25:28 +02:00 committed by GitHub
commit bf8430634a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 0 deletions

View File

@ -106,6 +106,7 @@ let
./fix-java-home-jdk8.patch
./read-truststore-from-env-jdk8.patch
./currency-date-range-jdk8.patch
./fix-library-path-jdk8.patch
] ++ lib.optionals (!headless && enableGnome2) [
./swing-use-gtk-jdk8.patch
];

View File

@ -0,0 +1,37 @@
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index c477851c1b..ff5e28d95b 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -368,13 +368,13 @@ void os::init_system_properties_values() {
// ...
// 7: The default directories, normally /lib and /usr/lib.
#if defined(AMD64) || defined(_LP64) && (defined(SPARC) || defined(PPC) || defined(S390))
-#define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
+#define DEFAULT_LIBPATH ""
#else
-#define DEFAULT_LIBPATH "/lib:/usr/lib"
+#define DEFAULT_LIBPATH ""
#endif
// Base path of extensions installed on the system.
-#define SYS_EXT_DIR "/usr/java/packages"
+#define SYS_EXT_DIR ""
#define EXTENSIONS_DIR "/lib/ext"
#define ENDORSED_DIR "/lib/endorsed"
@@ -437,13 +437,13 @@ void os::init_system_properties_values() {
strlen(v) + 1 +
sizeof(SYS_EXT_DIR) + sizeof("/lib/") + strlen(cpu_arch) + sizeof(DEFAULT_LIBPATH) + 1,
mtInternal);
- sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib/%s:" DEFAULT_LIBPATH, v, v_colon, cpu_arch);
+ sprintf(ld_library_path, "%s%s", v);
Arguments::set_library_path(ld_library_path);
FREE_C_HEAP_ARRAY(char, ld_library_path, mtInternal);
}
// 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);
// Endorsed standards default directory.