106 # the same variable name is used, then different values can be picked 107 # up by different parts of the build. Just to be clear, we only need 108 # two variable names because the incoming option value can be 109 # overridden in some situations, e.g., a BUILD_FLAVOR != product 110 # build. 111 112 ifeq ($(BUILD_FLAVOR), product) 113 FULL_DEBUG_SYMBOLS ?= 1 114 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) 115 else 116 # debug variants always get Full Debug Symbols (if available) 117 ENABLE_FULL_DEBUG_SYMBOLS = 1 118 endif 119 _JUNK_ := $(shell \ 120 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 121 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later 122 123 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 124 # Default OBJCOPY comes from the SUNWbinutils package: 125 DEF_OBJCOPY=/usr/sfw/bin/gobjcopy 126 ifeq ($(VM_PLATFORM),solaris_amd64) 127 # On Solaris AMD64/X64, gobjcopy is not happy and fails: 128 # 129 # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so 130 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 131 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 132 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 133 # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value 134 # BFD: stKPaiop: Not enough room for program headers, try linking with -N 135 # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value 136 _JUNK_ := $(shell \ 137 echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64") 138 OBJCOPY= 139 else 140 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 141 ifneq ($(ALT_OBJCOPY),) 142 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 143 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 144 endif 145 endif 146 else 147 OBJCOPY= 148 endif 149 150 ifeq ($(OBJCOPY),) 151 _JUNK_ := $(shell \ 152 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") 153 ENABLE_FULL_DEBUG_SYMBOLS=0 154 _JUNK_ := $(shell \ 155 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 156 else 157 _JUNK_ := $(shell \ 158 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") 159 160 # Library stripping policies for .debuginfo configs: 161 # all_strip - strips everything from the library 162 # min_strip - strips most stuff from the library; leaves minimum symbols 163 # no_strip - does not strip the library at all 164 # 165 # Oracle security policy requires "all_strip". A waiver was granted on | 106 # the same variable name is used, then different values can be picked 107 # up by different parts of the build. Just to be clear, we only need 108 # two variable names because the incoming option value can be 109 # overridden in some situations, e.g., a BUILD_FLAVOR != product 110 # build. 111 112 ifeq ($(BUILD_FLAVOR), product) 113 FULL_DEBUG_SYMBOLS ?= 1 114 ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) 115 else 116 # debug variants always get Full Debug Symbols (if available) 117 ENABLE_FULL_DEBUG_SYMBOLS = 1 118 endif 119 _JUNK_ := $(shell \ 120 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 121 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later 122 123 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 124 # Default OBJCOPY comes from the SUNWbinutils package: 125 DEF_OBJCOPY=/usr/sfw/bin/gobjcopy 126 OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) 127 ifneq ($(ALT_OBJCOPY),) 128 _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") 129 OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) 130 endif 131 else 132 OBJCOPY= 133 endif 134 135 ifeq ($(OBJCOPY),) 136 _JUNK_ := $(shell \ 137 echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.") 138 ENABLE_FULL_DEBUG_SYMBOLS=0 139 _JUNK_ := $(shell \ 140 echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") 141 else 142 _JUNK_ := $(shell \ 143 echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") 144 145 # Library stripping policies for .debuginfo configs: 146 # all_strip - strips everything from the library 147 # min_strip - strips most stuff from the library; leaves minimum symbols 148 # no_strip - does not strip the library at all 149 # 150 # Oracle security policy requires "all_strip". A waiver was granted on |