1From 83f97773ea99fe2191a49e551ea43d51c9a765cd Mon Sep 17 00:00:00 2001
2Subject: [PATCH] strip some hard-coded default paths for libs and extensions
3
4---
5 src/hotspot/os/linux/os_linux.cpp | 12 ++++++------
6 1 file changed, 6 insertions(+), 6 deletions(-)
7
8diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
9index 476b1c2175..2695ed2301 100644
10--- a/src/hotspot/os/linux/os_linux.cpp
11+++ b/src/hotspot/os/linux/os_linux.cpp
12@@ -417,20 +417,20 @@ void os::init_system_properties_values() {
13 // ...
14 // 7: The default directories, normally /lib and /usr/lib.
15 #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
16- #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
17+ #define DEFAULT_LIBPATH ""
18 #else
19 #if defined(AARCH64)
20 // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems
21 // might not adhere to the FHS and it would be a change in behaviour if we used
22 // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths.
23- #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64"
24+ #define DEFAULT_LIBPATH ""
25 #else
26- #define DEFAULT_LIBPATH "/lib:/usr/lib"
27+ #define DEFAULT_LIBPATH ""
28 #endif // AARCH64
29 #endif
30
31 // Base path of extensions installed on the system.
32-#define SYS_EXT_DIR "/usr/java/packages"
33+#define SYS_EXT_DIR ""
34 #define EXTENSIONS_DIR "/lib/ext"
35
36 // Buffer that fits several sprintfs.
37@@ -490,13 +490,13 @@ void os::init_system_properties_values() {
38 strlen(v) + 1 +
39 sizeof(SYS_EXT_DIR) + sizeof("/lib/") + sizeof(DEFAULT_LIBPATH) + 1,
40 mtInternal);
41- sprintf(ld_library_path, "%s%s" SYS_EXT_DIR "/lib:" DEFAULT_LIBPATH, v, v_colon);
42+ sprintf(ld_library_path, "%s", v);
43 Arguments::set_library_path(ld_library_path);
44 FREE_C_HEAP_ARRAY(char, ld_library_path);
45 }
46
47 // Extensions directories.
48- sprintf(buf, "%s" EXTENSIONS_DIR ":" SYS_EXT_DIR EXTENSIONS_DIR, Arguments::get_java_home());
49+ sprintf(buf, "%s" EXTENSIONS_DIR, Arguments::get_java_home());
50 Arguments::set_ext_dirs(buf);
51
52 FREE_C_HEAP_ARRAY(char, buf);
53--
542.35.1
55