author | twisti |
Thu, 08 Oct 2015 12:49:30 -1000 | |
changeset 33160 | c59f1676d27e |
parent 31365 | dc7a49d816b8 |
child 33583 | af842015bfaa |
permissions | -rw-r--r-- |
10565 | 1 |
# |
15432 | 2 |
# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
10565 | 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 |
# |
|
19 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
# or visit www.oracle.com if you need additional information or have any |
|
21 |
# questions. |
|
22 |
# |
|
23 |
# |
|
24 |
||
10739 | 25 |
# Rules to build jvm_db/dtrace, used by vm.make |
26 |
||
27 |
# We build libjvm_dtrace/libjvm_db/dtrace for COMPILER1 and COMPILER2 |
|
15432 | 28 |
# but not for CORE configuration. |
10739 | 29 |
|
30 |
ifneq ("${TYPE}", "CORE") |
|
31 |
||
32 |
ifeq ($(OS_VENDOR), Darwin) |
|
33 |
# we build dtrace for macosx using USDT2 probes |
|
34 |
||
35 |
DtraceOutDir = $(GENERATED)/dtracefiles |
|
36 |
||
37 |
# Bsd does not build libjvm_db, does not compile on macosx |
|
38 |
# disabled in build: rule in vm.make |
|
39 |
JVM_DB = libjvm_db |
|
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13974
diff
changeset
|
40 |
LIBJVM_DB = libjvm_db.dylib |
10739 | 41 |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
42 |
LIBJVM_DB_DEBUGINFO = libjvm_db.dylib.dSYM |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
43 |
LIBJVM_DB_DIZ = libjvm_db.diz |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
44 |
|
10739 | 45 |
JVM_DTRACE = jvm_dtrace |
14815
41114a74463a
7153050: remove crufty '_g' support from HotSpot repo makefiles
dcubed
parents:
13974
diff
changeset
|
46 |
LIBJVM_DTRACE = libjvm_dtrace.dylib |
10739 | 47 |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
48 |
LIBJVM_DTRACE_DEBUGINFO = libjvm_dtrace.dylib.dSYM |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
49 |
LIBJVM_DTRACE_DIZ = libjvm_dtrace.diz |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
50 |
|
10739 | 51 |
JVMOFFS = JvmOffsets |
52 |
JVMOFFS.o = $(JVMOFFS).o |
|
53 |
GENOFFS = generate$(JVMOFFS) |
|
54 |
||
55 |
DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace |
|
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
56 |
DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace |
10739 | 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 = -D_LP64 |
|
66 |
endif |
|
67 |
||
68 |
# making libjvm_db |
|
69 |
||
70 |
# Use mapfile with libjvm_db.so |
|
71 |
LIBJVM_DB_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_db |
|
72 |
||
73 |
# Use mapfile with libjvm_dtrace.so |
|
74 |
LIBJVM_DTRACE_MAPFILE = # no mapfile for usdt2 # $(MAKEFILES_DIR)/mapfile-vers-jvm_dtrace |
|
75 |
||
76 |
LFLAGS_JVM_DB += $(PICFLAG) # -D_REENTRANT |
|
77 |
LFLAGS_JVM_DTRACE += $(PICFLAG) # -D_REENTRANT |
|
78 |
||
79 |
ISA = $(subst i386,i486,$(BUILDARCH)) |
|
80 |
||
81 |
# Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so |
|
82 |
ifneq ("${ISA}","${BUILDARCH}") |
|
83 |
||
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
84 |
XLIBJVM_DIR = 64 |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
85 |
XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
86 |
XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE) |
10739 | 87 |
XARCH = $(subst sparcv9,v9,$(shell echo $(ISA))) |
88 |
||
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
89 |
XLIBJVM_DB_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
90 |
XLIBJVM_DB_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
91 |
XLIBJVM_DTRACE_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
92 |
XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
93 |
|
10739 | 94 |
$(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
95 |
@echo $(LOG_INFO) Making $@ |
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
96 |
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
10739 | 97 |
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. -I$(GENERATED) \ |
98 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c #-lc |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
99 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
100 |
ifeq ($(OS_VENDOR), Darwin) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
101 |
$(DSYMUTIL) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
102 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
103 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
104 |
# is not in the archived name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
105 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
106 |
$(RM) -r $(XLIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
107 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
108 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
109 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
110 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
111 |
# is not in the link name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
112 |
$(QUIETLY) ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
113 |
ifeq ($(STRIP_POLICY),all_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
114 |
$(QUIETLY) $(STRIP) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
115 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
116 |
ifeq ($(STRIP_POLICY),min_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
117 |
$(QUIETLY) $(STRIP) -x $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
118 |
# implied else here is no stripping at all |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
119 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
120 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
121 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
122 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
123 |
# is not in the archived name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
124 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
125 |
$(RM) $(XLIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
126 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
127 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
128 |
endif |
10739 | 129 |
|
130 |
$(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
131 |
@echo $(LOG_INFO) Making $@ |
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
132 |
$(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
10739 | 133 |
$(CC) $(SYMFLAG) -xarch=$(XARCH) -D$(TYPE) -I. \ |
134 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
135 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
136 |
ifeq ($(OS_VENDOR), Darwin) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
137 |
$(DSYMUTIL) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
138 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
139 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
140 |
# is not in the archived name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
141 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
142 |
$(RM) -r $(XLIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
143 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
144 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
145 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
146 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
147 |
# is not in the link name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
148 |
( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
149 |
ifeq ($(STRIP_POLICY),all_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
150 |
$(QUIETLY) $(STRIP) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
151 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
152 |
ifeq ($(STRIP_POLICY),min_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
153 |
$(QUIETLY) $(STRIP) -x $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
154 |
# implied else here is no stripping at all |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
155 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
156 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
157 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
158 |
# Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
159 |
# is not in the archived name: |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
160 |
( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) ) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
161 |
$(RM) $(XLIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
162 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
163 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
164 |
endif |
10739 | 165 |
|
166 |
endif # ifneq ("${ISA}","${BUILDARCH}") |
|
167 |
||
168 |
LFLAGS_GENOFFS += -L. |
|
169 |
||
170 |
lib$(GENOFFS).dylib: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ |
|
171 |
$(LIBJVM.o) |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10739
diff
changeset
|
172 |
$(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
10739 | 173 |
$(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -ljvm |
174 |
||
175 |
$(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10739
diff
changeset
|
176 |
$(QUIETLY) $(LINK.CXX) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
10739 | 177 |
./lib$(GENOFFS).dylib |
178 |
||
179 |
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
|
180 |
$(JVMOFFS).h: $(GENOFFS) |
|
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
11721
diff
changeset
|
181 |
$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \ |
28613
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
182 |
if diff $@.tmp $@ > /dev/null 2>&1 ; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
183 |
then rm -f $@.tmp; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
184 |
else rm -f $@; mv $@.tmp $@; \ |
10739 | 185 |
fi |
186 |
||
187 |
$(JVMOFFS)Index.h: $(GENOFFS) |
|
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
11721
diff
changeset
|
188 |
$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \ |
28613
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
189 |
if diff $@.tmp $@ > /dev/null 2>&1 ; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
190 |
then rm -f $@.tmp; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
191 |
else rm -f $@; mv $@.tmp $@; \ |
10739 | 192 |
fi |
193 |
||
194 |
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h |
|
13966
7b818806118b
8000485: Hotspot build fails in Solaris Studio IDE when building dtrace
vlivanov
parents:
11721
diff
changeset
|
195 |
$(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \ |
28613
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
196 |
if diff $@.tmp $@ > /dev/null 2>&1; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
197 |
then rm -f $@.tmp; \ |
b78d7c133e56
8065576: Enable pipefail in the shell used by make to better detect build errors
erikj
parents:
26691
diff
changeset
|
198 |
else rm -f $@; mv $@.tmp $@; \ |
10739 | 199 |
fi |
200 |
||
201 |
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp |
|
11721
dcd1f62c9caf
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
10739
diff
changeset
|
202 |
$(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
10739 | 203 |
|
204 |
$(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
205 |
@echo $(LOG_INFO) Making $@ |
10739 | 206 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ |
207 |
$(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -Wall # -lc |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
208 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
209 |
ifeq ($(OS_VENDOR), Darwin) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
210 |
$(DSYMUTIL) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
211 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
212 |
$(ZIPEXE) -q -r -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
213 |
$(RM) -r $(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
214 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
215 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
216 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
217 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
218 |
ifeq ($(STRIP_POLICY),all_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
219 |
$(QUIETLY) $(STRIP) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
220 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
221 |
ifeq ($(STRIP_POLICY),min_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
222 |
$(QUIETLY) $(STRIP) -x $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
223 |
# implied else here is no stripping at all |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
224 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
225 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
226 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
227 |
$(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
228 |
$(RM) $(LIBJVM_DB_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
229 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
230 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
231 |
endif |
10739 | 232 |
|
233 |
$(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
234 |
@echo $(LOG_INFO) Making $@ |
10739 | 235 |
$(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ |
236 |
$(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c #-lc -lthread -ldoor |
|
20686
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
237 |
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
238 |
ifeq ($(OS_VENDOR), Darwin) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
239 |
$(DSYMUTIL) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
240 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
241 |
$(ZIPEXE) -q -r -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
242 |
$(RM) -r $(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
243 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
244 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
245 |
$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
246 |
$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
247 |
ifeq ($(STRIP_POLICY),all_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
248 |
$(QUIETLY) $(STRIP) $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
249 |
else |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
250 |
ifeq ($(STRIP_POLICY),min_strip) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
251 |
$(QUIETLY) $(STRIP) -x $@ |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
252 |
# implied else here is no stripping at all |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
253 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
254 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
255 |
ifeq ($(ZIP_DEBUGINFO_FILES),1) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
256 |
$(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
257 |
$(RM) $(LIBJVM_DTRACE_DEBUGINFO) |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
258 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
259 |
endif |
1fa9a75192c3
7165611: implement Full Debug Symbols on MacOS X hotspot
dcubed
parents:
15432
diff
changeset
|
260 |
endif |
10739 | 261 |
|
262 |
||
263 |
$(DtraceOutDir): |
|
264 |
mkdir $(DtraceOutDir) |
|
265 |
||
31365
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
266 |
# When building using a devkit, dtrace cannot find the correct preprocessor so |
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
267 |
# we run it explicitly before runing dtrace. |
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
268 |
$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir) |
31365
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
269 |
$(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c $(DTRACE_COMMON_SRCDIR)/hotspot.d > $(DtraceOutDir)/hotspot.d |
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
270 |
$(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hotspot.d |
10739 | 271 |
|
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
272 |
$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) |
31365
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
273 |
$(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d > $(DtraceOutDir)/hotspot_jni.d |
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
274 |
$(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hotspot_jni.d |
10565 | 275 |
|
22736
6c317cced072
8032462: Change the linux SDT implementation to use USDT2 instead of USDT1
sla
parents:
22520
diff
changeset
|
276 |
$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir) |
31365
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
277 |
$(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c $(DTRACE_COMMON_SRCDIR)/hs_private.d > $(DtraceOutDir)/hs_private.d |
dc7a49d816b8
8087195: Support building hotspot with devkits on Macosx
erikj
parents:
28613
diff
changeset
|
278 |
$(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hs_private.d |
10739 | 279 |
|
280 |
dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h |
|
281 |
||
282 |
||
283 |
.PHONY: dtraceCheck |
|
284 |
||
285 |
SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
|
286 |
systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) |
|
287 |
||
288 |
ifneq ("$(systemDtraceFound)", "") |
|
289 |
DTRACE_PROG=$(SYSTEM_DTRACE_PROG) |
|
290 |
else |
|
291 |
||
22520
b9e88eed82d7
8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
sla
parents:
20686
diff
changeset
|
292 |
endif |
10739 | 293 |
|
294 |
ifneq ("${DTRACE_PROG}", "") |
|
295 |
ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
296 |
||
297 |
DTRACE_OBJS = $(DTRACE.o) #$(JVMOFFS.o) |
|
298 |
CFLAGS += -DDTRACE_ENABLED #$(DTRACE_INCL) |
|
299 |
||
300 |
||
301 |
dtraceCheck: |
|
302 |
||
303 |
dtrace_stuff: dtrace_gen_headers |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
304 |
$(QUIETLY) echo $(LOG_INFO) "dtrace headers generated" |
10739 | 305 |
|
306 |
||
307 |
else # manually disabled |
|
308 |
||
309 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
310 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled via environment variable" |
10739 | 311 |
|
312 |
dtrace_stuff: |
|
313 |
||
314 |
endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") |
|
315 |
||
316 |
else # No dtrace program found |
|
317 |
||
318 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
319 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled: not supported by system" |
10739 | 320 |
|
321 |
dtrace_stuff: |
|
322 |
||
323 |
endif # ifneq ("${dtraceFound}", "") |
|
324 |
||
325 |
endif # ifeq ($(OS_VENDOR), Darwin) |
|
326 |
||
327 |
||
328 |
else # CORE build |
|
329 |
||
330 |
dtraceCheck: |
|
26691
40ea2c41f53b
8056999: Make hotspot builds less verbose on default log level
ihse
parents:
22736
diff
changeset
|
331 |
$(QUIETLY) echo $(LOG_INFO) "**NOTICE** Dtrace support disabled for CORE builds" |
10739 | 332 |
|
333 |
endif # ifneq ("${TYPE}", "CORE") |