8201267: Disable warnings for VS2017 to enable building
authorerikj
Tue, 10 Apr 2018 22:37:01 +0200
changeset 49566 7c224ec572d0
parent 49565 b5705ade8c8d
child 49567 e6c069766d46
child 49692 55ec43275ff2
8201267: Disable warnings for VS2017 to enable building Reviewed-by: ihse, tbell
make/CreateJmods.gmk
make/autoconf/toolchain_windows.m4
make/common/NativeCompilation.gmk
make/launcher/Launcher-jdk.pack.gmk
make/lib/Awt2dLibraries.gmk
make/lib/Lib-jdk.accessibility.gmk
make/lib/Lib-jdk.pack.gmk
src/java.instrument/share/native/libinstrument/Reentrancy.c
--- a/make/CreateJmods.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/CreateJmods.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -117,6 +117,17 @@
           --hash-modules '^(?!$(EXCLUDE_PATTERN)$$)'
     endif
   endif
+else # not java.base
+  ifeq ($(OPENJDK_TARGET_OS), windows)
+    # Only java.base needs to include the MSVC*_DLLs. Make sure no other module
+    # tries to include them (typically imported ones).
+    ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCR_DLL))), )
+      JMOD_FLAGS += --exclude '$(notdir $(MSVCR_DLL))'
+    endif
+    ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCP_DLL))), )
+      JMOD_FLAGS += --exclude '$(notdir $(MSVCP_DLL))'
+    endif
+  endif
 endif
 
 # Changes to the jmod tool itself should also trigger a rebuild of all jmods.
@@ -133,18 +144,21 @@
   DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS))
 endif
 
+JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}'
+
 # Create jmods in a temp dir and then move them into place to keep the
 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
 	$(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@))
 	$(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR))
 	$(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@)
-	$(JMOD) create \
-            --module-version $(VERSION_SHORT) \
-            --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
-            --module-path $(JMODS_DIR) \
-	    --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
-	    $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@)
+	$(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/jmods/$(MODULE).jmod, \
+	    $(JMOD) create \
+	        --module-version $(VERSION_SHORT) \
+	        --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
+	        --module-path $(JMODS_DIR) \
+	        $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) \
+	)
 	$(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@
 
 TARGETS += $(JMODS_DIR)/$(MODULE).jmod
--- a/make/autoconf/toolchain_windows.m4	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/autoconf/toolchain_windows.m4	Tue Apr 10 22:37:01 2018 +0200
@@ -522,7 +522,6 @@
     if $ECHO "$MSVC_DLL_FILETYPE" | $GREP "$CORRECT_MSVCR_ARCH" 2>&1 > /dev/null; then
       AC_MSG_RESULT([ok])
       MSVC_DLL="$POSSIBLE_MSVC_DLL"
-      BASIC_FIXUP_PATH(MSVC_DLL)
       AC_MSG_CHECKING([for $DLL_NAME])
       AC_MSG_RESULT([$MSVC_DLL])
     else
--- a/make/common/NativeCompilation.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/common/NativeCompilation.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -905,20 +905,22 @@
 
       $1_IMPORT_LIBRARY := $$($1_OBJECT_DIR)/$$($1_NAME).lib
       $1_EXTRA_LDFLAGS += "-implib:$$($1_IMPORT_LIBRARY)"
-      # To properly trigger downstream dependants of the import library, just as
-      # for debug files, we must have a recipe in the rule. To avoid rerunning
-      # the recipe every time have it touch the target. If an import library
-      # file is deleted by something external, explicitly delete the target to
-      # trigger a rebuild of both.
-      ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
-        $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
-        $$(shell $(RM) $$($1_TARGET))
-      endif
-      $$($1_IMPORT_LIBRARY): $$($1_TARGET)
+      ifeq ($$($1_TYPE), LIBRARY)
+        # To properly trigger downstream dependants of the import library, just as
+        # for debug files, we must have a recipe in the rule. To avoid rerunning
+        # the recipe every time have it touch the target. If an import library
+        # file is deleted by something external, explicitly delete the target to
+        # trigger a rebuild of both.
+        ifneq ($$(wildcard $$($1_IMPORT_LIBRARY)), $$($1_IMPORT_LIBRARY))
+          $$(call LogDebug, Deleting $$($1_BASENAME) because import library is missing)
+          $$(shell $(RM) $$($1_TARGET))
+        endif
+        $$($1_IMPORT_LIBRARY): $$($1_TARGET)
 		$$(if $$(CORRECT_FUNCTION_IN_RECIPE_EVALUATION), \
 		  $$(if $$(wildcard $$@), , $$(error $$@ was not created for $$<)) \
 		)
 		$(TOUCH) $$@
+      endif
     endif
 
     $1_VARDEPS := $$($1_LD) $$($1_SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) \
--- a/make/launcher/Launcher-jdk.pack.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/launcher/Launcher-jdk.pack.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -88,6 +88,7 @@
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
     DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
+    DISABLED_WARNINGS_microsoft := 4005, \
     LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
         $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Awt2dLibraries.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/lib/Awt2dLibraries.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -543,7 +543,7 @@
       DISABLED_WARNINGS_solstudio := \
          E_STATEMENT_NOT_REACHED \
          E_END_OF_LOOP_CODE_NOT_REACHED, \
-      DISABLED_WARNINGS_microsoft := 4267 4244, \
+      DISABLED_WARNINGS_microsoft := 4267 4244 4312, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
   ))
--- a/make/lib/Lib-jdk.accessibility.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/lib/Lib-jdk.accessibility.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -45,6 +45,7 @@
         NAME := javaaccessbridge$1, \
         SRC := $(JAVA_AB_SRCDIR), \
         OPTIMIZATION := LOW, \
+        DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
         CFLAGS := $(CFLAGS_JDKLIB) $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(JAVA_AB_SRCDIR)) \
             -I$(ROOT_SRCDIR)/include/bridge \
@@ -69,6 +70,7 @@
         NAME := windowsaccessbridge$1, \
         SRC := $(WIN_AB_SRCDIR), \
         OPTIMIZATION := LOW, \
+        DISABLED_WARNINGS_microsoft := 4311 4302 4312, \
         CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT $(ACCESSBRIDGE_CFLAGS) \
             $(addprefix -I,$(WIN_AB_SRCDIR)) \
             -I$(ROOT_SRCDIR)/include/bridge \
--- a/make/lib/Lib-jdk.pack.gmk	Tue Apr 10 11:37:18 2018 -0700
+++ b/make/lib/Lib-jdk.pack.gmk	Tue Apr 10 22:37:01 2018 +0200
@@ -40,6 +40,7 @@
         $(LIBJAVA_HEADER_FLAGS), \
     CFLAGS_release := -DPRODUCT, \
     DISABLED_WARNINGS_gcc := implicit-fallthrough, \
+    DISABLED_WARNINGS_microsoft := 4005, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
     LDFLAGS_windows := -map:$(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpack.map -debug, \
--- a/src/java.instrument/share/native/libinstrument/Reentrancy.c	Tue Apr 10 11:37:18 2018 -0700
+++ b/src/java.instrument/share/native/libinstrument/Reentrancy.c	Tue Apr 10 22:37:01 2018 +0200
@@ -90,7 +90,7 @@
                 jthread         thread,
                 const void *    expected) {
     jvmtiError  error;
-    void *      test = (void *) 0x99999999UL;
+    void *      test = (void *) 0x99999999ULL;
 
     /* now check if we do a fetch we get what we wrote */
     error = (*jvmtienv)->GetThreadLocalStorage(