author | erikj |
Wed, 14 Jan 2015 15:57:59 +0100 | |
changeset 28613 | b78d7c133e56 |
parent 27657 | f4fcaa1bb2d4 |
child 28947 | 2ea471384931 |
permissions | -rw-r--r-- |
1 | 1 |
# |
26179 | 2 |
# Copyright (c) 2005, 2014, 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 |
15432 | 28 |
# but not for CORE configuration. |
1 | 29 |
|
30 |
ifneq ("${TYPE}", "CORE") |
|
31 |
||
32 |
ifdef USE_GCC |
|
33 |
||
34 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
35 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled for gcc builds" |
1 | 36 |
|
37 |
else |
|
38 |
||
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
39 |
DtraceOutDir = $(GENERATED)/dtracefiles |
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
40 |
|
1 | 41 |
JVM_DB = libjvm_db |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
42 |
LIBJVM_DB = libjvm_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 |
|
1 | 47 |
JVM_DTRACE = jvm_dtrace |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
48 |
LIBJVM_DTRACE = libjvm_dtrace.so |
1 | 49 |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
50 |
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo |
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
51 |
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
10559 | 52 |
|
1 | 53 |
JVMOFFS = JvmOffsets |
54 |
JVMOFFS.o = $(JVMOFFS).o |
|
55 |
GENOFFS = generate$(JVMOFFS) |
|
56 |
||
57 |
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace |
|
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
58 |
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace |
1 | 59 |
DTRACE = dtrace |
60 |
DTRACE.o = $(DTRACE).o |
|
26179 | 61 |
DTRACE_JHELPER = dtrace_jhelper |
62 |
DTRACE_JHELPER.o = $(DTRACE_JHELPER).o |
|
1 | 63 |
|
64 |
# to remove '-g' option which causes link problems |
|
65 |
# also '-z nodefs' is used as workaround |
|
66 |
GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';) |
|
67 |
||
68 |
ifdef LP64 |
|
69 |
DTRACE_OPTS = -64 -D_LP64 |
|
70 |
endif |
|
71 |
||
72 |
# making libjvm_db |
|
73 |
||
74 |
# Use mapfile with libjvm_db.so |
|
75 |
LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db |
|
76 |
LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE)) |
|
77 |
||
78 |
# Use mapfile with libjvm_dtrace.so |
|
79 |
LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace |
|
80 |
LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE)) |
|
81 |
||
82 |
ifdef USE_GCC |
|
83 |
LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) |
|
84 |
LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) |
|
85 |
else |
|
86 |
LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib |
|
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
87 |
LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl |
1 | 88 |
endif |
89 |
||
90 |
ISA = $(subst i386,i486,$(shell isainfo -n)) |
|
91 |
||
92 |
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so |
|
93 |
ifneq ("${ISA}","${BUILDARCH}") |
|
94 |
||
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
95 |
XLIBJVM_DIR = 64 |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
96 |
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB) |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
97 |
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE) |
1 | 98 |
|
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
99 |
XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO) |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
100 |
XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ) |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
101 |
XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO) |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
102 |
XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ) |
10559 | 103 |
|
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
104 |
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
105 |
@echo $(LOG_INFO) Making $@ |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
106 |
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
1552
45c617d33fa6
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
670
diff
changeset
|
107 |
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
1 | 108 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
109 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 110 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
111 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
112 |
# in the link name: |
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
113 |
( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) |
10559 | 114 |
ifeq ($(STRIP_POLICY),all_strip) |
115 |
$(QUIETLY) $(STRIP) $@ |
|
116 |
else |
|
117 |
ifeq ($(STRIP_POLICY),min_strip) |
|
118 |
$(QUIETLY) $(STRIP) -x $@ |
|
119 |
# implied else here is no stripping at all |
|
120 |
endif |
|
121 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
122 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
123 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
124 |
# in the archived name: |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
125 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) ) |
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
126 |
$(RM) $(XLIBJVM_DB_DEBUGINFO) |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
127 |
endif |
10559 | 128 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
129 |
|
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
130 |
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
131 |
@echo $(LOG_INFO) Making $@ |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
132 |
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
1552
45c617d33fa6
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
670
diff
changeset
|
133 |
$(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
1 | 134 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
135 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 136 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
137 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
138 |
# in the link name: |
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
139 |
( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) |
10559 | 140 |
ifeq ($(STRIP_POLICY),all_strip) |
141 |
$(QUIETLY) $(STRIP) $@ |
|
142 |
else |
|
143 |
ifeq ($(STRIP_POLICY),min_strip) |
|
144 |
$(QUIETLY) $(STRIP) -x $@ |
|
145 |
# implied else here is no stripping at all |
|
146 |
endif |
|
147 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
148 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
13092
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
149 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
3b4aad065f27
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
12767
diff
changeset
|
150 |
# in the archived name: |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
151 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO)) |
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
152 |
$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
153 |
endif |
10559 | 154 |
endif |
4493
9204129f065e
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
1562
diff
changeset
|
155 |
|
1 | 156 |
endif # ifneq ("${ISA}","${BUILDARCH}") |
157 |
||
158 |
ifdef USE_GCC |
|
159 |
LFLAGS_GENOFFS += -D_REENTRANT |
|
160 |
else |
|
161 |
LFLAGS_GENOFFS += -mt -xnolib -norunpath |
|
162 |
endif |
|
163 |
||
164 |
lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ |
|
7397 | 165 |
$(LIBJVM.o) |
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
166 |
$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
1 | 167 |
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
168 |
||
169 |
$(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
|
170 |
$(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
1 | 171 |
./lib$(GENOFFS).so |
172 |
||
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
173 |
CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
28613
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
27657
diff
changeset
|
174 |
if cmp -s $@ $@.tmp; then \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
27657
diff
changeset
|
175 |
rm -f $@.tmp; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
27657
diff
changeset
|
176 |
else \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
27657
diff
changeset
|
177 |
rm -f $@ && mv $@.tmp $@ && echo Updated $@; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
27657
diff
changeset
|
178 |
fi |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
179 |
|
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
180 |
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
1 | 181 |
$(JVMOFFS).h: $(GENOFFS) |
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
13115
diff
changeset
|
182 |
$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
183 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 184 |
|
185 |
$(JVMOFFS)Index.h: $(GENOFFS) |
|
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
13115
diff
changeset
|
186 |
$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
187 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 188 |
|
189 |
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h |
|
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
13115
diff
changeset
|
190 |
$(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp |
1559
20339a90049b
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
670
diff
changeset
|
191 |
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
1 | 192 |
|
193 |
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10559
diff
changeset
|
194 |
$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
1 | 195 |
|
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
196 |
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
197 |
@echo $(LOG_INFO) Making $@ |
1 | 198 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ |
199 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
200 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 201 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) |
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
202 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
10559 | 203 |
ifeq ($(STRIP_POLICY),all_strip) |
204 |
$(QUIETLY) $(STRIP) $@ |
|
205 |
else |
|
206 |
ifeq ($(STRIP_POLICY),min_strip) |
|
207 |
$(QUIETLY) $(STRIP) -x $@ |
|
208 |
# implied else here is no stripping at all |
|
209 |
endif |
|
210 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
211 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
212 |
$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) |
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
213 |
$(RM) $(LIBJVM_DB_DEBUGINFO) |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
214 |
endif |
10559 | 215 |
endif |
1 | 216 |
|
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
217 |
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
218 |
@echo $(LOG_INFO) Making $@ |
1 | 219 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ |
220 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
221 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
10559 | 222 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) |
27657
f4fcaa1bb2d4
8033602: wrong stabs data in libjvm.debuginfo on JDK 8 - SPARC
dcubed
parents:
26691
diff
changeset
|
223 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
10559 | 224 |
ifeq ($(STRIP_POLICY),all_strip) |
225 |
$(QUIETLY) $(STRIP) $@ |
|
226 |
else |
|
227 |
ifeq ($(STRIP_POLICY),min_strip) |
|
228 |
$(QUIETLY) $(STRIP) -x $@ |
|
229 |
# implied else here is no stripping at all |
|
230 |
endif |
|
231 |
endif |
|
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
232 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
233 |
$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) |
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13966
diff
changeset
|
234 |
$(RM) $(LIBJVM_DTRACE_DEBUGINFO) |
12501
ea7feae692ae
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
11721
diff
changeset
|
235 |
endif |
10559 | 236 |
endif |
1 | 237 |
|
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
238 |
$(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \ |
26179 | 239 |
$(DTRACE_COMMON_SRCDIR)/hs_private.d |
240 |
$(QUIETLY) cat $^ > $@ |
|
241 |
||
242 |
$(DTRACE_JHELPER).d: $(DTRACE_SRCDIR)/jhelper.d |
|
1 | 243 |
$(QUIETLY) cat $^ > $@ |
244 |
||
7397 | 245 |
DTraced_Files = ciEnv.o \ |
246 |
classLoadingService.o \ |
|
247 |
compileBroker.o \ |
|
248 |
hashtable.o \ |
|
249 |
instanceKlass.o \ |
|
250 |
java.o \ |
|
251 |
jni.o \ |
|
252 |
jvm.o \ |
|
253 |
memoryManager.o \ |
|
254 |
nmethod.o \ |
|
255 |
objectMonitor.o \ |
|
256 |
runtimeService.o \ |
|
257 |
sharedRuntime.o \ |
|
258 |
synchronizer.o \ |
|
259 |
thread.o \ |
|
260 |
unsafe.o \ |
|
261 |
vmThread.o \ |
|
262 |
vmCMSOperations.o \ |
|
263 |
vmPSOperations.o \ |
|
264 |
vmGCOperations.o \ |
|
265 |
||
1 | 266 |
# Dtrace is available, so we build $(DTRACE.o) |
26179 | 267 |
$(DTRACE.o): $(DTRACE).d $(DTraced_Files) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
268 |
@echo $(LOG_INFO) Compiling $(DTRACE).d |
1 | 269 |
|
6469
d32518d9eba5
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
5547
diff
changeset
|
270 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
1 | 271 |
$(DTraced_Files) ||\ |
272 |
STATUS=$$?;\ |
|
19271
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
273 |
if [ x"$$STATUS" = x"1" ]; then \ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
274 |
if [ x`uname -r` = x"5.10" -a \ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
275 |
x`uname -p` = x"sparc" ]; then\ |
1 | 276 |
echo "*****************************************************************";\ |
277 |
echo "* If you are building server compiler, and the error message is ";\ |
|
278 |
echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ |
|
279 |
echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ |
|
280 |
echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ |
|
281 |
echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ |
|
282 |
echo "* dtrace probes for this build.";\ |
|
283 |
echo "*****************************************************************";\ |
|
19271
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
284 |
elif [ x`uname -r` = x"5.10" ]; then\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
285 |
echo "*****************************************************************";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
286 |
echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
287 |
echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
288 |
echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
289 |
echo "* to disable dtrace probes for this build.";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
290 |
echo "*****************************************************************";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
291 |
else \ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
292 |
echo "*****************************************************************";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
293 |
echo "* If you cannot fix dtrace build issues, try to ";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
294 |
echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
295 |
echo "* to disable dtrace probes for this build.";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
296 |
echo "*****************************************************************";\ |
2bd33030dd6d
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
15432
diff
changeset
|
297 |
fi; \ |
1 | 298 |
fi;\ |
299 |
exit $$STATUS |
|
300 |
# Since some DTraced_Files are in LIBJVM.o and they are touched by this |
|
301 |
# command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will |
|
302 |
# think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets* |
|
303 |
# files, but it doesn't, so we touch the necessary files to prevent later |
|
304 |
# recompilation. Note: we only touch the necessary files if they already |
|
305 |
# exist in order to close a race where an empty file can be created |
|
306 |
# before the real build rule is executed. |
|
307 |
# But, we can't touch the *.h files: This rule depends |
|
308 |
# on them, and that would cause an infinite cycle of rebuilding. |
|
309 |
# Neither the *.h or *.ccp files need to be touched, since they have |
|
310 |
# rules which do not update them when the generator file has not |
|
311 |
# changed their contents. |
|
312 |
$(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi |
|
313 |
$(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi |
|
314 |
$(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi |
|
315 |
||
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
316 |
|
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
317 |
$(DtraceOutDir): |
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
318 |
mkdir $(DtraceOutDir) |
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
319 |
|
26179 | 320 |
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir) |
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
321 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d |
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
322 |
|
26179 | 323 |
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) |
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
324 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d |
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
325 |
|
26179 | 326 |
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir) |
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
327 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d |
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
328 |
|
26179 | 329 |
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h |
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
330 |
|
26179 | 331 |
# The jhelper.d and hotspot probes are separated into two different SUNW_dof sections. |
332 |
# Now the jhelper.d is built without the -Xlazyload flag. |
|
333 |
$(DTRACE_JHELPER.o) : $(DTRACE_JHELPER).d $(JVMOFFS).h $(JVMOFFS)Index.h |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
334 |
@echo $(LOG_INFO) Compiling $(DTRACE_JHELPER).d |
26179 | 335 |
$(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -o $@ -s $(DTRACE_JHELPER).d |
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
19271
diff
changeset
|
336 |
|
1 | 337 |
.PHONY: dtraceCheck |
338 |
||
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
339 |
SYSTEM_DTRACE_H = /usr/include/dtrace.h |
1 | 340 |
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
341 |
PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace |
|
342 |
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) |
|
343 |
patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) |
|
363
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
344 |
systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
345 |
|
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
346 |
ifneq ("$(systemDtraceHdrFound)", "") |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
347 |
CFLAGS += -DHAVE_DTRACE_H |
99d43e8a76ad
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
338
diff
changeset
|
348 |
endif |
1 | 349 |
|
350 |
ifneq ("$(patchDtraceFound)", "") |
|
351 |
DTRACE_PROG=$(PATCH_DTRACE_PROG) |
|
352 |
DTRACE_INCL=-I/opt/SUNWdtrd/include |
|
353 |
else |
|
354 |
ifneq ("$(systemDtraceFound)", "") |
|
355 |
DTRACE_PROG=$(SYSTEM_DTRACE_PROG) |
|
356 |
else |
|
357 |
||
358 |
endif # ifneq ("$(systemDtraceFound)", "") |
|
359 |
endif # ifneq ("$(patchDtraceFound)", "") |
|
360 |
||
361 |
ifneq ("${DTRACE_PROG}", "") |
|
362 |
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
363 |
||
26179 | 364 |
DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) $(DTRACE_JHELPER.o) |
1 | 365 |
CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED |
366 |
MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) |
|
367 |
||
368 |
dtraceCheck: |
|
369 |
||
370 |
else # manually disabled |
|
371 |
||
372 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
373 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled via environment variable" |
1 | 374 |
|
375 |
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
376 |
||
377 |
else # No dtrace program found |
|
378 |
||
379 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
380 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled: not supported by system" |
1 | 381 |
|
382 |
endif # ifneq ("${dtraceFound}", "") |
|
383 |
||
384 |
endif # ifdef USE_GCC |
|
385 |
||
386 |
else # CORE build |
|
387 |
||
388 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
26179
diff
changeset
|
389 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled for CORE builds" |
1 | 390 |
|
391 |
endif # ifneq ("${TYPE}", "CORE") |