8199338: Use -g0 on solstudio also for compiling C programs
authorihse
Thu, 08 Mar 2018 18:46:37 +0100
changeset 49155 7cd937277d5e
parent 49154 28729cf7e4bc
child 49156 6aaf3aef2d67
8199338: Use -g0 on solstudio also for compiling C programs 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
--- a/make/autoconf/flags-cflags.m4	Thu Mar 08 08:17:26 2018 -0800
+++ b/make/autoconf/flags-cflags.m4	Thu Mar 08 18:46:37 2018 +0100
@@ -116,21 +116,15 @@
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
     CFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    CFLAGS_DEBUG_SYMBOLS="-g -xs"
     # -g0 enables debug symbols without disabling inlining.
-    CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
+    CFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     CFLAGS_DEBUG_SYMBOLS="-g"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     CFLAGS_DEBUG_SYMBOLS="-Zi"
   fi
 
-  if test "x$CXXFLAGS_DEBUG_SYMBOLS" = x; then
-    # If we did not specify special flags for C++, use C version
-    CXXFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS"
-  fi
   AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
-  AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
 
   # FIXME: This was never used in the old build. What to do with it?
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
@@ -143,13 +137,7 @@
 
   # Debug symbols for JVM_CFLAGS
   if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs"
-    if test "x$DEBUG_LEVEL" = xslowdebug; then
-      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
-    else
-      # -g0 does not disable inlining, which -g does.
-      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0"
-    fi
+    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0 -xs"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+"
   else
@@ -496,7 +484,6 @@
   if test "x$DEBUG_LEVEL" != xrelease; then
     DEBUG_OPTIONS_FLAGS_JDK="$CFLAGS_DEBUG_OPTIONS"
     DEBUG_SYMBOLS_CFLAGS_JDK="$CFLAGS_DEBUG_SYMBOLS"
-    DEBUG_SYMBOLS_CXXFLAGS_JDK="$CXXFLAGS_DEBUG_SYMBOLS"
   fi
 
   #### TOOLCHAIN DEFINES
@@ -556,6 +543,12 @@
     TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
     TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
         -library=stlport4 -mt -features=no%except"
+    if test "x$DEBUG_LEVEL" = xslowdebug; then
+      # Previously -g was used instead of -g0 for slowdebug; this is equivalent
+      # to setting +d.
+      TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM +d"
+    fi
+
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt"  # add on both CFLAGS
     TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \
@@ -825,16 +818,16 @@
 
   CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
       $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
-      $WARNING_CFLAGS $WARNING_CFLAGS_JDK"
+      $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK"
 
   # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
   # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
   # change in the future.)
 
-  CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY $DEBUG_SYMBOLS_CFLAGS_JDK \
+  CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY  \
       $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
   CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
-      $DEBUG_SYMBOLS_CXXFLAGS_JDK $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
+      $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
 
   $1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
   $1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}"
--- a/make/autoconf/spec.gmk.in	Thu Mar 08 08:17:26 2018 -0800
+++ b/make/autoconf/spec.gmk.in	Thu Mar 08 18:46:37 2018 +0100
@@ -532,7 +532,6 @@
 ZIP_EXTERNAL_DEBUG_SYMBOLS := @ZIP_EXTERNAL_DEBUG_SYMBOLS@
 
 CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
-CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
 
 #
 # Compress (or not) jars
--- a/make/common/NativeCompilation.gmk	Thu Mar 08 08:17:26 2018 -0800
+++ b/make/common/NativeCompilation.gmk	Thu Mar 08 18:46:37 2018 +0100
@@ -396,7 +396,6 @@
 #   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
-#   CXXFLAGS_DEBUG_SYMBOLS Overrides the default cxxflags 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
@@ -577,9 +576,8 @@
 
   ifeq ($(COMPILE_WITH_DEBUG_SYMBOLS), true)
     $$(call SetIfEmpty, $1_CFLAGS_DEBUG_SYMBOLS, $(CFLAGS_DEBUG_SYMBOLS))
-    $$(call SetIfEmpty, $1_CXXFLAGS_DEBUG_SYMBOLS, $(CXXFLAGS_DEBUG_SYMBOLS))
     $1_EXTRA_CFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
-    $1_EXTRA_CXXFLAGS += $$($1_CXXFLAGS_DEBUG_SYMBOLS)
+    $1_EXTRA_CXXFLAGS += $$($1_CFLAGS_DEBUG_SYMBOLS)
   endif
 
   ifneq ($$($1_REORDER), )
--- a/make/hotspot/lib/CompileGtest.gmk	Thu Mar 08 08:17:26 2018 -0800
+++ b/make/hotspot/lib/CompileGtest.gmk	Thu Mar 08 18:46:37 2018 +0100
@@ -82,7 +82,6 @@
     CFLAGS_macosx := -DGTEST_OS_MAC=1, \
     CFLAGS_aix := -qpic=large, \
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
-    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     DISABLED_WARNINGS_gcc := undef, \
     DISABLED_WARNINGS_clang := undef switch format-nonliteral \
         tautological-undefined-compare $(BUILD_LIBJVM_DISABLED_WARNINGS_clang), \
@@ -116,7 +115,6 @@
     CFLAGS := $(JVM_CFLAGS) -I$(GTEST_FRAMEWORK_SRC) \
         -I$(GTEST_FRAMEWORK_SRC)/include, \
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
-    CXXFLAGS_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 08:17:26 2018 -0800
+++ b/make/hotspot/lib/CompileJvm.gmk	Thu Mar 08 18:46:37 2018 +0100
@@ -221,7 +221,6 @@
     EXTRA_OBJECT_FILES := $(DTRACE_EXTRA_OBJECT_FILES), \
     CFLAGS := $(JVM_CFLAGS), \
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
-    CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     DISABLED_WARNINGS_clang := tautological-compare, \