Blame SOURCES/jdk8269668-rh1977671-aarch64_lib_path_fix.patch

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