137 JVM_VARIANTS:=server |
137 JVM_VARIANTS:=server |
138 JVM_VARIANT_SERVER:=true |
138 JVM_VARIANT_SERVER:=true |
139 endif |
139 endif |
140 endif |
140 endif |
141 |
141 |
142 # determine if HotSpot is being built in JDK6 or earlier version |
142 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product |
143 JDK6_OR_EARLIER=0 |
143 # builds is enabled with debug info files ZIP'ed to save space. For |
144 ifeq "$(shell expr \( '$(JDK_MAJOR_VERSION)' != '' \& '$(JDK_MINOR_VERSION)' != '' \& '$(JDK_MICRO_VERSION)' != '' \))" "1" |
144 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a |
145 # if the longer variable names (newer build style) are set, then check those |
145 # debug build without debug info isn't very useful. |
146 ifeq "$(shell expr \( $(JDK_MAJOR_VERSION) = 1 \& $(JDK_MINOR_VERSION) \< 7 \))" "1" |
146 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. |
147 JDK6_OR_EARLIER=1 |
147 # |
148 endif |
148 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be |
149 else |
149 # disabled for a BUILD_FLAVOR == product build. |
150 # the longer variables aren't set so check the shorter variable names |
150 # |
151 ifeq "$(shell expr \( '$(JDK_MAJOR_VER)' = 1 \& '$(JDK_MINOR_VER)' \< 7 \))" "1" |
151 # Note: Use of a different variable name for the FDS override option |
152 JDK6_OR_EARLIER=1 |
152 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS |
153 endif |
153 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass |
154 endif |
154 # in options via environment variables, use of distinct variables |
155 |
155 # prevents strange behaviours. For example, in a BUILD_FLAVOR != |
156 ifeq ($(JDK6_OR_EARLIER),0) |
156 # product build, the FULL_DEBUG_SYMBOLS environment variable will be |
157 # Full Debug Symbols is supported on JDK7 or newer. |
157 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If |
158 # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product |
158 # the same variable name is used, then different values can be picked |
159 # builds is enabled with debug info files ZIP'ed to save space. For |
159 # up by different parts of the build. Just to be clear, we only need |
160 # BUILD_FLAVOR != product builds, FDS is always enabled, after all a |
160 # two variable names because the incoming option value can be |
161 # debug build without debug info isn't very useful. |
161 # overridden in some situations, e.g., a BUILD_FLAVOR != product |
162 # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled. |
162 # build. |
163 # |
163 |
164 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be |
164 # Due to the multiple sub-make processes that occur this logic gets |
165 # disabled for a BUILD_FLAVOR == product build. |
165 # executed multiple times. We reduce the noise by at least checking that |
166 # |
166 # BUILD_FLAVOR has been set. |
167 # Note: Use of a different variable name for the FDS override option |
167 ifneq ($(BUILD_FLAVOR),) |
168 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS |
168 ifeq ($(BUILD_FLAVOR), product) |
169 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass |
169 FULL_DEBUG_SYMBOLS ?= 1 |
170 # in options via environment variables, use of distinct variables |
170 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) |
171 # prevents strange behaviours. For example, in a BUILD_FLAVOR != |
171 else |
172 # product build, the FULL_DEBUG_SYMBOLS environment variable will be |
172 # debug variants always get Full Debug Symbols (if available) |
173 # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If |
173 ENABLE_FULL_DEBUG_SYMBOLS = 1 |
174 # the same variable name is used, then different values can be picked |
174 endif |
175 # up by different parts of the build. Just to be clear, we only need |
175 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) |
176 # two variable names because the incoming option value can be |
176 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
177 # overridden in some situations, e.g., a BUILD_FLAVOR != product |
177 |
178 # build. |
178 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
179 |
179 # Default OBJCOPY comes from GNU Binutils on Linux |
180 # Due to the multiple sub-make processes that occur this logic gets |
180 ifeq ($(CROSS_COMPILE_ARCH),) |
181 # executed multiple times. We reduce the noise by at least checking that |
181 DEF_OBJCOPY=/usr/bin/objcopy |
182 # BUILD_FLAVOR has been set. |
182 else |
183 ifneq ($(BUILD_FLAVOR),) |
183 # Assume objcopy is part of the cross-compilation toolset |
184 ifeq ($(BUILD_FLAVOR), product) |
184 ifneq ($(ALT_COMPILER_PATH),) |
185 FULL_DEBUG_SYMBOLS ?= 1 |
185 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy |
186 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) |
|
187 else |
|
188 # debug variants always get Full Debug Symbols (if available) |
|
189 ENABLE_FULL_DEBUG_SYMBOLS = 1 |
|
190 endif |
|
191 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) |
|
192 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
|
193 |
|
194 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
|
195 # Default OBJCOPY comes from GNU Binutils on Linux |
|
196 ifeq ($(CROSS_COMPILE_ARCH),) |
|
197 DEF_OBJCOPY=/usr/bin/objcopy |
|
198 else |
|
199 # Assume objcopy is part of the cross-compilation toolset |
|
200 ifneq ($(ALT_COMPILER_PATH),) |
|
201 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy |
|
202 endif |
|
203 endif |
186 endif |
204 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
187 endif |
205 ifneq ($(ALT_OBJCOPY),) |
188 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
206 $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)")) |
189 ifneq ($(ALT_OBJCOPY),) |
207 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
190 $(eval $(call print_info, "ALT_OBJCOPY=$(ALT_OBJCOPY)")) |
208 endif |
191 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
209 |
192 endif |
210 ifeq ($(OBJCOPY),) |
193 |
211 $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")) |
194 ifeq ($(OBJCOPY),) |
212 ENABLE_FULL_DEBUG_SYMBOLS=0 |
195 $(eval $(call print_info, "no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")) |
213 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) |
196 ENABLE_FULL_DEBUG_SYMBOLS=0 |
214 else |
197 $(eval $(call print_info, "ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")) |
215 $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files.")) |
198 else |
216 |
199 $(eval $(call print_info, "$(OBJCOPY) cmd found so will create .debuginfo files.")) |
217 # Library stripping policies for .debuginfo configs: |
200 |
218 # all_strip - strips everything from the library |
201 # Library stripping policies for .debuginfo configs: |
219 # min_strip - strips most stuff from the library; leaves minimum symbols |
202 # all_strip - strips everything from the library |
220 # no_strip - does not strip the library at all |
203 # min_strip - strips most stuff from the library; leaves minimum symbols |
221 # |
204 # no_strip - does not strip the library at all |
222 # Oracle security policy requires "all_strip". A waiver was granted on |
205 # |
223 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. |
206 # Oracle security policy requires "all_strip". A waiver was granted on |
224 # |
207 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. |
225 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. |
208 # |
226 # |
209 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. |
227 STRIP_POLICY ?= min_strip |
210 # |
228 |
211 STRIP_POLICY ?= min_strip |
229 $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)")) |
212 |
230 |
213 $(eval $(call print_info, "STRIP_POLICY=$(STRIP_POLICY)")) |
231 ZIP_DEBUGINFO_FILES ?= 1 |
214 |
232 |
215 ZIP_DEBUGINFO_FILES ?= 1 |
233 $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")) |
216 |
234 endif |
217 $(eval $(call print_info, "ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")) |
235 endif # ENABLE_FULL_DEBUG_SYMBOLS=1 |
218 endif |
236 endif # BUILD_FLAVOR |
219 endif # ENABLE_FULL_DEBUG_SYMBOLS=1 |
237 endif # JDK_6_OR_EARLIER |
220 endif # BUILD_FLAVOR |
238 |
221 |
239 JDK_INCLUDE_SUBDIR=linux |
222 JDK_INCLUDE_SUBDIR=linux |
240 |
223 |
241 # Library suffix |
224 # Library suffix |
242 LIBRARY_SUFFIX=so |
225 LIBRARY_SUFFIX=so |