Mercurial > hg > truffle
annotate make/solaris/makefiles/dtrace.make @ 14278:a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
Reviewed-by: coleenp, sspitsyn, dsamersoff
author | sla |
---|---|
date | Thu, 16 Jan 2014 20:14:21 +0100 |
parents | c661fa2e5189 |
children | a00b8f42c4c4 |
rev | line source |
---|---|
0 | 1 # |
7951 | 2 # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 # | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1123
diff
changeset
|
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1123
diff
changeset
|
20 # or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1123
diff
changeset
|
21 # questions. |
0 | 22 # |
23 # | |
24 | |
25 # Rules to build jvm_db/dtrace, used by vm.make | |
26 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
27 # We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 |
7951 | 28 # but not for CORE configuration. |
0 | 29 |
30 ifneq ("${TYPE}", "CORE") | |
31 | |
32 ifdef USE_GCC | |
33 | |
34 dtraceCheck: | |
35 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for gcc builds" | |
36 | |
37 else | |
38 | |
14278
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
39 DtraceOutDir = $(GENERATED)/dtracefiles |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
40 |
0 | 41 JVM_DB = libjvm_db |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
42 LIBJVM_DB = libjvm_db.so |
0 | 43 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
44 LIBJVM_DB_DEBUGINFO = libjvm_db.debuginfo |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
45 LIBJVM_DB_DIZ = libjvm_db.diz |
3954 | 46 |
0 | 47 JVM_DTRACE = jvm_dtrace |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
48 LIBJVM_DTRACE = libjvm_dtrace.so |
0 | 49 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
50 LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
51 LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
3954 | 52 |
0 | 53 JVMOFFS = JvmOffsets |
54 JVMOFFS.o = $(JVMOFFS).o | |
55 GENOFFS = generate$(JVMOFFS) | |
56 | |
57 DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace | |
58 DTRACE = dtrace | |
59 DTRACE.o = $(DTRACE).o | |
60 | |
61 # to remove '-g' option which causes link problems | |
62 # also '-z nodefs' is used as workaround | |
63 GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';) | |
64 | |
65 ifdef LP64 | |
66 DTRACE_OPTS = -64 -D_LP64 | |
67 endif | |
68 | |
69 # making libjvm_db | |
70 | |
71 # Use mapfile with libjvm_db.so | |
72 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db | |
73 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE)) | |
74 | |
75 # Use mapfile with libjvm_dtrace.so | |
76 LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace | |
77 LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE)) | |
78 | |
79 ifdef USE_GCC | |
80 LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) | |
81 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) | |
82 else | |
83 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
84 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl |
0 | 85 endif |
86 | |
87 ISA = $(subst i386,i486,$(shell isainfo -n)) | |
88 | |
89 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so | |
90 ifneq ("${ISA}","${BUILDARCH}") | |
91 | |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
92 XLIBJVM_DIR = 64 |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
93 XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB) |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
94 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE) |
0 | 95 |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
96 XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO) |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
97 XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ) |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
98 XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO) |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
99 XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ) |
3954 | 100 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
101 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
0 | 102 @echo Making $@ |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
103 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
104 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
0 | 105 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
106 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
107 # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
108 # Clear the SHF_ALLOC flag (if set) from empty section headers. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
109 # An empty section header has sh_addr == 0 and sh_size == 0. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
110 # This problem has only been seen on Solaris X64, but we call this tool |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
111 # on all Solaris builds just in case. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
112 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 113 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
114 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
115 # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
116 # $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ; |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
117 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
118 # in the link name: |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
119 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) |
3954 | 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 | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
128 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
129 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
130 # in the archived name: |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
131 ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) ) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
132 $(RM) $(XLIBJVM_DB_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
133 endif |
3954 | 134 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
135 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
136 $(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
0 | 137 @echo Making $@ |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
138 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
139 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
0 | 140 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
141 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
142 # Clear the SHF_ALLOC flag (if set) from empty section headers. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
143 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 144 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
145 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
146 # $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ; |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
147 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
148 # in the link name: |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
149 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) |
3954 | 150 ifeq ($(STRIP_POLICY),all_strip) |
151 $(QUIETLY) $(STRIP) $@ | |
152 else | |
153 ifeq ($(STRIP_POLICY),min_strip) | |
154 $(QUIETLY) $(STRIP) -x $@ | |
155 # implied else here is no stripping at all | |
156 endif | |
157 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
158 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
159 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
160 # in the archived name: |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
161 ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO)) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
162 $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
163 endif |
3954 | 164 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
165 |
0 | 166 endif # ifneq ("${ISA}","${BUILDARCH}") |
167 | |
168 ifdef USE_GCC | |
169 LFLAGS_GENOFFS += -D_REENTRANT | |
170 else | |
171 LFLAGS_GENOFFS += -mt -xnolib -norunpath | |
172 endif | |
173 | |
174 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ | |
1972 | 175 $(LIBJVM.o) |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
176 $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
0 | 177 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
178 | |
179 $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).so | |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
180 $(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
0 | 181 ./lib$(GENOFFS).so |
182 | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
183 CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
184 cmp -s $@ $@.tmp; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
185 case $$? in \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
186 0) rm -f $@.tmp;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
187 *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
188 esac |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
189 |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
190 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
0 | 191 $(JVMOFFS).h: $(GENOFFS) |
6845
9024b6b53ec2
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
6190
diff
changeset
|
192 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
193 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 194 |
195 $(JVMOFFS)Index.h: $(GENOFFS) | |
6845
9024b6b53ec2
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
6190
diff
changeset
|
196 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
197 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 198 |
199 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h | |
6845
9024b6b53ec2
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
6190
diff
changeset
|
200 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
201 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 202 |
203 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp | |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
204 $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
0 | 205 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
206 $(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
0 | 207 @echo Making $@ |
208 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ | |
209 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
210 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
211 # Clear the SHF_ALLOC flag (if set) from empty section headers. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
212 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 213 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
214 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
215 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
216 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@ |
3954 | 217 ifeq ($(STRIP_POLICY),all_strip) |
218 $(QUIETLY) $(STRIP) $@ | |
219 else | |
220 ifeq ($(STRIP_POLICY),min_strip) | |
221 $(QUIETLY) $(STRIP) -x $@ | |
222 # implied else here is no stripping at all | |
223 endif | |
224 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
225 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
226 $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
227 $(RM) $(LIBJVM_DB_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
228 endif |
3954 | 229 endif |
0 | 230 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
231 $(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) |
0 | 232 @echo Making $@ |
233 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ | |
234 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
235 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
236 # Clear the SHF_ALLOC flag (if set) from empty section headers. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
237 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 238 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
239 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
240 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
241 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@ |
3954 | 242 ifeq ($(STRIP_POLICY),all_strip) |
243 $(QUIETLY) $(STRIP) $@ | |
244 else | |
245 ifeq ($(STRIP_POLICY),min_strip) | |
246 $(QUIETLY) $(STRIP) -x $@ | |
247 # implied else here is no stripping at all | |
248 endif | |
249 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
250 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
251 $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
252 $(RM) $(LIBJVM_DTRACE_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
253 endif |
3954 | 254 endif |
0 | 255 |
256 $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ | |
257 $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d | |
258 $(QUIETLY) cat $^ > $@ | |
259 | |
1972 | 260 DTraced_Files = ciEnv.o \ |
261 classLoadingService.o \ | |
262 compileBroker.o \ | |
263 hashtable.o \ | |
264 instanceKlass.o \ | |
265 java.o \ | |
266 jni.o \ | |
267 jvm.o \ | |
268 memoryManager.o \ | |
269 nmethod.o \ | |
270 objectMonitor.o \ | |
271 runtimeService.o \ | |
272 sharedRuntime.o \ | |
273 synchronizer.o \ | |
274 thread.o \ | |
275 unsafe.o \ | |
276 vmThread.o \ | |
277 vmCMSOperations.o \ | |
278 vmPSOperations.o \ | |
279 vmGCOperations.o \ | |
280 | |
0 | 281 # Dtrace is available, so we build $(DTRACE.o) |
282 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) | |
283 @echo Compiling $(DTRACE).d | |
284 | |
1799
4094f07967ca
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
1552
diff
changeset
|
285 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
0 | 286 $(DTraced_Files) ||\ |
287 STATUS=$$?;\ | |
12015
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
288 if [ x"$$STATUS" = x"1" ]; then \ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
289 if [ x`uname -r` = x"5.10" -a \ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
290 x`uname -p` = x"sparc" ]; then\ |
0 | 291 echo "*****************************************************************";\ |
292 echo "* If you are building server compiler, and the error message is ";\ | |
293 echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ | |
294 echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ | |
295 echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ | |
296 echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ | |
297 echo "* dtrace probes for this build.";\ | |
298 echo "*****************************************************************";\ | |
12015
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
299 elif [ x`uname -r` = x"5.10" ]; then\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
300 echo "*****************************************************************";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
301 echo "* If you are seeing 'syntax error near \"umpiconninfo_t\"' on Solaris";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
302 echo "* 10, try doing 'cd /usr/lib/dtrace && gzip mpi.d' as root, ";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
303 echo "* or set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
304 echo "* to disable dtrace probes for this build.";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
305 echo "*****************************************************************";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
306 else \ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
307 echo "*****************************************************************";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
308 echo "* If you cannot fix dtrace build issues, try to ";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
309 echo "* set the environment variable HOTSPOT_DISABLE_DTRACE_PROBES";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
310 echo "* to disable dtrace probes for this build.";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
311 echo "*****************************************************************";\ |
c661fa2e5189
8022093: syntax error near "umpiconninfo_t" -- when building on Solaris 10
iklam
parents:
7951
diff
changeset
|
312 fi; \ |
0 | 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 | |
14278
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
331 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
332 $(DtraceOutDir): |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
333 mkdir $(DtraceOutDir) |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
334 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
335 $(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir) |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
336 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
337 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
338 $(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
339 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
340 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
341 $(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir) |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
342 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
343 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
344 dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
345 |
a3ba776d6ab6
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
12015
diff
changeset
|
346 |
0 | 347 .PHONY: dtraceCheck |
348 | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
349 SYSTEM_DTRACE_H = /usr/include/dtrace.h |
0 | 350 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
351 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace | |
352 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) | |
353 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
354 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
355 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
356 ifneq ("$(systemDtraceHdrFound)", "") |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
357 CFLAGS += -DHAVE_DTRACE_H |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
358 endif |
0 | 359 |
360 ifneq ("$(patchDtraceFound)", "") | |
361 DTRACE_PROG=$(PATCH_DTRACE_PROG) | |
362 DTRACE_INCL=-I/opt/SUNWdtrd/include | |
363 else | |
364 ifneq ("$(systemDtraceFound)", "") | |
365 DTRACE_PROG=$(SYSTEM_DTRACE_PROG) | |
366 else | |
367 | |
368 endif # ifneq ("$(systemDtraceFound)", "") | |
369 endif # ifneq ("$(patchDtraceFound)", "") | |
370 | |
371 ifneq ("${DTRACE_PROG}", "") | |
372 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
373 | |
374 DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) | |
375 CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED | |
376 MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) | |
377 | |
378 dtraceCheck: | |
379 | |
380 else # manually disabled | |
381 | |
382 dtraceCheck: | |
383 $(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable" | |
384 | |
385 endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
386 | |
387 else # No dtrace program found | |
388 | |
389 dtraceCheck: | |
390 $(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system" | |
391 | |
392 endif # ifneq ("${dtraceFound}", "") | |
393 | |
394 endif # ifdef USE_GCC | |
395 | |
396 else # CORE build | |
397 | |
398 dtraceCheck: | |
399 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds" | |
400 | |
401 endif # ifneq ("${TYPE}", "CORE") |