116 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 117 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 118 # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value 119 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 120 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 121 _JUNK_ := $(shell \ 122 echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64") 123 OBJCOPY= 124 else 125 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 126 ifneq ($(ALT_OBJCOPY),) 127 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 128 # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path 129 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 130 endif 131 endif 132 133 # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the 134 # JDK build to import .debuginfo or .diz files from the HotSpot build. 135 # However, adding FDS support to the JDK build will occur in phases 136 # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS) 137 # is used to indicate that a particular library supports FDS. 138 139 ifeq ($(OBJCOPY),) 140 _JUNK_ := $(shell \ 141 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") 142 ENABLE_FULL_DEBUG_SYMBOLS=0 143 else 144 _JUNK_ := $(shell \ 145 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") 146 147 # Library stripping policies for .debuginfo configs: 148 # all_strip - strips everything from the library 149 # min_strip - strips most stuff from the library; leaves minimum symbols 150 # no_strip - does not strip the library at all 151 # 152 # Oracle security policy requires "all_strip". A waiver was granted on 153 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. 154 # 155 # 156 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. 157 STRIP_POLICY ?= min_strip 218 # Turn off -g if we are doing tcov build 219 ifdef TCOV_BUILD 220 CFLAGS_DEBUG_OPTION= 221 CXXFLAGS_DEBUG_OPTION= 222 endif 223 224 # FASTDEBUG: Optimize the -g builds, gives us a faster debug java 225 # If true adds -O to the debug compiles. This allows for any assert 226 # tests to remain and debug checking. The resulting code is faster 227 # but less debuggable. Stack traces are still valid, although only 228 # approximate line numbers are given. Printing of local variables 229 # during a debugging session is not possible, but stepping and 230 # printing of global or static variables should be possible. 231 # Performance/size of files should be about the same, maybe smaller. 232 # 233 ifeq ($(FASTDEBUG), true) 234 CFLAGS_DEBUG_OPTION = -g $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 235 CXXFLAGS_DEBUG_OPTION = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 236 endif 237 238 CFLAGS_COMMON = -L$(OBJDIR) 239 240 # Do not allow C99 language features like declarations in code etc. 241 CFLAGS_COMMON += -xc99=%none 242 243 # Allow C++ comments in C code 244 CFLAGS_COMMON += -xCC 245 246 # Show error message tags on errors 247 CFLAGS_COMMON += -errshort=tags 248 CXXFLAGS_COMMON += -errtags=yes 249 250 # Optimization flags 251 CFLAGS_OPT = $(CC_OPT) 252 253 # Debug version flags 254 CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) 255 256 # Required C compiler flags 257 CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) | 116 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 117 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 118 # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value 119 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 120 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 121 _JUNK_ := $(shell \ 122 echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64") 123 OBJCOPY= 124 else 125 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 126 ifneq ($(ALT_OBJCOPY),) 127 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 128 # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path 129 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 130 endif 131 endif 132 133 # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the 134 # JDK build to import .debuginfo or .diz files from the HotSpot build. 135 # However, adding FDS support to the JDK build will occur in phases 136 # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS 137 # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a 138 # particular library or program supports FDS. 139 140 ifeq ($(OBJCOPY),) 141 _JUNK_ := $(shell \ 142 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") 143 ENABLE_FULL_DEBUG_SYMBOLS=0 144 else 145 _JUNK_ := $(shell \ 146 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") 147 148 # Library stripping policies for .debuginfo configs: 149 # all_strip - strips everything from the library 150 # min_strip - strips most stuff from the library; leaves minimum symbols 151 # no_strip - does not strip the library at all 152 # 153 # Oracle security policy requires "all_strip". A waiver was granted on 154 # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE. 155 # 156 # 157 # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled. 158 STRIP_POLICY ?= min_strip 219 # Turn off -g if we are doing tcov build 220 ifdef TCOV_BUILD 221 CFLAGS_DEBUG_OPTION= 222 CXXFLAGS_DEBUG_OPTION= 223 endif 224 225 # FASTDEBUG: Optimize the -g builds, gives us a faster debug java 226 # If true adds -O to the debug compiles. This allows for any assert 227 # tests to remain and debug checking. The resulting code is faster 228 # but less debuggable. Stack traces are still valid, although only 229 # approximate line numbers are given. Printing of local variables 230 # during a debugging session is not possible, but stepping and 231 # printing of global or static variables should be possible. 232 # Performance/size of files should be about the same, maybe smaller. 233 # 234 ifeq ($(FASTDEBUG), true) 235 CFLAGS_DEBUG_OPTION = -g $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 236 CXXFLAGS_DEBUG_OPTION = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 237 endif 238 239 # If Full Debug Symbols is enabled, then we want the same debug and 240 # optimization flags as used by FASTDEBUG. We also want all the 241 # debug info in one place (-xs). 242 # 243 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 244 ifeq ($(LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS),1) 245 ifeq ($(VARIANT), OPT) 246 CC_OPT = -g -xs $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 247 CXX_OPT = -g0 -xs $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL)) 248 endif 249 CFLAGS_DEBUG_OPTION += -xs 250 CXXFLAGS_DEBUG_OPTION += -xs 251 endif 252 endif 253 254 CFLAGS_COMMON = -L$(OBJDIR) 255 256 # Do not allow C99 language features like declarations in code etc. 257 CFLAGS_COMMON += -xc99=%none 258 259 # Allow C++ comments in C code 260 CFLAGS_COMMON += -xCC 261 262 # Show error message tags on errors 263 CFLAGS_COMMON += -errshort=tags 264 CXXFLAGS_COMMON += -errtags=yes 265 266 # Optimization flags 267 CFLAGS_OPT = $(CC_OPT) 268 269 # Debug version flags 270 CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION) 271 272 # Required C compiler flags 273 CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED) |