Mercurial > hg > truffle
comparison make/linux/makefiles/defs.make @ 6932:857f3ce858dd
8002034: Allow Full Debug Symbols when cross-compiling
8001756: Hotspot makefiles report missing OBJCOPY command in the wrong circumstances
Reviewed-by: dcubed, dsamersoff, erikj, collins
author | dholmes |
---|---|
date | Mon, 05 Nov 2012 19:33:44 -0500 |
parents | fb19af007ffc |
children | 1b0dc9f87e75 |
comparison
equal
deleted
inserted
replaced
6931:ca8168203393 | 6932:857f3ce858dd |
---|---|
168 # up by different parts of the build. Just to be clear, we only need | 168 # up by different parts of the build. Just to be clear, we only need |
169 # two variable names because the incoming option value can be | 169 # two variable names because the incoming option value can be |
170 # overridden in some situations, e.g., a BUILD_FLAVOR != product | 170 # overridden in some situations, e.g., a BUILD_FLAVOR != product |
171 # build. | 171 # build. |
172 | 172 |
173 ifeq ($(BUILD_FLAVOR), product) | 173 # Due to the multiple sub-make processes that occur this logic gets |
174 FULL_DEBUG_SYMBOLS ?= 1 | 174 # executed multiple times. We reduce the noise by at least checking that |
175 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) | 175 # BUILD_FLAVOR has been set. |
176 else | 176 ifneq ($(BUILD_FLAVOR),) |
177 # debug variants always get Full Debug Symbols (if available) | 177 ifeq ($(BUILD_FLAVOR), product) |
178 ENABLE_FULL_DEBUG_SYMBOLS = 1 | 178 FULL_DEBUG_SYMBOLS ?= 1 |
179 endif | 179 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) |
180 _JUNK_ := $(shell \ | |
181 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") | |
182 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later | |
183 | |
184 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) | |
185 # Default OBJCOPY comes from GNU Binutils on Linux: | |
186 DEF_OBJCOPY=/usr/bin/objcopy | |
187 ifdef CROSS_COMPILE_ARCH | |
188 # don't try to generate .debuginfo files when cross compiling | |
189 _JUNK_ := $(shell \ | |
190 echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \ | |
191 "skipping .debuginfo generation.") | |
192 OBJCOPY= | |
193 else | 180 else |
181 # debug variants always get Full Debug Symbols (if available) | |
182 ENABLE_FULL_DEBUG_SYMBOLS = 1 | |
183 endif | |
184 _JUNK_ := $(shell \ | |
185 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") | |
186 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later | |
187 | |
188 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) | |
189 # Default OBJCOPY comes from GNU Binutils on Linux | |
190 ifeq ($(CROSS_COMPILE_ARCH),) | |
191 DEF_OBJCOPY=/usr/bin/objcopy | |
192 else | |
193 # Assume objcopy is part of the cross-compilation toolset | |
194 ifneq ($(ALT_COMPILER_PATH),) | |
195 DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy | |
196 endif | |
197 endif | |
194 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) | 198 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
195 ifneq ($(ALT_OBJCOPY),) | 199 ifneq ($(ALT_OBJCOPY),) |
196 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") | 200 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") |
197 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) | 201 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
198 endif | 202 endif |
199 endif | 203 |
200 else | 204 ifeq ($(OBJCOPY),) |
201 OBJCOPY= | 205 _JUNK_ := $(shell \ |
202 endif | 206 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.") |
203 | 207 ENABLE_FULL_DEBUG_SYMBOLS=0 |
204 ifeq ($(OBJCOPY),) | 208 _JUNK_ := $(shell \ |
205 _JUNK_ := $(shell \ | 209 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
206 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") | 210 else |
207 ENABLE_FULL_DEBUG_SYMBOLS=0 | 211 _JUNK_ := $(shell \ |
208 _JUNK_ := $(shell \ | 212 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") |
209 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") | 213 |
210 else | 214 # Library stripping policies for .debuginfo configs: |
211 _JUNK_ := $(shell \ | 215 # all_strip - strips everything from the library |
212 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") | 216 # min_strip - strips most stuff from the library; leaves minimum symbols |
213 | 217 # no_strip - does not strip the library at all |
214 # Library stripping policies for .debuginfo configs: | 218 # |
215 # all_strip - strips everything from the library | 219 # Oracle security policy requires "all_strip". A waiver was granted on |
216 # min_strip - strips most stuff from the library; leaves minimum symbols | 220 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. |
217 # no_strip - does not strip the library at all | 221 # |
218 # | 222 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. |
219 # Oracle security policy requires "all_strip". A waiver was granted on | 223 # |
220 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. | 224 STRIP_POLICY ?= min_strip |
221 # | 225 |
222 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. | 226 _JUNK_ := $(shell \ |
223 # | 227 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") |
224 STRIP_POLICY ?= min_strip | 228 |
225 | 229 ZIP_DEBUGINFO_FILES ?= 1 |
226 _JUNK_ := $(shell \ | 230 |
227 echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") | 231 _JUNK_ := $(shell \ |
228 | 232 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") |
229 ZIP_DEBUGINFO_FILES ?= 1 | 233 endif |
230 | 234 endif # ENABLE_FULL_DEBUG_SYMBOLS=1 |
231 _JUNK_ := $(shell \ | 235 endif # BUILD_FLAVOR |
232 echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") | 236 endif # JDK_6_OR_EARLIER |
233 endif | |
234 endif | |
235 | 237 |
236 JDK_INCLUDE_SUBDIR=linux | 238 JDK_INCLUDE_SUBDIR=linux |
237 | 239 |
238 # Library suffix | 240 # Library suffix |
239 LIBRARY_SUFFIX=so | 241 LIBRARY_SUFFIX=so |