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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
--- openjdk.orig/hotspot/make/linux/makefiles/sa.make
+++ openjdk/hotspot/make/linux/makefiles/sa.make
@@ -59,9 +59,12 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PowerPC, ARM or zero.
+# check for thread_db.h too (musl does not have it).
all:
- if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" \
+ if [ -d $(AGENT_DIR) \
+ -a -f /usr/include/thread_db.h \
+ -a "$(SRCARCH)" != "ia64" \
-a "$(SRCARCH)" != "arm" \
-a "$(SRCARCH)" != "ppc" \
-a "$(SRCARCH)" != "zero" ] ; then \
--- openjdk.orig/hotspot/make/linux/makefiles/saproc.make
+++ openjdk/hotspot/make/linux/makefiles/saproc.make
@@ -54,10 +54,13 @@
# if $(AGENT_DIR) does not exist, we don't build SA
# also, we don't build SA on Itanium, PPC, ARM or zero.
+# check for thread_db.h too (musl does not have it).
+ifneq ($(wildcard /usr/include/thread_db.h),)
ifneq ($(wildcard $(AGENT_DIR)),)
ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),)
BUILDLIBSAPROC = $(LIBSAPROC)
+endif
endif
endif
--- openjdk.orig/hotspot/make/linux/makefiles/defs.make
+++ openjdk/hotspot/make/linux/makefiles/defs.make
@@ -144,10 +144,17 @@
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
-ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
- $(EXPORT_LIB_DIR)/sa-jdi.jar
-ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
- $(EXPORT_LIB_DIR)/sa-jdi.jar
+# or if thread_db.h missing (musl)
+
+ifneq ($(wildcard /usr/include/thread_db.h),)
+SA_BINARY_LIST = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
+ $(EXPORT_LIB_DIR)/sa-jdi.jar
+else
+SA_BINARY_LIST =
+endif
+
+ADD_SA_BINARIES/x86 = $(SA_BINARY_LIST)
+ADD_SA_BINARIES/sparc = $(SA_BINARY_LIST)
ADD_SA_BINARIES/ppc =
ADD_SA_BINARIES/ia64 =
ADD_SA_BINARIES/arm =
|