author | dcubed |
Fri, 23 Mar 2012 11:50:33 -0700 | |
changeset 12501 | ea7feae692ae |
parent 11721 | dcd1f62c9caf |
child 12767 | c9cd24c9142d |
permissions | -rw-r--r-- |
1 | 1 |
# |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
2 |
# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. |
|
8 |
# |
|
9 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
# accompanied this code). |
|
14 |
# |
|
15 |
# You should have received a copy of the GNU General Public License version |
|
16 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
# |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4493
diff
changeset
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4493
diff
changeset
|
20 |
# or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4493
diff
changeset
|
21 |
# questions. |
1 | 22 |
# |
23 |
# |
|
24 |
||
25 |
# Rules to build jvm_db/dtrace, used by vm.make |
|
26 |
||
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
27 |
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 |
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
28 |
# but not for CORE or KERNEL configurations. |
1 | 29 |
|
30 |
ifneq ("${TYPE}", "CORE") |
|
31 |
ifneq ("${TYPE}", "KERNEL") |
|
32 |
||
33 |
ifdef USE_GCC |
|
34 |
||
35 |
dtraceCheck: |
|
36 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds" |
|
37 |
||
38 |
else |
|
39 |
||
40 |
JVM_DB = libjvm_db |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
41 |
LIBJVM_DB = libjvm_db.so |
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
42 |
LIBJVM_DB_G = libjvm$(G_SUFFIX)_db.so |
1 | 43 |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
44 |
LIBJVM_DB_DEBUGINFO = libjvm_db.debuginfo |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
45 |
LIBJVM_DB_DIZ = libjvm_db.diz |
10559 | 46 |
LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
47 |
LIBJVM_DB_G_DIZ = libjvm$(G_SUFFIX)_db.diz |
10559 | 48 |
|
1 | 49 |
JVM_DTRACE = jvm_dtrace |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
50 |
LIBJVM_DTRACE = libjvm_dtrace.so |
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
51 |
LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so |
1 | 52 |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
53 |
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
54 |
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
10559 | 55 |
LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
56 |
LIBJVM_DTRACE_G_DIZ = libjvm$(G_SUFFIX)_dtrace.diz |
10559 | 57 |
|
1 | 58 |
JVMOFFS = JvmOffsets |
59 |
JVMOFFS.o = $(JVMOFFS).o |
|
60 |
GENOFFS = generate$(JVMOFFS) |
|
61 |
||
62 |
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace |
|
63 |
DTRACE = dtrace |
|
64 |
DTRACE.o = $(DTRACE).o |
|
65 |
||
66 |
# to remove '-g' option which causes link problems |
|
67 |
# also '-z nodefs' is used as workaround |
|
68 |
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';) |
|
69 |
||
70 |
ifdef LP64 |
|
71 |
DTRACE_OPTS = -64 -D_LP64 |
|
72 |
endif |
|
73 |
||
74 |
# making libjvm_db |
|
75 |
||
76 |
# Use mapfile with libjvm_db.so |
|
77 |
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db |
|
78 |
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE)) |
|
79 |
||
80 |
# Use mapfile with libjvm_dtrace.so |
|
81 |
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace |
|
82 |
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE)) |
|
83 |
||
84 |
ifdef USE_GCC |
|
85 |
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) |
|
86 |
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) |
|
87 |
else |
|
88 |
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
89 |
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl |
1 | 90 |
endif |
91 |
||
92 |
ISA = $(subst i386,i486,$(shell isainfo -n)) |
|
93 |
||
94 |
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so |
|
95 |
ifneq ("${ISA}","${BUILDARCH}") |
|
96 |
||
97 |
XLIBJVM_DB = 64/$(LIBJVM_DB) |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
98 |
XLIBJVM_DB_G = 64/$(LIBJVM_DB_G) |
1 | 99 |
XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
100 |
XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G) |
1 | 101 |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
102 |
XLIBJVM_DB_DEBUGINFO = 64/$(LIBJVM_DB_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
103 |
XLIBJVM_DB_DIZ = 64/$(LIBJVM_DB_DIZ) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
104 |
XLIBJVM_DB_G_DEBUGINFO = 64/$(LIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
105 |
XLIBJVM_DB_G_DIZ = 64/$(LIBJVM_DB_G_DIZ) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
106 |
XLIBJVM_DTRACE_DEBUGINFO = 64/$(LIBJVM_DTRACE_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
107 |
XLIBJVM_DTRACE_DIZ = 64/$(LIBJVM_DTRACE_DIZ) |
10559 | 108 |
XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO) |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
109 |
XLIBJVM_DTRACE_G_DIZ = 64/$(LIBJVM_DTRACE_G_DIZ) |
10559 | 110 |
|
1 | 111 |
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
112 |
@echo Making $@ |
|
113 |
$(QUIETLY) mkdir -p 64/ ; \ |
|
1552
45c617d33fa6
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
670
diff
changeset
|
114 |
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
1 | 115 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
116 |
[ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); } |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
117 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 118 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) |
119 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@ |
|
120 |
ifeq ($(STRIP_POLICY),all_strip) |
|
121 |
$(QUIETLY) $(STRIP) $@ |
|
122 |
else |
|
123 |
ifeq ($(STRIP_POLICY),min_strip) |
|
124 |
$(QUIETLY) $(STRIP) -x $@ |
|
125 |
# implied else here is no stripping at all |
|
126 |
endif |
|
127 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
128 |
[ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
129 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
130 |
$(ZIPEXE) -q -y $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
131 |
$(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
132 |
[ -f $(XLIBJVM_DB_G_DIZ) ] || { ln -s $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_G_DIZ); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
133 |
endif |
10559 | 134 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
135 |
|
1 | 136 |
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
137 |
@echo Making $@ |
|
138 |
$(QUIETLY) mkdir -p 64/ ; \ |
|
1552
45c617d33fa6
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
670
diff
changeset
|
139 |
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
1 | 140 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
141 |
[ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); } |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
142 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 143 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) |
144 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@ |
|
145 |
ifeq ($(STRIP_POLICY),all_strip) |
|
146 |
$(QUIETLY) $(STRIP) $@ |
|
147 |
else |
|
148 |
ifeq ($(STRIP_POLICY),min_strip) |
|
149 |
$(QUIETLY) $(STRIP) -x $@ |
|
150 |
# implied else here is no stripping at all |
|
151 |
endif |
|
152 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
153 |
[ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
154 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
155 |
$(ZIPEXE) -q -y $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
156 |
$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
157 |
[ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { ln -s $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_G_DIZ); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
158 |
endif |
10559 | 159 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
160 |
|
1 | 161 |
endif # ifneq ("${ISA}","${BUILDARCH}") |
162 |
||
163 |
ifdef USE_GCC |
|
164 |
LFLAGS_GENOFFS += -D_REENTRANT |
|
165 |
else |
|
166 |
LFLAGS_GENOFFS += -mt -xnolib -norunpath |
|
167 |
endif |
|
168 |
||
169 |
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ |
|
7397 | 170 |
$(LIBJVM.o) |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
171 |
$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
1 | 172 |
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
173 |
||
174 |
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
175 |
$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
1 | 176 |
./lib$(GENOFFS).so |
177 |
||
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
178 |
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
179 |
cmp -s $@ $@.tmp; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
180 |
case $$? in \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
181 |
0) rm -f $@.tmp;; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
182 |
*) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
183 |
esac |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
184 |
|
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
185 |
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
1 | 186 |
$(JVMOFFS).h: $(GENOFFS) |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
187 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
188 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 189 |
|
190 |
$(JVMOFFS)Index.h: $(GENOFFS) |
|
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
191 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
192 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 193 |
|
194 |
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h |
|
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
195 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
196 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 197 |
|
198 |
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
199 |
$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
1 | 200 |
|
201 |
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
|
202 |
@echo Making $@ |
|
203 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ |
|
204 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
205 |
[ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); } |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
206 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 207 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) |
208 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
|
209 |
ifeq ($(STRIP_POLICY),all_strip) |
|
210 |
$(QUIETLY) $(STRIP) $@ |
|
211 |
else |
|
212 |
ifeq ($(STRIP_POLICY),min_strip) |
|
213 |
$(QUIETLY) $(STRIP) -x $@ |
|
214 |
# implied else here is no stripping at all |
|
215 |
endif |
|
216 |
endif |
|
217 |
[ -f $(LIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO); } |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
218 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
219 |
$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
220 |
$(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
221 |
[ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
222 |
endif |
10559 | 223 |
endif |
1 | 224 |
|
225 |
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
|
226 |
@echo Making $@ |
|
227 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ |
|
228 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
229 |
[ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); } |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
230 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 231 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) |
232 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
|
233 |
ifeq ($(STRIP_POLICY),all_strip) |
|
234 |
$(QUIETLY) $(STRIP) $@ |
|
235 |
else |
|
236 |
ifeq ($(STRIP_POLICY),min_strip) |
|
237 |
$(QUIETLY) $(STRIP) -x $@ |
|
238 |
# implied else here is no stripping at all |
|
239 |
endif |
|
240 |
endif |
|
241 |
[ -f $(LIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO); } |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
242 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
243 |
$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
244 |
$(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
245 |
[ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); } |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
246 |
endif |
10559 | 247 |
endif |
1 | 248 |
|
249 |
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ |
|
250 |
$(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d |
|
251 |
$(QUIETLY) cat $^ > $@ |
|
252 |
||
7397 | 253 |
DTraced_Files = ciEnv.o \ |
254 |
classLoadingService.o \ |
|
255 |
compileBroker.o \ |
|
256 |
hashtable.o \ |
|
257 |
instanceKlass.o \ |
|
258 |
java.o \ |
|
259 |
jni.o \ |
|
260 |
jvm.o \ |
|
261 |
memoryManager.o \ |
|
262 |
nmethod.o \ |
|
263 |
objectMonitor.o \ |
|
264 |
runtimeService.o \ |
|
265 |
sharedRuntime.o \ |
|
266 |
synchronizer.o \ |
|
267 |
thread.o \ |
|
268 |
unsafe.o \ |
|
269 |
vmThread.o \ |
|
270 |
vmCMSOperations.o \ |
|
271 |
vmPSOperations.o \ |
|
272 |
vmGCOperations.o \ |
|
273 |
||
1 | 274 |
# Dtrace is available, so we build $(DTRACE.o) |
275 |
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) |
|
276 |
@echo Compiling $(DTRACE).d |
|
277 |
||
6469
d32518d9eba5
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
5547
diff
changeset
|
278 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
1 | 279 |
$(DTraced_Files) ||\ |
280 |
STATUS=$$?;\ |
|
281 |
if [ x"$$STATUS" = x"1" -a \ |
|
282 |
x`uname -r` = x"5.10" -a \ |
|
283 |
x`uname -p` = x"sparc" ]; then\ |
|
284 |
echo "*****************************************************************";\ |
|
285 |
echo "* If you are building server compiler, and the error message is ";\ |
|
286 |
echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ |
|
287 |
echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ |
|
288 |
echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ |
|
289 |
echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ |
|
290 |
echo "* dtrace probes for this build.";\ |
|
291 |
echo "*****************************************************************";\ |
|
292 |
fi;\ |
|
293 |
exit $$STATUS |
|
294 |
# Since some DTraced_Files are in LIBJVM.o and they are touched by this |
|
295 |
# command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will |
|
296 |
# think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets* |
|
297 |
# files, but it doesn't, so we touch the necessary files to prevent later |
|
298 |
# recompilation. Note: we only touch the necessary files if they already |
|
299 |
# exist in order to close a race where an empty file can be created |
|
300 |
# before the real build rule is executed. |
|
301 |
# But, we can't touch the *.h files: This rule depends |
|
302 |
# on them, and that would cause an infinite cycle of rebuilding. |
|
303 |
# Neither the *.h or *.ccp files need to be touched, since they have |
|
304 |
# rules which do not update them when the generator file has not |
|
305 |
# changed their contents. |
|
306 |
$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi |
|
307 |
$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi |
|
308 |
$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi |
|
309 |
||
310 |
.PHONY: dtraceCheck |
|
311 |
||
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
312 |
SYSTEM_DTRACE_H = /usr/include/dtrace.h |
1 | 313 |
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
314 |
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace |
|
315 |
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) |
|
316 |
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) |
|
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
317 |
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
318 |
|
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
319 |
ifneq ("$(systemDtraceHdrFound)", "") |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
320 |
CFLAGS += -DHAVE_DTRACE_H |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
321 |
endif |
1 | 322 |
|
323 |
ifneq ("$(patchDtraceFound)", "") |
|
324 |
DTRACE_PROG=$(PATCH_DTRACE_PROG) |
|
325 |
DTRACE_INCL=-I/opt/SUNWdtrd/include |
|
326 |
else |
|
327 |
ifneq ("$(systemDtraceFound)", "") |
|
328 |
DTRACE_PROG=$(SYSTEM_DTRACE_PROG) |
|
329 |
else |
|
330 |
||
331 |
endif # ifneq ("$(systemDtraceFound)", "") |
|
332 |
endif # ifneq ("$(patchDtraceFound)", "") |
|
333 |
||
334 |
ifneq ("${DTRACE_PROG}", "") |
|
335 |
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
336 |
||
337 |
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) |
|
338 |
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED |
|
339 |
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) |
|
340 |
||
341 |
dtraceCheck: |
|
342 |
||
343 |
else # manually disabled |
|
344 |
||
345 |
dtraceCheck: |
|
346 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable" |
|
347 |
||
348 |
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
349 |
||
350 |
else # No dtrace program found |
|
351 |
||
352 |
dtraceCheck: |
|
353 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system" |
|
354 |
||
355 |
endif # ifneq ("${dtraceFound}", "") |
|
356 |
||
357 |
endif # ifdef USE_GCC |
|
358 |
||
359 |
else # KERNEL build |
|
360 |
||
361 |
dtraceCheck: |
|
362 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" |
|
363 |
||
364 |
endif # ifneq ("${TYPE}", "KERNEL") |
|
365 |
||
366 |
else # CORE build |
|
367 |
||
368 |
dtraceCheck: |
|
369 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds" |
|
370 |
||
371 |
endif # ifneq ("${TYPE}", "CORE") |