8170280: Enable -g for all java compilation in the build
authorerikj
Thu, 24 Nov 2016 11:50:26 +0100
changeset 42140 a2ea75dd99dc
parent 42139 7694194761a4
child 42141 06c697759688
8170280: Enable -g for all java compilation in the build Reviewed-by: simonis, tbell, dholmes, ihse
common/autoconf/flags.m4
common/autoconf/generated-configure.sh
make/Images.gmk
make/common/JavaCompilation.gmk
--- a/common/autoconf/flags.m4	Wed Nov 23 19:14:43 2016 +0000
+++ b/common/autoconf/flags.m4	Thu Nov 24 11:50:26 2016 +0100
@@ -838,7 +838,6 @@
     fastdebug | slowdebug )
       $2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
--- a/common/autoconf/generated-configure.sh	Wed Nov 23 19:14:43 2016 +0000
+++ b/common/autoconf/generated-configure.sh	Thu Nov 24 11:50:26 2016 +0100
@@ -5093,7 +5093,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1479822431
+DATE_WHEN_GENERATED=1479984616
 
 ###############################################################################
 #
@@ -50022,7 +50022,6 @@
     fastdebug | slowdebug )
       CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
@@ -50846,7 +50845,6 @@
     fastdebug | slowdebug )
       OPENJDK_BUILD_CFLAGS_JDK="$OPENJDK_BUILD_CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
       OPENJDK_BUILD_CXXFLAGS_JDK="$OPENJDK_BUILD_CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
-      JAVAC_FLAGS="$JAVAC_FLAGS -g"
       ;;
     release )
       ;;
--- a/make/Images.gmk	Wed Nov 23 19:14:43 2016 +0000
+++ b/make/Images.gmk	Thu Nov 24 11:50:26 2016 +0100
@@ -131,7 +131,7 @@
     $(JLINK_JLI_CLASSES) \
     #
 
-JLINK_JRE_EXTRA_OPTS := --no-man-pages --no-header-files
+JLINK_JRE_EXTRA_OPTS := --no-man-pages --no-header-files --strip-debug
 
 ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
   JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
--- a/make/common/JavaCompilation.gmk	Wed Nov 23 19:14:43 2016 +0000
+++ b/make/common/JavaCompilation.gmk	Thu Nov 24 11:50:26 2016 +0100
@@ -172,6 +172,7 @@
 #   KEEP_DUPS:=Do not remove duplicate file names from different source roots.
 #   FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
 #        default is true.
+#   DEBUG_SYMBOLS:=Set to false to disable generation of debug symbols.
 SetupJavaCompilation = $(NamedParamsMacroTemplate)
 define SetupJavaCompilationBody
 
@@ -183,7 +184,11 @@
   # Extract the info from the java compiler setup.
   $1_JVM := $$($$($1_SETUP)_JVM)
   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
-  $1_FLAGS := $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
+  $1_FLAGS :=
+  ifneq ($$($1_DEBUG_SYMBOLS), false)
+    $1_FLAGS := -g
+  endif
+  $1_FLAGS += $$($$($1_SETUP)_FLAGS) $$($1_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS)
   ifneq ($$($1_CLASSPATH), )
     $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
   endif