1 $NetBSD: patch-hotspot_make_solaris_makefiles_dtrace.make,v 1.2 2017/12/15 14:27:52 jperkin Exp $
3 Enable DTrace support with GCC.
5 --- hotspot/make/solaris/makefiles/dtrace.make.orig 2017-11-28 00:13:38.000000000 +0000
6 +++ hotspot/make/solaris/makefiles/dtrace.make
9 ifneq ("${TYPE}", "CORE")
14 - $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds"
19 LIBJVM_DB = libjvm_db.so
21 @@ -56,14 +49,23 @@ DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Pla
23 DTRACE.o = $(DTRACE).o
25 -# to remove '-g' option which causes link problems
26 -# also '-z nodefs' is used as workaround
27 -GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
29 + # solaris linker does not like gcc and -fvisibility=hidden without mapfiles
30 + GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g' -e 's/ -fvisibility=hidden / /g';)
32 + # to remove '-g' option which causes link problems
33 + # also '-z nodefs' is used as workaround
34 + GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';)
38 DTRACE_OPTS = -64 -D_LP64
42 + DTRACE_OPTS = -D_GNU_SOURCE
47 # Use mapfile with libjvm_db.so
48 @@ -99,7 +101,7 @@ XLIBJVM_DTRACE_DIZ = $(XLIBJVM_D
49 $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
51 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
52 - $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
53 + $(CC) $(CFLAGS) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
54 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
55 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
56 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
57 @@ -125,7 +127,7 @@ endif
58 $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
60 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
61 - $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
62 + $(CC) $(CFLAGS) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
63 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
64 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
65 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
66 @@ -190,7 +192,7 @@ $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cp
68 $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
70 - $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
71 + $(QUIETLY) $(CC) $(CFLAGS) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
72 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
73 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
74 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
75 @@ -211,7 +213,7 @@ endif
77 $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
79 - $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
80 + $(QUIETLY) $(CC) $(CFLAGS) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \
81 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
82 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
83 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
84 @@ -352,8 +354,6 @@ dtraceCheck:
86 endif # ifneq ("${dtraceFound}", "")
88 -endif # ifdef USE_GCC