Tue, 03 Apr 2012 09:48:34 -0700
7158067: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect product builds
Summary: Build option FULL_DEBUG_SYMBOLS=0 only affects product builds.
Reviewed-by: ohair, jmelvin, sspitsyn
duke@435 | 1 | # |
dcubed@3724 | 2 | # Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | # |
duke@435 | 5 | # This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | # under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | # published by the Free Software Foundation. |
duke@435 | 8 | # |
duke@435 | 9 | # This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | # version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | # accompanied this code). |
duke@435 | 14 | # |
duke@435 | 15 | # You should have received a copy of the GNU General Public License version |
duke@435 | 16 | # 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | # |
trims@1907 | 19 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | # or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | # questions. |
duke@435 | 22 | # |
duke@435 | 23 | # |
duke@435 | 24 | |
duke@435 | 25 | # The common definitions for hotspot solaris builds. |
duke@435 | 26 | # Include the top level defs.make under make directory instead of this one. |
duke@435 | 27 | # This file is included into make/defs.make. |
duke@435 | 28 | |
duke@435 | 29 | # Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name |
duke@435 | 30 | SLASH_JAVA ?= /java |
duke@435 | 31 | ARCH:=$(shell uname -p) |
duke@435 | 32 | PATH_SEP = : |
duke@435 | 33 | ifeq ($(LP64), 1) |
duke@435 | 34 | ARCH_DATA_MODEL=64 |
duke@435 | 35 | else |
duke@435 | 36 | ARCH_DATA_MODEL=32 |
duke@435 | 37 | endif |
duke@435 | 38 | |
duke@435 | 39 | ifeq ($(ARCH),sparc) |
duke@435 | 40 | ifeq ($(ARCH_DATA_MODEL), 64) |
duke@435 | 41 | MAKE_ARGS += LP64=1 |
duke@435 | 42 | PLATFORM=solaris-sparcv9 |
duke@435 | 43 | VM_PLATFORM=solaris_sparcv9 |
duke@435 | 44 | else |
duke@435 | 45 | PLATFORM=solaris-sparc |
duke@435 | 46 | VM_PLATFORM=solaris_sparc |
duke@435 | 47 | endif |
duke@435 | 48 | HS_ARCH=sparc |
duke@435 | 49 | else |
duke@435 | 50 | ifeq ($(ARCH_DATA_MODEL), 64) |
duke@435 | 51 | MAKE_ARGS += LP64=1 |
duke@435 | 52 | PLATFORM=solaris-amd64 |
duke@435 | 53 | VM_PLATFORM=solaris_amd64 |
duke@435 | 54 | HS_ARCH=x86 |
duke@435 | 55 | else |
duke@435 | 56 | PLATFORM=solaris-i586 |
duke@435 | 57 | VM_PLATFORM=solaris_i486 |
duke@435 | 58 | HS_ARCH=x86 |
duke@435 | 59 | endif |
duke@435 | 60 | endif |
duke@435 | 61 | |
dcubed@3150 | 62 | # determine if HotSpot is being built in JDK6 or earlier version |
dcubed@3150 | 63 | JDK6_OR_EARLIER=0 |
dcubed@3150 | 64 | ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1" |
dcubed@3150 | 65 | # if the longer variable names (newer build style) are set, then check those |
dcubed@3150 | 66 | ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1" |
dcubed@3150 | 67 | JDK6_OR_EARLIER=1 |
dcubed@3150 | 68 | endif |
dcubed@3150 | 69 | else |
dcubed@3150 | 70 | # the longer variables aren't set so check the shorter variable names |
dcubed@3150 | 71 | ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1" |
dcubed@3150 | 72 | JDK6_OR_EARLIER=1 |
dcubed@3150 | 73 | endif |
dcubed@3150 | 74 | endif |
dcubed@3150 | 75 | |
dcubed@3150 | 76 | ifeq ($(JDK6_OR_EARLIER),0) |
dcubed@3724 | 77 | # Full Debug Symbols is supported on JDK7 or newer. |
dcubed@3725 | 78 | # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product |
dcubed@3725 | 79 | # builds is enabled with debug info files ZIP'ed to save space. For |
dcubed@3725 | 80 | # BUILD_FLAVOR != product builds, FDS is always enabled, after all a |
dcubed@3725 | 81 | # debug build without debug info isn't very useful. |
dcubed@3725 | 82 | # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. |
dcubed@3725 | 83 | # |
dcubed@3725 | 84 | # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be |
dcubed@3725 | 85 | # disabled for a BUILD_FLAVOR == product build. |
dcubed@3725 | 86 | # |
dcubed@3725 | 87 | # Note: Use of a different variable name for the FDS override option |
dcubed@3725 | 88 | # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS |
dcubed@3725 | 89 | # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass |
dcubed@3725 | 90 | # in options via environment variables, use of distinct variables |
dcubed@3725 | 91 | # prevents strange behaviours. For example, in a BUILD_FLAVOR != |
dcubed@3725 | 92 | # product build, the FULL_DEBUG_SYMBOLS environment variable will be |
dcubed@3725 | 93 | # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If |
dcubed@3725 | 94 | # the same variable name is used, then different values can be picked |
dcubed@3725 | 95 | # up by different parts of the build. Just to be clear, we only need |
dcubed@3725 | 96 | # two variable names because the incoming option value can be |
dcubed@3725 | 97 | # overridden in some situations, e.g., a BUILD_FLAVOR != product |
dcubed@3725 | 98 | # build. |
dcubed@3150 | 99 | |
dcubed@3725 | 100 | ifeq ($(BUILD_FLAVOR), product) |
dcubed@3725 | 101 | FULL_DEBUG_SYMBOLS ?= 1 |
dcubed@3725 | 102 | ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) |
dcubed@3725 | 103 | else |
dcubed@3725 | 104 | # debug variants always get Full Debug Symbols (if available) |
dcubed@3725 | 105 | ENABLE_FULL_DEBUG_SYMBOLS = 1 |
dcubed@3725 | 106 | endif |
dcubed@3725 | 107 | _JUNK_ := $(shell \ |
dcubed@3725 | 108 | echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
dcubed@3724 | 109 | # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
dcubed@3724 | 110 | |
dcubed@3724 | 111 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 112 | # Default OBJCOPY comes from the SUNWbinutils package: |
dcubed@3724 | 113 | DEF_OBJCOPY=/usr/sfw/bin/gobjcopy |
dcubed@3724 | 114 | ifeq ($(VM_PLATFORM),solaris_amd64) |
dcubed@3724 | 115 | # On Solaris AMD64/X64, gobjcopy is not happy and fails: |
dcubed@3724 | 116 | # |
dcubed@3724 | 117 | # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so |
dcubed@3724 | 118 | # BFD: stKPaiop: Not enough room for program headers, try linking with -N |
dcubed@3724 | 119 | # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value |
dcubed@3724 | 120 | # BFD: stKPaiop: Not enough room for program headers, try linking with -N |
dcubed@3724 | 121 | # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value |
dcubed@3724 | 122 | # BFD: stKPaiop: Not enough room for program headers, try linking with -N |
dcubed@3724 | 123 | # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value |
dcubed@3724 | 124 | _JUNK_ := $(shell \ |
dcubed@3724 | 125 | echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64") |
dcubed@3724 | 126 | OBJCOPY= |
dcubed@3724 | 127 | else |
dcubed@3724 | 128 | OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
dcubed@3724 | 129 | ifneq ($(ALT_OBJCOPY),) |
dcubed@3724 | 130 | _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") |
dcubed@3724 | 131 | OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
dcubed@3724 | 132 | endif |
dcubed@3724 | 133 | endif |
dcubed@3724 | 134 | else |
dcubed@3150 | 135 | OBJCOPY= |
dcubed@3150 | 136 | endif |
dcubed@3724 | 137 | |
dcubed@3150 | 138 | ifeq ($(OBJCOPY),) |
dcubed@3150 | 139 | _JUNK_ := $(shell \ |
dcubed@3150 | 140 | echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") |
dcubed@3724 | 141 | ENABLE_FULL_DEBUG_SYMBOLS=0 |
dcubed@3725 | 142 | _JUNK_ := $(shell \ |
dcubed@3725 | 143 | echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
dcubed@3150 | 144 | else |
dcubed@3150 | 145 | _JUNK_ := $(shell \ |
dcubed@3150 | 146 | echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") |
dcubed@3724 | 147 | |
dcubed@3150 | 148 | # Library stripping policies for .debuginfo configs: |
dcubed@3150 | 149 | # all_strip - strips everything from the library |
dcubed@3150 | 150 | # min_strip - strips most stuff from the library; leaves minimum symbols |
dcubed@3150 | 151 | # no_strip - does not strip the library at all |
dcubed@3150 | 152 | # |
dcubed@3150 | 153 | # Oracle security policy requires "all_strip". A waiver was granted on |
dcubed@3150 | 154 | # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. |
dcubed@3150 | 155 | # |
dcubed@3724 | 156 | # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. |
dcubed@3724 | 157 | # |
dcubed@3724 | 158 | STRIP_POLICY ?= min_strip |
dcubed@3724 | 159 | |
dcubed@3150 | 160 | _JUNK_ := $(shell \ |
dcubed@3150 | 161 | echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") |
dcubed@3724 | 162 | |
dcubed@3724 | 163 | ZIP_DEBUGINFO_FILES ?= 1 |
dcubed@3724 | 164 | |
dcubed@3724 | 165 | _JUNK_ := $(shell \ |
dcubed@3724 | 166 | echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") |
dcubed@3150 | 167 | endif |
dcubed@3150 | 168 | endif |
dcubed@3150 | 169 | |
duke@435 | 170 | JDK_INCLUDE_SUBDIR=solaris |
duke@435 | 171 | |
never@3156 | 172 | # Library suffix |
never@3156 | 173 | LIBRARY_SUFFIX=so |
never@3156 | 174 | |
duke@435 | 175 | # FIXUP: The subdirectory for a debug build is NOT the same on all platforms |
duke@435 | 176 | VM_DEBUG=jvmg |
duke@435 | 177 | |
duke@435 | 178 | EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html |
kvn@1450 | 179 | |
never@3156 | 180 | # client and server subdirectories have symbolic links to ../libjsig.$(LIBRARY_SUFFIX) |
never@3156 | 181 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) |
dcubed@3724 | 182 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 183 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
dcubed@3724 | 184 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.diz |
dcubed@3724 | 185 | else |
dcubed@3724 | 186 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.debuginfo |
dcubed@3724 | 187 | endif |
dcubed@3150 | 188 | endif |
kvn@1450 | 189 | |
duke@435 | 190 | EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server |
kvn@3044 | 191 | EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client |
kvn@3044 | 192 | |
bobv@2036 | 193 | ifneq ($(BUILD_CLIENT_ONLY),true) |
duke@435 | 194 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt |
never@3156 | 195 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX) |
never@3156 | 196 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.$(LIBRARY_SUFFIX) |
never@3156 | 197 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX) |
dcubed@3724 | 198 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 199 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
dcubed@3724 | 200 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.diz |
dcubed@3724 | 201 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.diz |
dcubed@3724 | 202 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.diz |
dcubed@3724 | 203 | else |
dcubed@3724 | 204 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.debuginfo |
dcubed@3724 | 205 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_db.debuginfo |
dcubed@3724 | 206 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm_dtrace.debuginfo |
dcubed@3724 | 207 | endif |
dcubed@3150 | 208 | endif |
bobv@2036 | 209 | endif |
duke@435 | 210 | ifeq ($(ARCH_DATA_MODEL), 32) |
duke@435 | 211 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt |
never@3156 | 212 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) |
never@3156 | 213 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.$(LIBRARY_SUFFIX) |
never@3156 | 214 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.$(LIBRARY_SUFFIX) |
never@3156 | 215 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX) |
never@3156 | 216 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) |
dcubed@3724 | 217 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 218 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
dcubed@3724 | 219 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.diz |
dcubed@3724 | 220 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.diz |
dcubed@3724 | 221 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.diz |
dcubed@3724 | 222 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.diz |
dcubed@3724 | 223 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.diz |
dcubed@3724 | 224 | else |
dcubed@3724 | 225 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.debuginfo |
dcubed@3724 | 226 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_db.debuginfo |
dcubed@3724 | 227 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm_dtrace.debuginfo |
dcubed@3724 | 228 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_db.debuginfo |
dcubed@3724 | 229 | EXPORT_LIST += $(EXPORT_CLIENT_DIR)/64/libjvm_dtrace.debuginfo |
dcubed@3724 | 230 | endif |
dcubed@3150 | 231 | endif |
bobv@2036 | 232 | ifneq ($(BUILD_CLIENT_ONLY), true) |
never@3156 | 233 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.$(LIBRARY_SUFFIX) |
never@3156 | 234 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.$(LIBRARY_SUFFIX) |
dcubed@3724 | 235 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 236 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
dcubed@3724 | 237 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.diz |
dcubed@3724 | 238 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.diz |
dcubed@3724 | 239 | else |
dcubed@3724 | 240 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_db.debuginfo |
dcubed@3724 | 241 | EXPORT_LIST += $(EXPORT_SERVER_DIR)/64/libjvm_dtrace.debuginfo |
dcubed@3724 | 242 | endif |
dcubed@3150 | 243 | endif |
bobv@2036 | 244 | endif |
duke@435 | 245 | endif |
duke@435 | 246 | |
never@3156 | 247 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) |
dcubed@3724 | 248 | ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
dcubed@3724 | 249 | ifeq ($(ZIP_DEBUGINFO_FILES),1) |
dcubed@3724 | 250 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.diz |
dcubed@3724 | 251 | else |
dcubed@3724 | 252 | EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.debuginfo |
dcubed@3724 | 253 | endif |
dcubed@3150 | 254 | endif |
duke@435 | 255 | EXPORT_LIST += $(EXPORT_LIB_DIR)/sa-jdi.jar |