nixpkgs/pkgs/development/compilers/openjdk/fix-library-path-jdk11.patch
Farid Zakaria f9f5f4986b openjdk11: remove default library path
This is a follow up to #123708 which does the similar patch but for
OpenJDK11.

Please see the linked issue for more detailed rationale.
2021-06-16 09:30:24 -07:00

38 lines
1.6 KiB
Diff

diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
index 0dbe03349e..847d56778d 100644
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -326,13 +326,13 @@ void os::init_system_properties_values() {
// ...
// 7: The default directories, normally /lib and /usr/lib.
#if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || 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"
// Buffer that fits several sprintfs.
@@ -392,13 +392,13 @@ void os::init_system_properties_values() {
strlen(v) + 1 +
sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 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);