Package: openjdk-11 / 11.0.28~3ea-1

hotspot-libpath.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- a/src/hotspot/os/linux/os_linux.cpp
+++ b/src/hotspot/os/linux/os_linux.cpp
@@ -430,18 +430,22 @@
   //        1: ...
   //        ...
   //        7: The default directories, normally /lib and /usr/lib.
+#ifdef DEB_MULTIARCH
+#define DEFAULT_LIBPATH	"/usr/lib/" DEB_MULTIARCH "/jni" ":/lib/" DEB_MULTIARCH ":/usr/lib/" DEB_MULTIARCH ":/usr/lib/jni:/lib:/usr/lib"
+#else
 #if defined(AMD64) || (defined(_LP64) && defined(SPARC)) || defined(PPC64) || defined(S390)
-  #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib"
+  #define DEFAULT_LIBPATH "/usr/lib64/jni:/usr/lib64:/lib64:/usr/lib/jni:/lib:/usr/lib"
 #else
 #if defined(AARCH64)
   // Use 32-bit locations first for AARCH64 (a 64-bit architecture), since some systems
   // might not adhere to the FHS and it would be a change in behaviour if we used
   // DEFAULT_LIBPATH of other 64-bit architectures which prefer the 64-bit paths.
-  #define DEFAULT_LIBPATH "/lib:/usr/lib:/usr/lib64:/lib64"
+  #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib:/usr/lib64/jni:/usr/lib64:/lib64"
 #else
-  #define DEFAULT_LIBPATH "/lib:/usr/lib"
+  #define DEFAULT_LIBPATH "/usr/lib/jni:/lib:/usr/lib"
 #endif // AARCH64
 #endif
+#endif
 
 // Base path of extensions installed on the system.
 #define SYS_EXT_DIR     "/usr/java/packages"
--- a/make/hotspot/lib/CompileJvm.gmk
+++ b/make/hotspot/lib/CompileJvm.gmk
@@ -84,6 +84,11 @@
 ################################################################################
 # Platform specific setup
 
+DEB_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null || true)
+ifneq (,$(DEB_MULTIARCH))
+  JVM_CFLAGS += -DDEB_MULTIARCH="\"$(DEB_MULTIARCH)\""
+endif
+
 # ARM source selection
 
 ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, arm)), true)