Mercurial > hg > truffle
annotate make/solaris/makefiles/dtrace.make @ 7746:2c1ae1a125bd
Pull out test code that's useful for other assemblers.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 08 Feb 2013 11:49:48 +0100 |
parents | 892acf0431ef |
children | 8b46b0196eb0 |
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 |
0 | 42 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
43 LIBJVM_DB_DEBUGINFO = libjvm_db.debuginfo |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
44 LIBJVM_DB_DIZ = libjvm_db.diz |
3954 | 45 |
0 | 46 JVM_DTRACE = jvm_dtrace |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
47 LIBJVM_DTRACE = libjvm_dtrace.so |
0 | 48 |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
49 LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.debuginfo |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
50 LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
3954 | 51 |
0 | 52 JVMOFFS = JvmOffsets |
53 JVMOFFS.o = $(JVMOFFS).o | |
54 GENOFFS = generate$(JVMOFFS) | |
55 | |
56 DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace | |
57 DTRACE = dtrace | |
58 DTRACE.o = $(DTRACE).o | |
59 | |
60 # to remove '-g' option which causes link problems | |
61 # also '-z nodefs' is used as workaround | |
62 GENOFFS_CFLAGS = $(shell echo $(CFLAGS) | sed -e 's/ -g / /g' -e 's/ -g0 / /g';) | |
63 | |
64 ifdef LP64 | |
65 DTRACE_OPTS = -64 -D_LP64 | |
66 endif | |
67 | |
68 # making libjvm_db | |
69 | |
70 # Use mapfile with libjvm_db.so | |
71 LIBJVM_DB_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_db | |
72 LFLAGS_JVM_DB += $(MAPFLAG:FILENAME=$(LIBJVM_DB_MAPFILE)) | |
73 | |
74 # Use mapfile with libjvm_dtrace.so | |
75 LIBJVM_DTRACE_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace | |
76 LFLAGS_JVM_DTRACE += $(MAPFLAG:FILENAME=$(LIBJVM_DTRACE_MAPFILE)) | |
77 | |
78 ifdef USE_GCC | |
79 LFLAGS_JVM_DB += -D_REENTRANT $(PICFLAG) | |
80 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG) | |
81 else | |
82 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib | |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
83 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl |
0 | 84 endif |
85 | |
86 ISA = $(subst i386,i486,$(shell isainfo -n)) | |
87 | |
88 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so | |
89 ifneq ("${ISA}","${BUILDARCH}") | |
90 | |
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
|
91 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
|
92 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
|
93 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE) |
0 | 94 |
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
|
95 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
|
96 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
|
97 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
|
98 XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ) |
3954 | 99 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
100 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
0 | 101 @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
|
102 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
103 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
0 | 104 $(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
|
105 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
106 # 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
|
107 # 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
|
108 # 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
|
109 # 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
|
110 # on all Solaris builds just in case. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
111 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 112 $(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
|
113 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
114 # 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
|
115 # $(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
|
116 # 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
|
117 # 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
|
118 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) |
3954 | 119 ifeq ($(STRIP_POLICY),all_strip) |
120 $(QUIETLY) $(STRIP) $@ | |
121 else | |
122 ifeq ($(STRIP_POLICY),min_strip) | |
123 $(QUIETLY) $(STRIP) -x $@ | |
124 # implied else here is no stripping at all | |
125 endif | |
126 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
127 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
|
128 # 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
|
129 # in the archived name: |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
130 ( 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
|
131 $(RM) $(XLIBJVM_DB_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
132 endif |
3954 | 133 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
134 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
135 $(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
0 | 136 @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
|
137 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
138 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
0 | 139 $(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
|
140 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
141 # 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
|
142 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 143 $(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
|
144 # $(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
|
145 # $(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
|
146 # 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
|
147 # 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
|
148 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) |
3954 | 149 ifeq ($(STRIP_POLICY),all_strip) |
150 $(QUIETLY) $(STRIP) $@ | |
151 else | |
152 ifeq ($(STRIP_POLICY),min_strip) | |
153 $(QUIETLY) $(STRIP) -x $@ | |
154 # implied else here is no stripping at all | |
155 endif | |
156 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
157 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
|
158 # 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
|
159 # in the archived name: |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
160 ( 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
|
161 $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
162 endif |
3954 | 163 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
164 |
0 | 165 endif # ifneq ("${ISA}","${BUILDARCH}") |
166 | |
167 ifdef USE_GCC | |
168 LFLAGS_GENOFFS += -D_REENTRANT | |
169 else | |
170 LFLAGS_GENOFFS += -mt -xnolib -norunpath | |
171 endif | |
172 | |
173 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ | |
1972 | 174 $(LIBJVM.o) |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
175 $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
0 | 176 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
177 | |
178 $(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
|
179 $(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
0 | 180 ./lib$(GENOFFS).so |
181 | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
182 CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
183 cmp -s $@ $@.tmp; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
184 case $$? in \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
185 0) rm -f $@.tmp;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
186 *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
187 esac |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
188 |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
189 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
0 | 190 $(JVMOFFS).h: $(GENOFFS) |
6845
9024b6b53ec2
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
6190
diff
changeset
|
191 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
192 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 193 |
194 $(JVMOFFS)Index.h: $(GENOFFS) | |
6845
9024b6b53ec2
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
6190
diff
changeset
|
195 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
196 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 197 |
198 $(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
|
199 $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
200 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 201 |
202 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp | |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
203 $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
0 | 204 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
205 $(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
0 | 206 @echo Making $@ |
207 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ | |
208 $(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
|
209 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
210 # 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
|
211 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 212 $(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
|
213 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
214 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
215 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@ |
3954 | 216 ifeq ($(STRIP_POLICY),all_strip) |
217 $(QUIETLY) $(STRIP) $@ | |
218 else | |
219 ifeq ($(STRIP_POLICY),min_strip) | |
220 $(QUIETLY) $(STRIP) -x $@ | |
221 # implied else here is no stripping at all | |
222 endif | |
223 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
224 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
225 $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
226 $(RM) $(LIBJVM_DB_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
227 endif |
3954 | 228 endif |
0 | 229 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
230 $(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 | 231 @echo Making $@ |
232 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ | |
233 $(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
|
234 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
235 # 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
|
236 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 237 $(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
|
238 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
239 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
240 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@ |
3954 | 241 ifeq ($(STRIP_POLICY),all_strip) |
242 $(QUIETLY) $(STRIP) $@ | |
243 else | |
244 ifeq ($(STRIP_POLICY),min_strip) | |
245 $(QUIETLY) $(STRIP) -x $@ | |
246 # implied else here is no stripping at all | |
247 endif | |
248 endif | |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
249 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
7408
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
250 $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) |
892acf0431ef
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
6845
diff
changeset
|
251 $(RM) $(LIBJVM_DTRACE_DEBUGINFO) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
252 endif |
3954 | 253 endif |
0 | 254 |
255 $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ | |
256 $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d | |
257 $(QUIETLY) cat $^ > $@ | |
258 | |
1972 | 259 DTraced_Files = ciEnv.o \ |
260 classLoadingService.o \ | |
261 compileBroker.o \ | |
262 hashtable.o \ | |
263 instanceKlass.o \ | |
264 java.o \ | |
265 jni.o \ | |
266 jvm.o \ | |
267 memoryManager.o \ | |
268 nmethod.o \ | |
269 objectMonitor.o \ | |
270 runtimeService.o \ | |
271 sharedRuntime.o \ | |
272 synchronizer.o \ | |
273 thread.o \ | |
274 unsafe.o \ | |
275 vmThread.o \ | |
276 vmCMSOperations.o \ | |
277 vmPSOperations.o \ | |
278 vmGCOperations.o \ | |
279 | |
0 | 280 # Dtrace is available, so we build $(DTRACE.o) |
281 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) | |
282 @echo Compiling $(DTRACE).d | |
283 | |
1799
4094f07967ca
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
1552
diff
changeset
|
284 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
0 | 285 $(DTraced_Files) ||\ |
286 STATUS=$$?;\ | |
287 if [ x"$$STATUS" = x"1" -a \ | |
288 x`uname -r` = x"5.10" -a \ | |
289 x`uname -p` = x"sparc" ]; then\ | |
290 echo "*****************************************************************";\ | |
291 echo "* If you are building server compiler, and the error message is ";\ | |
292 echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ | |
293 echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ | |
294 echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ | |
295 echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ | |
296 echo "* dtrace probes for this build.";\ | |
297 echo "*****************************************************************";\ | |
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 | |
316 .PHONY: dtraceCheck | |
317 | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
318 SYSTEM_DTRACE_H = /usr/include/dtrace.h |
0 | 319 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
320 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace | |
321 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) | |
322 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
323 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
324 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
325 ifneq ("$(systemDtraceHdrFound)", "") |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
326 CFLAGS += -DHAVE_DTRACE_H |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
327 endif |
0 | 328 |
329 ifneq ("$(patchDtraceFound)", "") | |
330 DTRACE_PROG=$(PATCH_DTRACE_PROG) | |
331 DTRACE_INCL=-I/opt/SUNWdtrd/include | |
332 else | |
333 ifneq ("$(systemDtraceFound)", "") | |
334 DTRACE_PROG=$(SYSTEM_DTRACE_PROG) | |
335 else | |
336 | |
337 endif # ifneq ("$(systemDtraceFound)", "") | |
338 endif # ifneq ("$(patchDtraceFound)", "") | |
339 | |
340 ifneq ("${DTRACE_PROG}", "") | |
341 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
342 | |
343 DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) | |
344 CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED | |
345 MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) | |
346 | |
347 dtraceCheck: | |
348 | |
349 else # manually disabled | |
350 | |
351 dtraceCheck: | |
352 $(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable" | |
353 | |
354 endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
355 | |
356 else # No dtrace program found | |
357 | |
358 dtraceCheck: | |
359 $(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system" | |
360 | |
361 endif # ifneq ("${dtraceFound}", "") | |
362 | |
363 endif # ifdef USE_GCC | |
364 | |
365 else # KERNEL build | |
366 | |
367 dtraceCheck: | |
368 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" | |
369 | |
370 endif # ifneq ("${TYPE}", "KERNEL") | |
371 | |
372 else # CORE build | |
373 | |
374 dtraceCheck: | |
375 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds" | |
376 | |
377 endif # ifneq ("${TYPE}", "CORE") |