Clean up solstudio warning handling. ihse-cflags-rewrite-branch
authorihse
Thu, 01 Mar 2018 15:24:17 +0100
branchihse-cflags-rewrite-branch
changeset 56219 852414e4ae77
parent 56217 e550367df595
child 56220 608e332e33e8
Clean up solstudio warning handling.
make/autoconf/flags-cflags.m4
make/autoconf/spec.gmk.in
make/common/NativeCompilation.gmk
make/hotspot/lib/CompileJvm.gmk
make/mapfiles/libjava/reorder-sparc
make/mapfiles/libjava/reorder-sparcv9
make/mapfiles/libjava/reorder-x86
--- a/make/autoconf/flags-cflags.m4	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/autoconf/flags-cflags.m4	Thu Mar 01 15:24:17 2018 +0100
@@ -187,8 +187,14 @@
       ;;
     solstudio)
       DISABLE_WARNING_PREFIX="-erroff="
-      CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
+      CFLAGS_WARNINGS_ARE_ERRORS="-errwarn=%all"
       LDFLAGS_WARNINGS_ARE_ERRORS="-Wl,-z,fatal-warnings"
+
+      WARNINGS_ENABLE_ALL_CFLAGS="-v -fd -xtransition"
+      WARNINGS_ENABLE_ALL_CXXFLAGS="-+w +w2"
+
+      DISABLED_WARNINGS_C="E_OLD_STYLE_FUNC_DECL E_OLD_STYLE_FUNC_DEF E_SEMANTICS_OF_OP_CHG_IN_ANSI_C E_NO_REPLACEMENT_IN_STRING"
+      DISABLED_WARNINGS_CXX="inllargeuse doubunder notused wemptydecl wunreachable"
       ;;
     gcc)
       # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
@@ -237,6 +243,8 @@
   AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
   AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
   AC_SUBST(LDFLAGS_WARNINGS_ARE_ERRORS)
+  AC_SUBST(DISABLED_WARNINGS_C)
+  AC_SUBST(DISABLED_WARNINGS_CXX)
 ])
 
 AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
@@ -554,11 +562,14 @@
       TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    TOOLCHAIN_CFLAGS_JDK="-mt"
-    TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -v -W0,-noglobal" # C only
+    TOOLCHAIN_FLAGS="-errtags -errfmt"
+    TOOLCHAIN_CFLAGS="-errshort=tags"
+
+    TOOLCHAIN_CFLAGS_JDK="-mt $(TOOLCHAIN_FLAGS)"
+    TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -W0,-noglobal $(TOOLCHAIN_CFLAGS)" # C only
     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"
+        -library=stlport4 -mt -features=no%except $(TOOLCHAIN_FLAGS)"
   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
     TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt"  # add on both CFLAGS
     TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \
@@ -595,9 +606,11 @@
       WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
     fi
   elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
-    WARNING_CFLAGS_JDK_CONLY="-errshort=tags"
-    WARNING_CFLAGS_JDK_CXXONLY="+w"
-    WARNING_CFLAGS_JDK="-errtags=yes -errfmt"
+    WARNING_CFLAGS_JDK_CONLY="$(WARNINGS_ENABLE_ALL_CFLAGS)"
+    WARNING_CFLAGS_JDK_CXXONLY="$(WARNINGS_ENABLE_ALL_CXXFLAGS)"
+    WARNING_CFLAGS_JVM="$(WARNINGS_ENABLE_ALL_CXXFLAGS)"
+
+
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     WARNING_CFLAGS="-W3"
     WARNING_CFLAGS_JDK="-wd4800"
--- a/make/autoconf/spec.gmk.in	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Thu Mar 01 15:24:17 2018 +0100
@@ -419,6 +419,8 @@
 DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
 CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
 LDFLAGS_WARNINGS_ARE_ERRORS:=@LDFLAGS_WARNINGS_ARE_ERRORS@
+DISABLED_WARNINGS_C := @DISABLED_WARNINGS_C@
+DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
 
 # A global flag (true or false) determining if native warnings are considered errors.
 WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
--- a/make/common/NativeCompilation.gmk	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/common/NativeCompilation.gmk	Thu Mar 01 15:24:17 2018 +0100
@@ -580,10 +580,14 @@
   ifneq ($(DISABLE_WARNING_PREFIX), )
     $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
         $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
-        $$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)))
+        $$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)) \
+        $$(DISABLED_WARNINGS) \
+        $$(DISABLED_WARNINGS_C))
     $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
         $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
-        $$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)))
+        $$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)) \
+        $$(DISABLED_WARNINGS) \
+        $$(DISABLED_WARNINGS_CXX))
   endif
 
   # Check if warnings should be considered errors.
