109 _JUNK_ := $(shell \ |
109 _JUNK_ := $(shell \ |
110 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
110 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") |
111 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
111 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later |
112 |
112 |
113 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
113 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) |
114 # Default OBJCOPY comes from GNU Binutils on Linux: |
114 ifndef CROSS_COMPILE_ARCH |
115 DEF_OBJCOPY=/usr/bin/objcopy |
115 # Default OBJCOPY comes from GNU Binutils on Linux: |
116 ifdef CROSS_COMPILE_ARCH |
116 DEF_OBJCOPY=/usr/bin/objcopy |
117 # don't try to generate .debuginfo files when cross compiling |
|
118 _JUNK_ := $(shell \ |
|
119 echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \ |
|
120 "skipping .debuginfo generation.") |
|
121 OBJCOPY= |
|
122 else |
117 else |
123 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
118 # Assume objcopy is part of the cross-compilation toolkit |
124 ifneq ($(ALT_OBJCOPY),) |
119 DEF_OBJCOPY=$(COMPILER_PATH)/objcopy |
125 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") |
120 endif |
126 # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path |
121 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) |
127 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
122 ifneq ($(ALT_OBJCOPY),) |
128 endif |
123 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") |
|
124 # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path |
|
125 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) |
129 endif |
126 endif |
130 |
127 |
131 # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the |
128 # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the |
132 # JDK build to import .debuginfo or .diz files from the HotSpot build. |
129 # JDK build to import .debuginfo or .diz files from the HotSpot build. |
133 # However, adding FDS support to the JDK build will occur in phases |
130 # However, adding FDS support to the JDK build will occur in phases |
135 # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a |
132 # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a |
136 # particular library or program supports FDS. |
133 # particular library or program supports FDS. |
137 |
134 |
138 ifeq ($(OBJCOPY),) |
135 ifeq ($(OBJCOPY),) |
139 _JUNK_ := $(shell \ |
136 _JUNK_ := $(shell \ |
140 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") |
137 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.") |
141 ENABLE_FULL_DEBUG_SYMBOLS=0 |
138 ENABLE_FULL_DEBUG_SYMBOLS=0 |
142 else |
139 else |
143 _JUNK_ := $(shell \ |
140 _JUNK_ := $(shell \ |
144 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") |
141 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") |
145 |
142 |