8199347: Always use -Z7 for debug symbols when compiling on Windows
authorihse
Fri, 09 Mar 2018 00:28:50 +0100
changeset 49160 cefb7b496d17
parent 49159 436f1e03fd04
child 49194 ece10494786c
8199347: Always use -Z7 for debug symbols when compiling on Windows Reviewed-by: erikj
make/autoconf/flags-cflags.m4
make/autoconf/spec.gmk.in
make/common/NativeCompilation.gmk
make/hotspot/lib/CompileGtest.gmk
make/hotspot/lib/CompileJvm.gmk
make/lib/Lib-jdk.hotspot.agent.gmk
--- a/make/autoconf/flags-cflags.m4	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/autoconf/flags-cflags.m4	Fri Mar 09 00:28:50 2018 +0100
@@ -117,7 +117,7 @@
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     CFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    CFLAGS_DEBUG_SYMBOLS="-Zi"
+    CFLAGS_DEBUG_SYMBOLS="-Z7 -d2Zi+"
   fi
 
   AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
@@ -130,16 +130,6 @@
       IF_TRUE: [HAS_CFLAG_OPTIMIZE_DEBUG=true],
       IF_FALSE: [HAS_CFLAG_OPTIMIZE_DEBUG=false])
   fi
-
-  # Debug symbols for JVM_CFLAGS
-  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0 -xs"
-  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+"
-  else
-    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
-  fi
-  AC_SUBST(JVM_CFLAGS_SYMBOLS)
 ])
 
 AC_DEFUN([FLAGS_SETUP_WARNINGS],
--- a/make/autoconf/spec.gmk.in	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Fri Mar 09 00:28:50 2018 +0100
@@ -440,7 +440,6 @@
 LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@
 
 JVM_CFLAGS := @JVM_CFLAGS@
-JVM_CFLAGS_SYMBOLS := @JVM_CFLAGS_SYMBOLS@
 JVM_LDFLAGS := @JVM_LDFLAGS@
 JVM_ASFLAGS := @JVM_ASFLAGS@
 JVM_LIBS := @JVM_LIBS@
--- a/make/common/NativeCompilation.gmk	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/common/NativeCompilation.gmk	Fri Mar 09 00:28:50 2018 +0100
@@ -289,13 +289,6 @@
       # Include previously generated dependency information. (if it exists)
       -include $$($1_DEP)
       -include $$($1_DEP_TARGETS)
-
-      ifeq ($(TOOLCHAIN_TYPE), microsoft)
-        # To avoid name clashes between pdbs for objects and libs/execs, put
-        # object pdbs in a separate subdir.
-        $1_DEBUG_OUT_FLAGS := -Fd$$(strip $$(patsubst $$($$($1_BASE)_OBJECT_DIR)/%, \
-            $$($$($1_BASE)_OBJECT_DIR)/pdb/%, $$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_OBJ))))
-      endif
     endif
 
     ifneq ($$(strip $$($1_CFLAGS) $$($1_CXXFLAGS) $$($1_OPTIMIZATION)), )
@@ -307,7 +300,7 @@
     $$($1_OBJ): $$($1_SRC_FILE) $$($$($1_BASE)_COMPILE_VARDEPS_FILE) \
         $$($1_VARDEPS_FILE) | $$($$($1_BASE)_BUILD_INFO)
 	$$(call LogInfo, Compiling $$($1_FILENAME) (for $$($$($1_BASE)_BASENAME)))
-	$$(call MakeDir, $$(@D) $$(@D)/pdb)
+	$$(call MakeDir, $$(@D))
         ifneq ($(TOOLCHAIN_TYPE), microsoft)
           ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s, $$($1_FILENAME)), solstudio)
             # The Solaris studio compiler doesn't output the full path to the
@@ -336,7 +329,7 @@
           # on Windows. No need to save exit code from compilation since
           # pipefail is always active on Windows.
 	  $$(call ExecuteWithLog, $$@, \
-	      $$($1_COMPILER) $$($1_FLAGS) -showIncludes $$($1_DEBUG_OUT_FLAGS) \
+	      $$($1_COMPILER) $$($1_FLAGS) -showIncludes \
 	          $(CC_OUT_OPTION)$$($1_OBJ) $$($1_SRC_FILE)) \
 	      | $(TR) -d '\r' | $(GREP) -v -e "^Note: including file:" \
 	          -e "^$$($1_FILENAME)$$$$" || test "$$$$?" = "1" ; \
@@ -395,7 +388,6 @@
 #   COPY_DEBUG_SYMBOLS Set to false to override global setting of debug symbol copying
 #   ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol
 #       zipping
-#   CFLAGS_DEBUG_SYMBOLS Overrides the default cflags for enabling debug symbols
 #   STRIPFLAGS Optionally change the flags given to the strip command
 #   PRECOMPILED_HEADER Header file to use as precompiled header
 #   PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
@@ -575,9 +567,8 @@
   endif
 
   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
-    $$(call SetIfEmpty, $1_CFLAGS_DEBUG_SYMBOLS, $(CFLAGS_DEBUG_SYMBOLS))
-    $1_EXTRA_CFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
-    $1_EXTRA_CXXFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
+    $1_EXTRA_CFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
+    $1_EXTRA_CXXFLAGS += $$(CFLAGS_DEBUG_SYMBOLS)
   endif
 
   ifneq ($$($1_REORDER), )
--- a/make/hotspot/lib/CompileGtest.gmk	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/hotspot/lib/CompileGtest.gmk	Fri Mar 09 00:28:50 2018 +0100
@@ -81,7 +81,6 @@
     CFLAGS_solaris := -DGTEST_HAS_EXCEPTIONS=0 -library=stlport4, \
     CFLAGS_macosx := -DGTEST_OS_MAC=1, \
     CFLAGS_aix := -qpic=large, \
-    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     DISABLED_WARNINGS_gcc := undef, \
     DISABLED_WARNINGS_clang := undef switch format-nonliteral \
         tautological-undefined-compare $(BUILD_LIBJVM_DISABLED_WARNINGS_clang), \
@@ -114,7 +113,6 @@
     OBJECT_DIR := $(JVM_OUTPUTDIR)/gtest/launcher-objs, \
     CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
         -I$(GTEST_FRAMEWORK_SRC)/include, \
-    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     LDFLAGS := $(LDFLAGS_JDKEXE), \
     LDFLAGS_unix := -L$(JVM_OUTPUTDIR)/gtest $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_solaris := -library=stlport4, \
--- a/make/hotspot/lib/CompileJvm.gmk	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/hotspot/lib/CompileJvm.gmk	Fri Mar 09 00:28:50 2018 +0100
@@ -220,7 +220,6 @@
     EXCLUDE_PATTERNS := $(JVM_EXCLUDE_PATTERNS), \
     EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
     CFLAGS := $(JVM_CFLAGS), \
-    CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     DISABLED_WARNINGS_clang := tautological-compare, \
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Thu Mar 08 22:17:57 2018 +0100
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Fri Mar 09 00:28:50 2018 +0100
@@ -78,7 +78,7 @@
 
 else ifeq ($(OPENJDK_TARGET_OS), windows)
   SA_NAME := sawindbg
-  COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc -FD
+  COMMON_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
   SA_CFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CFLAGS_JDKLIB)) \
       $(COMMON_CFLAGS)
   SA_CXXFLAGS := $(subst -DWIN32_LEAN_AND_MEAN,, $(CXXFLAGS_JDKLIB)) \