Mercurial > hg > graal-compiler
annotate make/solaris/makefiles/dtrace.make @ 6099:5be76dc5304d
Merge
author | zgu |
---|---|
date | Tue, 29 May 2012 20:06:10 -0400 |
parents | 9c1709c4c80c |
children | d1b0644d6acf |
rev | line source |
---|---|
0 | 1 # |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
2 # Copyright (c) 2005, 2012, 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 |
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
28 # but not for CORE or KERNEL configurations. |
0 | 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 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
41 LIBJVM_DB = libjvm_db.so |
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
42 LIBJVM_DB_G = libjvm$(G_SUFFIX)_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 LIBJVM_DB_G_DEBUGINFO = libjvm$(G_SUFFIX)_db.debuginfo |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
47 LIBJVM_DB_G_DIZ = libjvm$(G_SUFFIX)_db.diz |
3954 | 48 |
0 | 49 JVM_DTRACE = jvm_dtrace |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
50 LIBJVM_DTRACE = libjvm_dtrace.so |
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
51 LIBJVM_DTRACE_G = libjvm$(G_SUFFIX)_dtrace.so |
0 | 52 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
53 LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
54 LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
3954 | 55 LIBJVM_DTRACE_G_DEBUGINFO = libjvm$(G_SUFFIX)_dtrace.debuginfo |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
56 LIBJVM_DTRACE_G_DIZ = libjvm$(G_SUFFIX)_dtrace.diz |
3954 | 57 |
0 | 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 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
89 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl |
0 | 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) | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
98 XLIBJVM_DB_G = 64/$(LIBJVM_DB_G) |
0 | 99 XLIBJVM_DTRACE = 64/$(LIBJVM_DTRACE) |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
100 XLIBJVM_DTRACE_G = 64/$(LIBJVM_DTRACE_G) |
0 | 101 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
102 XLIBJVM_DB_DEBUGINFO = 64/$(LIBJVM_DB_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
103 XLIBJVM_DB_DIZ = 64/$(LIBJVM_DB_DIZ) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
104 XLIBJVM_DB_G_DEBUGINFO = 64/$(LIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
105 XLIBJVM_DB_G_DIZ = 64/$(LIBJVM_DB_G_DIZ) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
106 XLIBJVM_DTRACE_DEBUGINFO = 64/$(LIBJVM_DTRACE_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
107 XLIBJVM_DTRACE_DIZ = 64/$(LIBJVM_DTRACE_DIZ) |
3954 | 108 XLIBJVM_DTRACE_G_DEBUGINFO = 64/$(LIBJVM_DTRACE_G_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
109 XLIBJVM_DTRACE_G_DIZ = 64/$(LIBJVM_DTRACE_G_DIZ) |
3954 | 110 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
111 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
0 | 112 @echo Making $@ |
113 $(QUIETLY) mkdir -p 64/ ; \ | |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
114 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
0 | 115 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
116 [ -f $(XLIBJVM_DB_G) ] || { ln -s $(LIBJVM_DB) $(XLIBJVM_DB_G); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
117 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
118 # 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
|
119 # 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
|
120 # 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
|
121 # 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
|
122 # on all Solaris builds just in case. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
123 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 124 $(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
|
125 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
126 # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
127 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DB_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
128 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DB_DEBUGINFO) $@ |
3954 | 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 | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
137 [ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
138 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
139 $(ZIPEXE) -q -y $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
140 $(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
141 [ -f $(XLIBJVM_DB_G_DIZ) ] || { ln -s $(XLIBJVM_DB_DIZ) $(XLIBJVM_DB_G_DIZ); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
142 endif |
3954 | 143 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
144 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
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) |
0 | 146 @echo Making $@ |
147 $(QUIETLY) mkdir -p 64/ ; \ | |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
148 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
0 | 149 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
150 [ -f $(XLIBJVM_DTRACE_G) ] || { ln -s $(LIBJVM_DTRACE) $(XLIBJVM_DTRACE_G); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
151 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
152 # 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
|
153 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 154 $(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
|
155 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
156 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(XLIBJVM_DTRACE_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
157 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(XLIBJVM_DTRACE_DEBUGINFO) $@ |
3954 | 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 | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
166 [ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { ln -s $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
167 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
168 $(ZIPEXE) -q -y $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
169 $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
170 [ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { ln -s $(XLIBJVM_DTRACE_DIZ) $(XLIBJVM_DTRACE_G_DIZ); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
171 endif |
3954 | 172 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
173 |
0 | 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 \ | |
1972 | 183 $(LIBJVM.o) |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
184 $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
0 | 185 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
186 | |
187 $(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
|
188 $(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
0 | 189 ./lib$(GENOFFS).so |
190 | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
191 CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
192 cmp -s $@ $@.tmp; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
193 case $$? in \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
194 0) rm -f $@.tmp;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
195 *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
196 esac |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
197 |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
198 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
0 | 199 $(JVMOFFS).h: $(GENOFFS) |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
200 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
201 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 202 |
203 $(JVMOFFS)Index.h: $(GENOFFS) | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
204 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
205 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 206 |
207 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
208 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
209 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 210 |
211 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp | |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
212 $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
0 | 213 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
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) |
0 | 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 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
218 [ -f $(LIBJVM_DB_G) ] || { ln -s $@ $(LIBJVM_DB_G); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
219 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
220 # 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
|
221 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 222 $(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
|
223 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
224 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
225 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@ |
3954 | 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); } | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
235 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
236 $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
237 $(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
238 [ -f $(LIBJVM_DB_G_DIZ) ] || { ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
239 endif |
3954 | 240 endif |
0 | 241 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
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) |
0 | 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 | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
246 [ -f $(LIBJVM_DTRACE_G) ] || { ln -s $@ $(LIBJVM_DTRACE_G); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
247 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
248 # 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
|
249 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 250 $(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
|
251 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
252 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
253 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@ |
3954 | 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); } | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
263 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
264 $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
265 $(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
266 [ -f $(LIBJVM_DTRACE_G_DIZ) ] || { ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); } |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
267 endif |
3954 | 268 endif |
0 | 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 | |
1972 | 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 | |
0 | 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 | |
1799
4094f07967ca
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
1552
diff
changeset
|
299 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
0 | 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 | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
333 SYSTEM_DTRACE_H = /usr/include/dtrace.h |
0 | 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}) | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
338 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
339 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
340 ifneq ("$(systemDtraceHdrFound)", "") |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
341 CFLAGS += -DHAVE_DTRACE_H |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
342 endif |
0 | 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") |