make/common/Defs-solaris.gmk

Print this page




  82 # enabled with debug info files ZIP'ed to save space. For VARIANT !=
  83 # OPT builds, FDS is always enabled, after all a debug build without
  84 # debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has
  85 # meaning when FDS is enabled.
  86 #
  87 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
  88 # disabled for a VARIANT == OPT build.
  89 #
  90 # Note: Use of a different variable name for the FDS override option
  91 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
  92 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
  93 # in options via environment variables, use of distinct variables
  94 # prevents strange behaviours. For example, in a VARIANT != OPT build,
  95 # the FULL_DEBUG_SYMBOLS environment variable will be 0, but the
  96 # ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same
  97 # variable name is used, then different values can be picked up by
  98 # different parts of the build. Just to be clear, we only need two
  99 # variable names because the incoming option value can be overridden
 100 # in some situations, e.g., a VARIANT != OPT build.
 101 



 102 ifeq ($(VARIANT), OPT)
 103   FULL_DEBUG_SYMBOLS ?= 1
 104   ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 105 else
 106   # debug variants always get Full Debug Symbols (if available)
 107   ENABLE_FULL_DEBUG_SYMBOLS = 1
 108 endif
 109 _JUNK_ := $(shell \
 110   echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 111 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 112 
 113 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 114   # Default OBJCOPY comes from the SUNWbinutils package:
 115   DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
 116   ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
 117     # On Solaris AMD64/X64, gobjcopy is not happy and fails:
 118     #
 119     # usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
 120     # BFD: stKPaiop: Not enough room for program headers, try linking with -N
 121     # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
 122     # BFD: stKPaiop: Not enough room for program headers, try linking with -N
 123     # /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
 124     # BFD: stKPaiop: Not enough room for program headers, try linking with -N
 125     # /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
 126     _JUNK_ := $(shell \
 127       echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
 128     OBJCOPY=
 129   else
 130     OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 131     ifneq ($(ALT_OBJCOPY),)
 132       _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
 133       # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
 134       OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 135     endif
 136   endif
 137 
 138   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
 139   # JDK build to import .debuginfo or .diz files from the HotSpot build.
 140   # However, adding FDS support to the JDK build will occur in phases
 141   # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
 142   # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a
 143   # particular library or program supports FDS.
 144 
 145   ifeq ($(OBJCOPY),)
 146     _JUNK_ := $(shell \
 147       echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
 148     ENABLE_FULL_DEBUG_SYMBOLS=0
 149   else
 150     _JUNK_ := $(shell \
 151       echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 152 
 153     # Library stripping policies for .debuginfo configs:
 154     #   all_strip - strips everything from the library
 155     #   min_strip - strips most stuff from the library; leaves minimum symbols
 156     #   no_strip  - does not strip the library at all




  82 # enabled with debug info files ZIP'ed to save space. For VARIANT !=
  83 # OPT builds, FDS is always enabled, after all a debug build without
  84 # debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has
  85 # meaning when FDS is enabled.
  86 #
  87 # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
  88 # disabled for a VARIANT == OPT build.
  89 #
  90 # Note: Use of a different variable name for the FDS override option
  91 # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
  92 # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
  93 # in options via environment variables, use of distinct variables
  94 # prevents strange behaviours. For example, in a VARIANT != OPT build,
  95 # the FULL_DEBUG_SYMBOLS environment variable will be 0, but the
  96 # ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same
  97 # variable name is used, then different values can be picked up by
  98 # different parts of the build. Just to be clear, we only need two
  99 # variable names because the incoming option value can be overridden
 100 # in some situations, e.g., a VARIANT != OPT build.
 101 
 102 ADD_GNU_DEBUGLINK = $(ABS_BUILDTOOLBINDIR)/add_gnu_debuglink
 103 FIX_EMPTY_SEC_HDR_FLAGS = $(ABS_BUILDTOOLBINDIR)/fix_empty_sec_hdr_flags
 104 
 105 ifeq ($(VARIANT), OPT)
 106   FULL_DEBUG_SYMBOLS ?= 1
 107   ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
 108 else
 109   # debug variants always get Full Debug Symbols (if available)
 110   ENABLE_FULL_DEBUG_SYMBOLS = 1
 111 endif
 112 _JUNK_ := $(shell \
 113   echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
 114 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 115 
 116 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 117   # Default OBJCOPY comes from the SUNWbinutils package:
 118   DEF_OBJCOPY=/usr/sfw/bin/gobjcopy














 119   OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
 120   ifneq ($(ALT_OBJCOPY),)
 121     _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
 122     # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
 123     OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
 124   endif

 125 
 126   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
 127   # JDK build to import .debuginfo or .diz files from the HotSpot build.
 128   # However, adding FDS support to the JDK build will occur in phases
 129   # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
 130   # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a
 131   # particular library or program supports FDS.
 132 
 133   ifeq ($(OBJCOPY),)
 134     _JUNK_ := $(shell \
 135       echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
 136     ENABLE_FULL_DEBUG_SYMBOLS=0
 137   else
 138     _JUNK_ := $(shell \
 139       echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 140 
 141     # Library stripping policies for .debuginfo configs:
 142     #   all_strip - strips everything from the library
 143     #   min_strip - strips most stuff from the library; leaves minimum symbols
 144     #   no_strip  - does not strip the library at all