Mercurial > hg > graal-compiler
annotate make/solaris/makefiles/dtrace.make @ 6560:2b5eab0df111
Fixed linking issue on Solaris. Mapfile vers files must be defined.
author | Laurent Daynes <Laurent.Daynes@oracle.com> |
---|---|
date | Fri, 19 Oct 2012 11:30:50 +0200 |
parents | 61a94c2da7c4 |
children | 9024b6b53ec2 |
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 | |
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
|
97 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
|
98 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
|
99 XLIBJVM_DB_G = $(XLIBJVM_DIR)/$(LIBJVM_DB_G) |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
100 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(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
|
101 XLIBJVM_DTRACE_G = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G) |
0 | 102 |
6167
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
103 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
|
104 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
|
105 XLIBJVM_DB_G_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_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
|
106 XLIBJVM_DB_G_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DB_G_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
|
107 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
|
108 XLIBJVM_DTRACE_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_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
|
109 XLIBJVM_DTRACE_G_DEBUGINFO = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_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
|
110 XLIBJVM_DTRACE_G_DIZ = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_G_DIZ) |
3954 | 111 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
112 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE) |
0 | 113 @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
|
114 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
115 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \ |
0 | 116 $(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
|
117 [ -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
|
118 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
119 # 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
|
120 # 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
|
121 # 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
|
122 # 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
|
123 # on all Solaris builds just in case. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
124 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 125 $(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
|
126 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
127 # 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
|
128 # $(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
|
129 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not |
d1b0644d6acf
7175255: symlinks are wrong, which caused jdk8-promote-2 to fail (client/64/64 directories in debuginfo zips)
dcubed
parents:
6095
diff
changeset
|
130 # in the 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
|
131 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ) |
3954 | 132 ifeq ($(STRIP_POLICY),all_strip) |
133 $(QUIETLY) $(STRIP) $@ | |
134 else | |
135 ifeq ($(STRIP_POLICY),min_strip) | |
136 $(QUIETLY) $(STRIP) -x $@ | |
137 # implied else here is no stripping at all | |
138 endif | |
139 endif | |
6190
61a94c2da7c4
7179759: ENV: Nightly fails during jdk copiyng for solaris platforms after FDS unzipping
coleenp
parents:
6167
diff
changeset
|
140 [ -f $(XLIBJVM_DB_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && 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
|
141 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
|
142 # 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
|
143 # in the archived 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
|
144 ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) ) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
145 $(RM) $(XLIBJVM_DB_DEBUGINFO) $(XLIBJVM_DB_G_DEBUGINFO) |
6190
61a94c2da7c4
7179759: ENV: Nightly fails during jdk copiyng for solaris platforms after FDS unzipping
coleenp
parents:
6167
diff
changeset
|
146 [ -f $(XLIBJVM_DB_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DB_DIZ) $(LIBJVM_DB_G_DIZ); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
147 endif |
3954 | 148 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
149 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
150 $(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE) |
0 | 151 @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
|
152 $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \ |
433
c1345e85f901
6767659: Conversion from i486 to x86 missed some entries in makefiles
kvn
parents:
196
diff
changeset
|
153 $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \ |
0 | 154 $(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
|
155 [ -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
|
156 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
157 # 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
|
158 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 159 $(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
|
160 # $(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
|
161 # $(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
|
162 # 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
|
163 # 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
|
164 ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ) |
3954 | 165 ifeq ($(STRIP_POLICY),all_strip) |
166 $(QUIETLY) $(STRIP) $@ | |
167 else | |
168 ifeq ($(STRIP_POLICY),min_strip) | |
169 $(QUIETLY) $(STRIP) -x $@ | |
170 # implied else here is no stripping at all | |
171 endif | |
172 endif | |
6190
61a94c2da7c4
7179759: ENV: Nightly fails during jdk copiyng for solaris platforms after FDS unzipping
coleenp
parents:
6167
diff
changeset
|
173 [ -f $(XLIBJVM_DTRACE_G_DEBUGINFO) ] || { cd $(XLIBJVM_DIR) && 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
|
174 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
|
175 # 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
|
176 # in the archived 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
|
177 ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) ) |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
178 $(RM) $(XLIBJVM_DTRACE_DEBUGINFO) $(XLIBJVM_DTRACE_G_DEBUGINFO) |
6190
61a94c2da7c4
7179759: ENV: Nightly fails during jdk copiyng for solaris platforms after FDS unzipping
coleenp
parents:
6167
diff
changeset
|
179 [ -f $(XLIBJVM_DTRACE_G_DIZ) ] || { cd $(XLIBJVM_DIR) && ln -s $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_G_DIZ); } |
6020
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
180 endif |
3954 | 181 endif |
1123
167c2986d91b
6843629: Make current hotspot build part of jdk5 control build
phh
parents:
443
diff
changeset
|
182 |
0 | 183 endif # ifneq ("${ISA}","${BUILDARCH}") |
184 | |
185 ifdef USE_GCC | |
186 LFLAGS_GENOFFS += -D_REENTRANT | |
187 else | |
188 LFLAGS_GENOFFS += -mt -xnolib -norunpath | |
189 endif | |
190 | |
191 lib$(GENOFFS).so: $(DTRACE_SRCDIR)/$(GENOFFS).cpp $(DTRACE_SRCDIR)/$(GENOFFS).h \ | |
1972 | 192 $(LIBJVM.o) |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
193 $(QUIETLY) $(CXX) $(CXXFLAGS) $(GENOFFS_CFLAGS) $(SHARED_FLAG) $(PICFLAG) \ |
0 | 194 $(LFLAGS_GENOFFS) -o $@ $(DTRACE_SRCDIR)/$(GENOFFS).cpp -lc |
195 | |
196 $(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
|
197 $(QUIETLY) $(LINK.CXX) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ |
0 | 198 ./lib$(GENOFFS).so |
199 | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
200 CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
201 cmp -s $@ $@.tmp; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
202 case $$? in \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
203 0) rm -f $@.tmp;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
204 *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
205 esac |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
206 |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
207 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. |
0 | 208 $(JVMOFFS).h: $(GENOFFS) |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
209 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
210 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 211 |
212 $(JVMOFFS)Index.h: $(GENOFFS) | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
213 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
214 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 215 |
216 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h | |
440
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
217 $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp |
96c6da8f095c
6769128: failure to run generateJvmOffsets is ignored
jcoomes
parents:
196
diff
changeset
|
218 $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) |
0 | 219 |
220 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp | |
4891
719f7007c8e8
7141242: build-infra merge: Rename CPP->CXX and LINK->LD
erikj
parents:
3954
diff
changeset
|
221 $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp |
0 | 222 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
223 $(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE) |
0 | 224 @echo Making $@ |
225 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \ | |
226 $(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
|
227 [ -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
|
228 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
229 # 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
|
230 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 231 $(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
|
232 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
233 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
234 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@ |
3954 | 235 ifeq ($(STRIP_POLICY),all_strip) |
236 $(QUIETLY) $(STRIP) $@ | |
237 else | |
238 ifeq ($(STRIP_POLICY),min_strip) | |
239 $(QUIETLY) $(STRIP) -x $@ | |
240 # implied else here is no stripping at all | |
241 endif | |
242 endif | |
243 [ -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
|
244 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
245 $(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
|
246 $(RM) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
247 [ -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
|
248 endif |
3954 | 249 endif |
0 | 250 |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
251 $(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 | 252 @echo Making $@ |
253 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. \ | |
254 $(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
|
255 [ -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
|
256 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
6095
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
257 # 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
|
258 $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ |
3954 | 259 $(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
|
260 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
261 # $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@ |
9c1709c4c80c
7165598: enable FDS on Solaris X64 when 7165593 is fixed
dcubed
parents:
6020
diff
changeset
|
262 $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@ |
3954 | 263 ifeq ($(STRIP_POLICY),all_strip) |
264 $(QUIETLY) $(STRIP) $@ | |
265 else | |
266 ifeq ($(STRIP_POLICY),min_strip) | |
267 $(QUIETLY) $(STRIP) -x $@ | |
268 # implied else here is no stripping at all | |
269 endif | |
270 endif | |
271 [ -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
|
272 ifeq ($(ZIP_DEBUGINFO_FILES),1) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
273 $(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
|
274 $(RM) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE_G_DEBUGINFO) |
d652a62d6e03
7102323: RFE: enable Full Debug Symbols Phase 1 on Solaris
dcubed
parents:
4891
diff
changeset
|
275 [ -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
|
276 endif |
3954 | 277 endif |
0 | 278 |
279 $(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ | |
280 $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d | |
281 $(QUIETLY) cat $^ > $@ | |
282 | |
1972 | 283 DTraced_Files = ciEnv.o \ |
284 classLoadingService.o \ | |
285 compileBroker.o \ | |
286 hashtable.o \ | |
287 instanceKlass.o \ | |
288 java.o \ | |
289 jni.o \ | |
290 jvm.o \ | |
291 memoryManager.o \ | |
292 nmethod.o \ | |
293 objectMonitor.o \ | |
294 runtimeService.o \ | |
295 sharedRuntime.o \ | |
296 synchronizer.o \ | |
297 thread.o \ | |
298 unsafe.o \ | |
299 vmThread.o \ | |
300 vmCMSOperations.o \ | |
301 vmPSOperations.o \ | |
302 vmGCOperations.o \ | |
303 | |
0 | 304 # Dtrace is available, so we build $(DTRACE.o) |
305 $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) | |
306 @echo Compiling $(DTRACE).d | |
307 | |
1799
4094f07967ca
6974813: JVM needs to use demand loading for its DTrace probes
kamg
parents:
1552
diff
changeset
|
308 $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -G -xlazyload -o $@ -s $(DTRACE).d \ |
0 | 309 $(DTraced_Files) ||\ |
310 STATUS=$$?;\ | |
311 if [ x"$$STATUS" = x"1" -a \ | |
312 x`uname -r` = x"5.10" -a \ | |
313 x`uname -p` = x"sparc" ]; then\ | |
314 echo "*****************************************************************";\ | |
315 echo "* If you are building server compiler, and the error message is ";\ | |
316 echo "* \"incorrect ELF machine type...\", you have run into solaris bug ";\ | |
317 echo "* 6213962, \"dtrace -G doesn't work on sparcv8+ object files\".";\ | |
318 echo "* Either patch/upgrade your system (>= S10u1_15), or set the ";\ | |
319 echo "* environment variable HOTSPOT_DISABLE_DTRACE_PROBES to disable ";\ | |
320 echo "* dtrace probes for this build.";\ | |
321 echo "*****************************************************************";\ | |
322 fi;\ | |
323 exit $$STATUS | |
324 # Since some DTraced_Files are in LIBJVM.o and they are touched by this | |
325 # command, and libgenerateJvmOffsets.so depends on LIBJVM.o, 'make' will | |
326 # think it needs to rebuild libgenerateJvmOffsets.so and thus JvmOffsets* | |
327 # files, but it doesn't, so we touch the necessary files to prevent later | |
328 # recompilation. Note: we only touch the necessary files if they already | |
329 # exist in order to close a race where an empty file can be created | |
330 # before the real build rule is executed. | |
331 # But, we can't touch the *.h files: This rule depends | |
332 # on them, and that would cause an infinite cycle of rebuilding. | |
333 # Neither the *.h or *.ccp files need to be touched, since they have | |
334 # rules which do not update them when the generator file has not | |
335 # changed their contents. | |
336 $(QUIETLY) if [ -f lib$(GENOFFS).so ]; then touch lib$(GENOFFS).so; fi | |
337 $(QUIETLY) if [ -f $(GENOFFS) ]; then touch $(GENOFFS); fi | |
338 $(QUIETLY) if [ -f $(JVMOFFS.o) ]; then touch $(JVMOFFS.o); fi | |
339 | |
340 .PHONY: dtraceCheck | |
341 | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
342 SYSTEM_DTRACE_H = /usr/include/dtrace.h |
0 | 343 SYSTEM_DTRACE_PROG = /usr/sbin/dtrace |
344 PATCH_DTRACE_PROG = /opt/SUNWdtrd/sbin/dtrace | |
345 systemDtraceFound := $(wildcard ${SYSTEM_DTRACE_PROG}) | |
346 patchDtraceFound := $(wildcard ${PATCH_DTRACE_PROG}) | |
116
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
347 systemDtraceHdrFound := $(wildcard $(SYSTEM_DTRACE_H)) |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
348 |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
349 ifneq ("$(systemDtraceHdrFound)", "") |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
350 CFLAGS += -DHAVE_DTRACE_H |
018d5b58dd4f
6537506: Provide a mechanism for specifying Java-level USDT-like dtrace probes
kamg
parents:
91
diff
changeset
|
351 endif |
0 | 352 |
353 ifneq ("$(patchDtraceFound)", "") | |
354 DTRACE_PROG=$(PATCH_DTRACE_PROG) | |
355 DTRACE_INCL=-I/opt/SUNWdtrd/include | |
356 else | |
357 ifneq ("$(systemDtraceFound)", "") | |
358 DTRACE_PROG=$(SYSTEM_DTRACE_PROG) | |
359 else | |
360 | |
361 endif # ifneq ("$(systemDtraceFound)", "") | |
362 endif # ifneq ("$(patchDtraceFound)", "") | |
363 | |
364 ifneq ("${DTRACE_PROG}", "") | |
365 ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
366 | |
367 DTRACE_OBJS = $(DTRACE.o) $(JVMOFFS.o) | |
368 CFLAGS += $(DTRACE_INCL) -DDTRACE_ENABLED | |
369 MAPFILE_DTRACE_OPT = $(MAPFILE_DTRACE) | |
370 | |
371 dtraceCheck: | |
372 | |
373 else # manually disabled | |
374 | |
375 dtraceCheck: | |
376 $(QUIETLY) echo "**NOTICE** Dtrace support disabled via environment variable" | |
377 | |
378 endif # ifeq ("${HOTSPOT_DISABLE_DTRACE_PROBES}", "") | |
379 | |
380 else # No dtrace program found | |
381 | |
382 dtraceCheck: | |
383 $(QUIETLY) echo "**NOTICE** Dtrace support disabled: not supported by system" | |
384 | |
385 endif # ifneq ("${dtraceFound}", "") | |
386 | |
387 endif # ifdef USE_GCC | |
388 | |
389 else # KERNEL build | |
390 | |
391 dtraceCheck: | |
392 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for KERNEL builds" | |
393 | |
394 endif # ifneq ("${TYPE}", "KERNEL") | |
395 | |
396 else # CORE build | |
397 | |
398 dtraceCheck: | |
399 $(QUIETLY) echo "**NOTICE** Dtrace support disabled for CORE builds" | |
400 | |
401 endif # ifneq ("${TYPE}", "CORE") |