Blame SOURCES/jdk8269668-rh1977671-aarch64_lib_path_fix.patch

be8a6c
From ec03fdb752f2dc0833784a6877a4c232a8cdd9d2 Mon Sep 17 00:00:00 2001
be8a6c
From: Severin Gehwolf <sgehwolf@redhat.com>
be8a6c
Date: Wed, 14 Jul 2021 12:06:39 +0200
be8a6c
Subject: [PATCH] Backport e14801cdd9b108aa4ca47d0bc1dc67fca575764c
be8a6c
be8a6c
---
be8a6c
 src/hotspot/os/linux/os_linux.cpp | 7 +++++++
be8a6c
 1 file changed, 7 insertions(+)
be8a6c
be8a6c
diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp
be8a6c
index e8baf704e3a..12b75b733b5 100644
be8a6c
--- a/src/hotspot/os/linux/os_linux.cpp
be8a6c
+++ b/src/hotspot/os/linux/os_linux.cpp
be8a6c
@@ -413,8 +413,15 @@ void os::init_system_properties_values() {
be8a6c
   //        7: The default directories, normally /lib and /usr/lib.
be8a6c
 #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
be8a6c
   #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
be8a6c
+#else
be8a6c
+#if defined(AARCH64)
be8a6c
+  // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems
be8a6c
+  // might not adhere to the FHS and it would be a change in behaviour if we used
be8a6c
+  // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths.
be8a6c
+  #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64"
be8a6c
 #else
be8a6c
   #define DEFAULT_LIBPATH "/lib:/usr/lib"
be8a6c
+#endif // AARCH64
be8a6c
 #endif
be8a6c
 
be8a6c
 // Base path of extensions installed on the system.
be8a6c
-- 
be8a6c
2.31.1
be8a6c