7158067: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect product builds

Tue, 03 Apr 2012 09:48:34 -0700

author
dcubed
date
Tue, 03 Apr 2012 09:48:34 -0700
changeset 3725
744728c16316
parent 3724
d652a62d6e03
child 3726
74c359c4a9e5
child 3780
7d4e6dabc6bf

7158067: FDS: ENABLE_FULL_DEBUG_SYMBOLS flag should only affect product builds
Summary: Build option FULL_DEBUG_SYMBOLS=0 only affects product builds.
Reviewed-by: ohair, jmelvin, sspitsyn

make/Makefile file | annotate | diff | comparison | revisions
make/linux/Makefile file | annotate | diff | comparison | revisions
make/linux/makefiles/defs.make file | annotate | diff | comparison | revisions
make/solaris/Makefile file | annotate | diff | comparison | revisions
make/solaris/makefiles/defs.make file | annotate | diff | comparison | revisions
make/windows/makefiles/defs.make file | annotate | diff | comparison | revisions
     1.1 --- a/make/Makefile	Fri Mar 23 11:50:33 2012 -0700
     1.2 +++ b/make/Makefile	Tue Apr 03 09:48:34 2012 -0700
     1.3 @@ -136,31 +136,36 @@
     1.4  ifeq ($(OSNAME),windows)
     1.5  	@$(ECHO) "No docs ($(VM_TARGET)) for windows"
     1.6  else
     1.7 +# We specify 'BUILD_FLAVOR=product' so that the proper
     1.8 +# ENABLE_FULL_DEBUG_SYMBOLS value is used.
     1.9  	$(CD) $(OUTPUTDIR); \
    1.10  	    $(MAKE) -f $(ABS_OS_MAKEFILE) \
    1.11 -		      $(MAKE_ARGS) docs
    1.12 +		      $(MAKE_ARGS) BUILD_FLAVOR=product docs
    1.13  endif
    1.14  
    1.15  # Build variation of hotspot
    1.16  $(C1_VM_TARGETS):
    1.17  	$(CD) $(GAMMADIR)/make; \
    1.18 -	$(MAKE) VM_TARGET=$@ generic_build1 $(ALT_OUT)
    1.19 +	$(MAKE) BUILD_FLAVOR=$(@:%1=%) VM_TARGET=$@ generic_build1 $(ALT_OUT)
    1.20  
    1.21  $(C2_VM_TARGETS):
    1.22  	$(CD) $(GAMMADIR)/make; \
    1.23 -	$(MAKE) VM_TARGET=$@ generic_build2 $(ALT_OUT)
    1.24 +	$(MAKE) BUILD_FLAVOR=$@ VM_TARGET=$@ generic_build2 $(ALT_OUT)
    1.25  
    1.26  $(KERNEL_VM_TARGETS):
    1.27  	$(CD) $(GAMMADIR)/make; \
    1.28 -	$(MAKE) VM_TARGET=$@ generic_buildkernel $(ALT_OUT)
    1.29 +	$(MAKE) BUILD_FLAVOR=$(@:%kernel=%) VM_TARGET=$@ \
    1.30 +	  generic_buildkernel $(ALT_OUT)
    1.31  
    1.32  $(ZERO_VM_TARGETS):
    1.33  	$(CD) $(GAMMADIR)/make; \
    1.34 -	$(MAKE) VM_TARGET=$@ generic_buildzero $(ALT_OUT)
    1.35 +	$(MAKE) BUILD_FLAVOR=$(@:%zero=%) VM_TARGET=$@ \
    1.36 +	  generic_buildzero $(ALT_OUT)
    1.37  
    1.38  $(SHARK_VM_TARGETS):
    1.39  	$(CD) $(GAMMADIR)/make; \
    1.40 -	$(MAKE) VM_TARGET=$@ generic_buildshark $(ALT_OUT)
    1.41 +	$(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \
    1.42 +	  generic_buildshark $(ALT_OUT)
    1.43  
    1.44  # Build compiler1 (client) rule, different for platforms
    1.45  generic_build1:
    1.46 @@ -237,25 +242,37 @@
    1.47  # Export file rule
    1.48  generic_export: $(EXPORT_LIST)
    1.49  export_product:
    1.50 -	$(MAKE) VM_SUBDIR=product                            generic_export
    1.51 +	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
    1.52 +          generic_export
    1.53  export_fastdebug:
    1.54 -	$(MAKE) VM_SUBDIR=fastdebug EXPORT_SUBDIR=/fastdebug generic_export
    1.55 +	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
    1.56 +	  EXPORT_SUBDIR=/$(@:export_%=%) \
    1.57 +	  generic_export
    1.58  export_debug:
    1.59 -	$(MAKE) VM_SUBDIR=${VM_DEBUG} EXPORT_SUBDIR=/debug   generic_export
    1.60 +	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=${VM_DEBUG} \
    1.61 +	  EXPORT_SUBDIR=/$(@:export_%=%) \
    1.62 +	  generic_export
    1.63  export_optimized:
    1.64 -	$(MAKE) VM_SUBDIR=optimized EXPORT_SUBDIR=/optimized generic_export
    1.65 +	$(MAKE) BUILD_FLAVOR=$(@:export_%=%) VM_SUBDIR=$(@:export_%=%) \
    1.66 +	  EXPORT_SUBDIR=/$(@:export_%=%) \
    1.67 +	  generic_export
    1.68  export_product_jdk::
    1.69 -	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
    1.70 -		VM_SUBDIR=product                            generic_export
    1.71 +	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
    1.72 +	  VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
    1.73 +	  generic_export
    1.74  export_optimized_jdk::
    1.75 -	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
    1.76 -		VM_SUBDIR=optimized                          generic_export
    1.77 +	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
    1.78 +	  VM_SUBDIR=$(@:export_%_jdk=%) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR) \
    1.79 +	  generic_export
    1.80  export_fastdebug_jdk::
    1.81 -	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/fastdebug \
    1.82 -		VM_SUBDIR=fastdebug                          generic_export
    1.83 +	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) \
    1.84 +	  VM_SUBDIR=$(@:export_%_jdk=%)  \
    1.85 +	  ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
    1.86 +	  generic_export
    1.87  export_debug_jdk::
    1.88 -	$(MAKE) ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/debug \
    1.89 -		VM_SUBDIR=${VM_DEBUG}                        generic_export
    1.90 +	$(MAKE) BUILD_FLAVOR=$(@:export_%_jdk=%) VM_SUBDIR=${VM_DEBUG} \
    1.91 +	  ALT_EXPORT_PATH=$(JDK_IMAGE_DIR)/$(@:export_%_jdk=%) \
    1.92 +	  generic_export
    1.93  
    1.94  # Export file copy rules
    1.95  XUSAGE=$(HS_SRC_DIR)/share/vm/Xusage.txt
     2.1 --- a/make/linux/Makefile	Fri Mar 23 11:50:33 2012 -0700
     2.2 +++ b/make/linux/Makefile	Tue Apr 03 09:48:34 2012 -0700
     2.3 @@ -337,9 +337,11 @@
     2.4  
     2.5  # Doc target.  This is the same for all build options.
     2.6  #     Hence create a docs directory beside ...$(ARCH)_[...]
     2.7 +# We specify 'BUILD_FLAVOR=product' so that the proper
     2.8 +# ENABLE_FULL_DEBUG_SYMBOLS value is used.
     2.9  docs: checks
    2.10  	$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
    2.11 -	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
    2.12 +	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
    2.13  
    2.14  # Synonyms for win32-like targets.
    2.15  compiler2:  jvmg product
     3.1 --- a/make/linux/makefiles/defs.make	Fri Mar 23 11:50:33 2012 -0700
     3.2 +++ b/make/linux/makefiles/defs.make	Tue Apr 03 09:48:34 2012 -0700
     3.3 @@ -130,9 +130,37 @@
     3.4  
     3.5  ifeq ($(JDK6_OR_EARLIER),0)
     3.6    # Full Debug Symbols is supported on JDK7 or newer.
     3.7 -  # Default is enabled with .debuginfo files ZIP'ed to save space.
     3.8 +  # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
     3.9 +  # builds is enabled with debug info files ZIP'ed to save space. For
    3.10 +  # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
    3.11 +  # debug build without debug info isn't very useful.
    3.12 +  # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
    3.13 +  #
    3.14 +  # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
    3.15 +  # disabled for a BUILD_FLAVOR == product build.
    3.16 +  #
    3.17 +  # Note: Use of a different variable name for the FDS override option
    3.18 +  # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
    3.19 +  # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
    3.20 +  # in options via environment variables, use of distinct variables
    3.21 +  # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
    3.22 +  # product build, the FULL_DEBUG_SYMBOLS environment variable will be
    3.23 +  # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
    3.24 +  # the same variable name is used, then different values can be picked
    3.25 +  # up by different parts of the build. Just to be clear, we only need
    3.26 +  # two variable names because the incoming option value can be
    3.27 +  # overridden in some situations, e.g., a BUILD_FLAVOR != product
    3.28 +  # build.
    3.29  
    3.30 -  ENABLE_FULL_DEBUG_SYMBOLS ?= 1
    3.31 +  ifeq ($(BUILD_FLAVOR), product)
    3.32 +    FULL_DEBUG_SYMBOLS ?= 1
    3.33 +    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
    3.34 +  else
    3.35 +    # debug variants always get Full Debug Symbols (if available)
    3.36 +    ENABLE_FULL_DEBUG_SYMBOLS = 1
    3.37 +  endif
    3.38 +  _JUNK_ := $(shell \
    3.39 +    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
    3.40    # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
    3.41  
    3.42    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    3.43 @@ -159,6 +187,8 @@
    3.44      _JUNK_ := $(shell \
    3.45        echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
    3.46      ENABLE_FULL_DEBUG_SYMBOLS=0
    3.47 +    _JUNK_ := $(shell \
    3.48 +      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
    3.49    else
    3.50      _JUNK_ := $(shell \
    3.51        echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
     4.1 --- a/make/solaris/Makefile	Fri Mar 23 11:50:33 2012 -0700
     4.2 +++ b/make/solaris/Makefile	Tue Apr 03 09:48:34 2012 -0700
     4.3 @@ -278,9 +278,11 @@
     4.4  
     4.5  # Doc target.  This is the same for all build options.
     4.6  #     Hence create a docs directory beside ...$(ARCH)_[...]
     4.7 +# We specify 'BUILD_FLAVOR=product' so that the proper
     4.8 +# ENABLE_FULL_DEBUG_SYMBOLS value is used.
     4.9  docs: checks
    4.10  	$(QUIETLY) mkdir -p $(SUBDIR_DOCS)
    4.11 -	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
    4.12 +	$(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) BUILD_FLAVOR=product jvmtidocs
    4.13  
    4.14  # Synonyms for win32-like targets.
    4.15  compiler2:  jvmg product
     5.1 --- a/make/solaris/makefiles/defs.make	Fri Mar 23 11:50:33 2012 -0700
     5.2 +++ b/make/solaris/makefiles/defs.make	Tue Apr 03 09:48:34 2012 -0700
     5.3 @@ -75,9 +75,37 @@
     5.4  
     5.5  ifeq ($(JDK6_OR_EARLIER),0)
     5.6    # Full Debug Symbols is supported on JDK7 or newer.
     5.7 -  # Default is enabled with .debuginfo files ZIP'ed to save space.
     5.8 +  # The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
     5.9 +  # builds is enabled with debug info files ZIP'ed to save space. For
    5.10 +  # BUILD_FLAVOR != product builds, FDS is always enabled, after all a
    5.11 +  # debug build without debug info isn't very useful.
    5.12 +  # The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
    5.13 +  #
    5.14 +  # If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
    5.15 +  # disabled for a BUILD_FLAVOR == product build.
    5.16 +  #
    5.17 +  # Note: Use of a different variable name for the FDS override option
    5.18 +  # versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
    5.19 +  # versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
    5.20 +  # in options via environment variables, use of distinct variables
    5.21 +  # prevents strange behaviours. For example, in a BUILD_FLAVOR !=
    5.22 +  # product build, the FULL_DEBUG_SYMBOLS environment variable will be
    5.23 +  # 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
    5.24 +  # the same variable name is used, then different values can be picked
    5.25 +  # up by different parts of the build. Just to be clear, we only need
    5.26 +  # two variable names because the incoming option value can be
    5.27 +  # overridden in some situations, e.g., a BUILD_FLAVOR != product
    5.28 +  # build.
    5.29  
    5.30 -  ENABLE_FULL_DEBUG_SYMBOLS ?= 1
    5.31 +  ifeq ($(BUILD_FLAVOR), product)
    5.32 +    FULL_DEBUG_SYMBOLS ?= 1
    5.33 +    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
    5.34 +  else
    5.35 +    # debug variants always get Full Debug Symbols (if available)
    5.36 +    ENABLE_FULL_DEBUG_SYMBOLS = 1
    5.37 +  endif
    5.38 +  _JUNK_ := $(shell \
    5.39 +    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
    5.40    # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
    5.41  
    5.42    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
    5.43 @@ -111,6 +139,8 @@
    5.44      _JUNK_ := $(shell \
    5.45        echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
    5.46      ENABLE_FULL_DEBUG_SYMBOLS=0
    5.47 +    _JUNK_ := $(shell \
    5.48 +      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
    5.49    else
    5.50      _JUNK_ := $(shell \
    5.51        echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
     6.1 --- a/make/windows/makefiles/defs.make	Fri Mar 23 11:50:33 2012 -0700
     6.2 +++ b/make/windows/makefiles/defs.make	Tue Apr 03 09:48:34 2012 -0700
     6.3 @@ -109,9 +109,37 @@
     6.4  
     6.5  # Full Debug Symbols has been enabled on Windows since JDK1.4.1 so
     6.6  # there is no need for an "earlier than JDK7 check".
     6.7 -# Default is enabled with debug info files ZIP'ed to save space.
     6.8 +# The Full Debug Symbols (FDS) default for BUILD_FLAVOR == product
     6.9 +# builds is enabled with debug info files ZIP'ed to save space. For
    6.10 +# BUILD_FLAVOR != product builds, FDS is always enabled, after all a
    6.11 +# debug build without debug info isn't very useful.
    6.12 +# The ZIP_DEBUGINFO_FILES option only has meaning when FDS is enabled.
    6.13 +#
    6.14 +# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be
    6.15 +# disabled for a BUILD_FLAVOR == product build.
    6.16 +#
    6.17 +# Note: Use of a different variable name for the FDS override option
    6.18 +# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS
    6.19 +# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass
    6.20 +# in options via environment variables, use of distinct variables
    6.21 +# prevents strange behaviours. For example, in a BUILD_FLAVOR !=
    6.22 +# product build, the FULL_DEBUG_SYMBOLS environment variable will be
    6.23 +# 0, but the ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If
    6.24 +# the same variable name is used, then different values can be picked
    6.25 +# up by different parts of the build. Just to be clear, we only need
    6.26 +# two variable names because the incoming option value can be
    6.27 +# overridden in some situations, e.g., a BUILD_FLAVOR != product
    6.28 +# build.
    6.29  
    6.30 -ENABLE_FULL_DEBUG_SYMBOLS ?= 1
    6.31 +ifeq ($(BUILD_FLAVOR), product)
    6.32 +  FULL_DEBUG_SYMBOLS ?= 1
    6.33 +  ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
    6.34 +else
    6.35 +  # debug variants always get Full Debug Symbols (if available)
    6.36 +  ENABLE_FULL_DEBUG_SYMBOLS = 1
    6.37 +endif
    6.38 +_JUNK_ := $(shell \
    6.39 +  echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
    6.40  MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
    6.41  
    6.42  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)

mercurial