@@ -765,8 +769,8 @@
 
   # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables
   # for LDFLAGS and LIBS
-  $1_EXTRA_LDFLAGS := $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
-  $1_EXTRA_LIBS := $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
+  $1_EXTRA_LDFLAGS += $$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
+  $1_EXTRA_LIBS += $$($1_LIBS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LIBS_$(OPENJDK_TARGET_OS))
   ifneq ($$($1_REAL_MAPFILE), )
     $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
   endif
--- a/make/hotspot/lib/CompileJvm.gmk	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/hotspot/lib/CompileJvm.gmk	Thu Mar 01 15:24:17 2018 +0100
@@ -225,6 +225,9 @@
     vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     DISABLED_WARNINGS_clang := tautological-compare, \
+    DISABLED_WARNINGS_solstudio := hidef inlafteruse inllargeint \
+        nokeyworddefine notemsource unknownpragma w_enumnotused \
+        wnoretvalue w_novirtualdescr w_toomanyenumnotused wvarhidenmem, \
     DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
         1540-1088 1500-010, \
     ASFLAGS := $(JVM_ASFLAGS), \
--- a/make/mapfiles/libjava/reorder-sparc	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/mapfiles/libjava/reorder-sparc	Thu Mar 01 15:24:17 2018 +0100
@@ -26,7 +26,6 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass__;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_Object_getClass;
 text: .text%Java_sun_reflect_Reflection_getClassAccessFlags;
@@ -44,7 +43,6 @@
 text: .text%Java_java_io_FileInputStream_readBytes;
 text: .text%readBytes;
 text: .text%Java_java_io_FileInputStream_available0;
-text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_lang_System_mapLibraryName;
 text: .text%Java_java_io_UnixFileSystem_getBooleanAttributes0;
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_load0;
@@ -63,7 +61,6 @@
 text: .text%Java_java_lang_Float_floatToRawIntBits;
 text: .text%Java_java_lang_Double_doubleToRawLongBits;
 text: .text%Java_java_io_UnixFileSystem_getLength;
-text: .text%Java_java_lang_ClassLoader_defineClass0;
 text: .text%VerifyClassCodes;
 # Test Exit
 text: .text%Java_java_lang_Shutdown_halt0;
--- a/make/mapfiles/libjava/reorder-sparcv9	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/mapfiles/libjava/reorder-sparcv9	Thu Mar 01 15:24:17 2018 +0100
@@ -25,7 +25,6 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass__;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_String_intern;
 text: .text%Java_java_lang_StringUTF16_isBigEndian;
@@ -48,7 +47,6 @@
 text: .text%Java_java_io_FileInputStream_readBytes;
 text: .text%readBytes;
 text: .text%Java_java_io_FileInputStream_available0;
-text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_security_AccessController_doPrivileged__Ljava_security_PrivilegedExceptionAction_2;
 text: .text%Java_java_io_UnixFileSystem_list;
 text: .text%JNU_ClassString;
@@ -60,7 +58,6 @@
 text: .text%Java_java_lang_ClassLoader_00024NativeLibrary_findEntry;
 text: .text%Java_java_io_UnixFileSystem_getLength;
 text: .text%Java_java_lang_Object_getClass;
-text: .text%Java_java_lang_ClassLoader_defineClass0;
 # Test Exit
 text: .text%Java_java_lang_Shutdown_halt0;
 # Test Hello
--- a/make/mapfiles/libjava/reorder-x86	Thu Mar 01 14:31:04 2018 +0100
+++ b/make/mapfiles/libjava/reorder-x86	Thu Mar 01 15:24:17 2018 +0100
@@ -26,7 +26,6 @@
 text: .text%Java_java_io_FileDescriptor_initIDs;
 text: .text%Java_java_io_FileOutputStream_initIDs;
 text: .text%Java_java_lang_System_setIn0;
-text: .text%Java_sun_reflect_Reflection_getCallerClass__;
 text: .text%Java_java_lang_Class_forName0;
 text: .text%Java_java_lang_String_intern;
 text: .text%Java_java_lang_StringUTF16_isBigEndian;
@@ -58,9 +57,7 @@
 text: .text%Java_java_io_UnixFileSystem_getLength;
 text: .text%Java_java_io_FileInputStream_readBytes;
 text: .text%readBytes;
-text: .text%Java_java_io_FileInputStream_close0;
 text: .text%Java_java_lang_Object_getClass;
-text: .text%Java_java_lang_ClassLoader_defineClass0;
 text: .text%VerifyClassCodes;
 # Test Exit
 text: .text%Java_java_lang_Shutdown_halt0;