comparison make/linux/makefiles/defs.make @ 3954:da0999c4b733

7071904: 4/4 HotSpot: Full Debug Symbols Summary: Add support for .debuginfo files for HSX libraries. Reviewed-by: poonam, dholmes, never
author dcubed
date Fri, 16 Sep 2011 16:21:20 -0700
parents 4aa5974a06dd
children 5d871c1ff17c
comparison
equal deleted inserted replaced
3950:5a3c2bc614ca 3954:da0999c4b733
1 # 1 #
2 # Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # 4 #
5 # This code is free software; you can redistribute it and/or modify it 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 6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. 7 # published by the Free Software Foundation.
112 PLATFORM = linux-ppc 112 PLATFORM = linux-ppc
113 VM_PLATFORM = linux_ppc 113 VM_PLATFORM = linux_ppc
114 HS_ARCH = ppc 114 HS_ARCH = ppc
115 endif 115 endif
116 116
117 # determine if HotSpot is being built in JDK6 or earlier version
118 JDK6_OR_EARLIER=0
119 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1"
120 # if the longer variable names (newer build style) are set, then check those
121 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1"
122 JDK6_OR_EARLIER=1
123 endif
124 else
125 # the longer variables aren't set so check the shorter variable names
126 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1"
127 JDK6_OR_EARLIER=1
128 endif
129 endif
130
131 ifeq ($(JDK6_OR_EARLIER),0)
132 # Full Debug Symbols is supported on JDK7 or newer
133
134 # Default OBJCOPY comes from GNU Binutils on Linux:
135 DEF_OBJCOPY=/usr/bin/objcopy
136 ifdef CROSS_COMPILE_ARCH
137 # don't try to generate .debuginfo files when cross compiling
138 _JUNK_ := $(shell \
139 echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
140 "skipping .debuginfo generation.")
141 OBJCOPY=
142 else
143 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
144 ifneq ($(ALT_OBJCOPY),)
145 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
146 # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
147 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
148 endif
149 endif
150
151 ifeq ($(OBJCOPY),)
152 _JUNK_ := $(shell \
153 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
154 else
155 _JUNK_ := $(shell \
156 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
157
158 # Library stripping policies for .debuginfo configs:
159 # all_strip - strips everything from the library
160 # min_strip - strips most stuff from the library; leaves minimum symbols
161 # no_strip - does not strip the library at all
162 #
163 # Oracle security policy requires "all_strip". A waiver was granted on
164 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
165 #
166 DEF_STRIP_POLICY="min_strip"
167 ifeq ($(ALT_STRIP_POLICY),)
168 STRIP_POLICY=$(DEF_STRIP_POLICY)
169 else
170 STRIP_POLICY=$(ALT_STRIP_POLICY)
171 endif
172
173 _JUNK_ := $(shell \
174 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
175 endif
176 endif
177
117 JDK_INCLUDE_SUBDIR=linux 178 JDK_INCLUDE_SUBDIR=linux
118 179
119 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms 180 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
120 VM_DEBUG=jvmg 181 VM_DEBUG=jvmg
121 182
122 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html 183 EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
123 184
124 # client and server subdirectories have symbolic links to ../libjsig.so 185 # client and server subdirectories have symbolic links to ../libjsig.so
125 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so 186 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.so
187 ifneq ($(OBJCOPY),)
188 EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo
189 endif
190
126 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server 191 EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
127 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client 192 EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
128 193
129 ifndef BUILD_CLIENT_ONLY 194 ifndef BUILD_CLIENT_ONLY
130 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt 195 EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
131 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so 196 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.so
197 ifneq ($(OBJCOPY),)
198 EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo
199 endif
132 endif 200 endif
133 201
134 ifneq ($(ZERO_BUILD), true) 202 ifneq ($(ZERO_BUILD), true)
135 ifeq ($(ARCH_DATA_MODEL), 32) 203 ifeq ($(ARCH_DATA_MODEL), 32)
136 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt 204 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
137 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so 205 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.so
206 ifneq ($(OBJCOPY),)
207 EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo
208 endif
138 endif 209 endif
139 endif 210 endif
140 211
141 # Serviceability Binaries 212 # Serviceability Binaries
142 # No SA Support for PPC, IA64, ARM or zero 213 # No SA Support for PPC, IA64, ARM or zero
143 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ 214 ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
144 $(EXPORT_LIB_DIR)/sa-jdi.jar 215 $(EXPORT_LIB_DIR)/sa-jdi.jar
145 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \ 216 ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.so \
146 $(EXPORT_LIB_DIR)/sa-jdi.jar 217 $(EXPORT_LIB_DIR)/sa-jdi.jar
218 ifneq ($(OBJCOPY),)
219 ADD_SA_BINARIES/x86 += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
220 ADD_SA_BINARIES/sparc += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo
221 endif
147 ADD_SA_BINARIES/ppc = 222 ADD_SA_BINARIES/ppc =
148 ADD_SA_BINARIES/ia64 = 223 ADD_SA_BINARIES/ia64 =
149 ADD_SA_BINARIES/arm = 224 ADD_SA_BINARIES/arm =
150 ADD_SA_BINARIES/zero = 225 ADD_SA_BINARIES/zero =
151 226