author | katleman |
Wed, 13 Jun 2012 16:53:25 -0700 | |
changeset 12906 | d382060bd755 |
parent 12767 | c9cd24c9142d |
child 13092 | 3b4aad065f27 |
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 |
|
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
111 |
$(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
1 | 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) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
118 |
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
119 |
# Clear the SHF_ALLOC flag (if set) from empty section headers. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
120 |
# An empty section header has sh_addr == 0 and sh_size == 0. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
121 |
# This problem has only been seen on Solaris X64, but we call this tool |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
122 |
# on all Solaris builds just in case. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
123 |
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
10559 | 124 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
125 |
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
126 |
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
127 |
# $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@ |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
128 |
$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DB_DEBUGINFO) $@ |
10559 | 129 |
ifeq ($(STRIP_POLICY),all_strip) |
130 |
$(QUIETLY) $(STRIP) $@ |
|
131 |
else |
|
132 |
ifeq ($(STRIP_POLICY),min_strip) |
|
133 |
$(QUIETLY) $(STRIP) -x $@ |
|
134 |
# implied else here is no stripping at all |
|
135 |
endif |
|
136 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
137 |
[ -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
|
138 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
139 |
$(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
|
140 |
$(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
141 |
[ -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
|
142 |
endif |
10559 | 143 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
144 |
|
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
145 |
$(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
1 | 146 |
@echo Making $@ |
147 |
$(QUIETLY) mkdir -p 64/ ; \ |
|
1552
45c617d33fa6
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
670
diff
changeset
|
148 |
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
1 | 149 |
$(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
|
150 |
[ -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
|
151 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
152 |
# Clear the SHF_ALLOC flag (if set) from empty section headers. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
153 |
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
10559 | 154 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
155 |
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
156 |
# $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@ |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
157 |
$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DTRACE_DEBUGINFO) $@ |
10559 | 158 |
ifeq ($(STRIP_POLICY),all_strip) |
159 |
$(QUIETLY) $(STRIP) $@ |
|
160 |
else |
|
161 |
ifeq ($(STRIP_POLICY),min_strip) |
|
162 |
$(QUIETLY) $(STRIP) -x $@ |
|
163 |
# implied else here is no stripping at all |
|
164 |
endif |
|
165 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
166 |
[ -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
|
167 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
168 |
$(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
|
169 |
$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
170 |
[ -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
|
171 |
endif |
10559 | 172 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
173 |
|
1 | 174 |
endif # ifneq ("${ISA}","${BUILDARCH}") |
175 |
||
176 |
ifdef USE_GCC |
|
177 |
LFLAGS_GENOFFS += -D_REENTRANT |
|
178 |
else |
|
179 |
LFLAGS_GENOFFS += -mt -xnolib -norunpath |
|
180 |
endif |
|
181 |
||
182 |
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ |
|
7397 | 183 |
$(LIBJVM.o) |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
184 |
$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
1 | 185 |
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
186 |
||
187 |
$(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
|
188 |
$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
1 | 189 |
./lib$(GENOFFS).so |
190 |
||
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
191 |
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
192 |
cmp -s $@ $@.tmp; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
193 |
case $$? in \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
194 |
0) rm -f $@.tmp;; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
195 |
*) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
196 |
esac |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
197 |
|
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
198 |
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
1 | 199 |
$(JVMOFFS).h: $(GENOFFS) |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
200 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
201 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 202 |
|
203 |
$(JVMOFFS)Index.h: $(GENOFFS) |
|
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
204 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
205 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 206 |
|
207 |
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h |
|
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
208 |
$(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp |
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
209 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 210 |
|
211 |
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
212 |
$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
1 | 213 |
|
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
214 |
$(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
1 | 215 |
@echo Making $@ |
216 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ |
|
217 |
$(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
|
218 |
[ -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
|
219 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
220 |
# Clear the SHF_ALLOC flag (if set) from empty section headers. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
221 |
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
10559 | 222 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
223 |
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
224 |
# $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
225 |
$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@ |
10559 | 226 |
ifeq ($(STRIP_POLICY),all_strip) |
227 |
$(QUIETLY) $(STRIP) $@ |
|
228 |
else |
|
229 |
ifeq ($(STRIP_POLICY),min_strip) |
|
230 |
$(QUIETLY) $(STRIP) -x $@ |
|
231 |
# implied else here is no stripping at all |
|
232 |
endif |
|
233 |
endif |
|
234 |
[ -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
|
235 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
236 |
$(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
|
237 |
$(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
238 |
[ -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
|
239 |
endif |
10559 | 240 |
endif |
1 | 241 |
|
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
242 |
$(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
1 | 243 |
@echo Making $@ |
244 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ |
|
245 |
$(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
|
246 |
[ -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
|
247 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
248 |
# Clear the SHF_ALLOC flag (if set) from empty section headers. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
249 |
$(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
10559 | 250 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) |
12767
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
251 |
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
252 |
# $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
c9cd24c9142d
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
12501
diff
changeset
|
253 |
$(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@ |
10559 | 254 |
ifeq ($(STRIP_POLICY),all_strip) |
255 |
$(QUIETLY) $(STRIP) $@ |
|
256 |
else |
|
257 |
ifeq ($(STRIP_POLICY),min_strip) |
|
258 |
$(QUIETLY) $(STRIP) -x $@ |
|
259 |
# implied else here is no stripping at all |
|
260 |
endif |
|
261 |
endif |
|
262 |
[ -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
|
263 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
264 |
$(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
|
265 |
$(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
266 |
[ -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
|
267 |
endif |
10559 | 268 |
endif |
1 | 269 |
|
270 |
$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ |
|
271 |
$(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d |
|
272 |
$(QUIETLY) cat $^ > $@ |
|
273 |
||
7397 | 274 |
DTraced_Files = ciEnv.o \ |
275 |
classLoadingService.o \ |
|
276 |
compileBroker.o \ |
|
277 |
hashtable.o \ |
|
278 |
instanceKlass.o \ |
|
279 |
java.o \ |
|
280 |
jni.o \ |
|
281 |
jvm.o \ |
|
282 |
memoryManager.o \ |
|
283 |
nmethod.o \ |
|
284 |
objectMonitor.o \ |
|
285 |
runtimeService.o \ |
|
286 |
sharedRuntime.o \ |
|
287 |
synchronizer.o \ |
|
288 |
thread.o \ |
|
289 |
unsafe.o \ |
|
290 |
vmThread.o \ |
|
291 |
vmCMSOperations.o \ |
|
292 |
vmPSOperations.o \ |
|
293 |
vmGCOperations.o \ |
|
294 |
||
1 | 295 |
# Dtrace is available, so we build $(DTRACE.o) |
296 |
$(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) |
|
297 |
@echo Compiling $(DTRACE).d |
|
298 |
||
6469
d32518d9eba5
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
5547
diff
changeset
|
299 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
1 | 300 |
$(DTraced_Files) ||\ |
301 |
STATUS=$$?;\ |
|
302 |
if [ x"$$STATUS" = x"1" -a \ |
|
303 |
x`uname -r` = x"5.10" -a \ |
|
304 |
x`uname -p` = x"sparc" ]; then\ |
|
305 |
echo "*****************************************************************";\ |
|
306 |
echo "* If you are building server compiler, and the error message is ";\ |
|
307 |
echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ |
|
308 |
echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ |
|
309 |
echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ |
|
310 |
echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ |
|
311 |
echo "* dtrace probes for this build.";\ |
|
312 |
echo "*****************************************************************";\ |
|
313 |
fi;\ |
|
314 |
exit $$STATUS |
|
315 |
# Since some DTraced_Files are in LIBJVM.o and they are touched by this |
|
316 |
# command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will |
|
317 |
# think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets* |
|
318 |
# files, but it doesn't, so we touch the necessary files to prevent later |
|
319 |
# recompilation. Note: we only touch the necessary files if they already |
|
320 |
# exist in order to close a race where an empty file can be created |
|
321 |
# before the real build rule is executed. |
|
322 |
# But, we can't touch the *.h files: This rule depends |
|
323 |
# on them, and that would cause an infinite cycle of rebuilding. |
|
324 |
# Neither the *.h or *.ccp files need to be touched, since they have |
|
325 |
# rules which do not update them when the generator file has not |
|
326 |
# changed their contents. |
|
327 |
$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi |
|
328 |
$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi |
|
329 |
$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi |
|
330 |
||
331 |
.PHONY: dtraceCheck |
|
332 |
||
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
333 |
SYSTEM_DTRACE_H = /usr/include/dtrace.h |
1 | 334 |
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
335 |
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace |
|
336 |
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) |
|
337 |
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) |
|
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
338 |
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
339 |
|
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
340 |
ifneq ("$(systemDtraceHdrFound)", "") |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
341 |
CFLAGS += -DHAVE_DTRACE_H |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
342 |
endif |
1 | 343 |
|
344 |
ifneq ("$(patchDtraceFound)", "") |
|
345 |
DTRACE_PROG=$(PATCH_DTRACE_PROG) |
|
346 |
DTRACE_INCL=-I/opt/SUNWdtrd/include |
|
347 |
else |
|
348 |
ifneq ("$(systemDtraceFound)", "") |
|
349 |
DTRACE_PROG=$(SYSTEM_DTRACE_PROG) |
|
350 |
else |
|
351 |
||
352 |
endif # ifneq ("$(systemDtraceFound)", "") |
|
353 |
endif # ifneq ("$(patchDtraceFound)", "") |
|
354 |
||
355 |
ifneq ("${DTRACE_PROG}", "") |
|
356 |
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
357 |
||
358 |
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) |
|
359 |
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED |
|
360 |
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) |
|
361 |
||
362 |
dtraceCheck: |
|
363 |
||
364 |
else # manually disabled |
|
365 |
||
366 |
dtraceCheck: |
|
367 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable" |
|
368 |
||
369 |
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
370 |
||
371 |
else # No dtrace program found |
|
372 |
||
373 |
dtraceCheck: |
|
374 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system" |
|
375 |
||
376 |
endif # ifneq ("${dtraceFound}", "") |
|
377 |
||
378 |
endif # ifdef USE_GCC |
|
379 |
||
380 |
else # KERNEL build |
|
381 |
||
382 |
dtraceCheck: |
|
383 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" |
|
384 |
||
385 |
endif # ifneq ("${TYPE}", "KERNEL") |
|
386 |
||
387 |
else # CORE build |
|
388 |
||
389 |
dtraceCheck: |
|
390 |
$(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds" |
|
391 |
||
392 |
endif # ifneq ("${TYPE}", "CORE") |