From a20bd3a6ce8920a9e5b6e65f4a6d15fb79005c77 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Tue, 10 Apr 2018 22:37:01 +0200 Subject: [PATCH] 8201267: Disable warnings for VS2017 to enable building Reviewed-by: ihse, tbell --- make/CreateJmods.gmk | 26 ++++++++++++++----- make/autoconf/toolchain_windows.m4 | 1 - make/common/NativeCompilation.gmk | 22 +++++++++------- make/launcher/Launcher-jdk.pack.gmk | 1 + make/lib/Awt2dLibraries.gmk | 2 +- make/lib/Lib-jdk.accessibility.gmk | 2 ++ make/lib/Lib-jdk.pack.gmk | 1 + .../share/native/libinstrument/Reentrancy.c | 2 +- 8 files changed, 38 insertions(+), 19 deletions(-) diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index 9373499ace7..b1392711484 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -117,6 +117,17 @@ ifeq ($(MODULE), java.base) --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 @@ ifeq ($(INTERIM_JMOD), true) 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 diff --git a/make/autoconf/toolchain_windows.m4 b/make/autoconf/toolchain_windows.m4 index 1adcc148cca..ea193b0b5eb 100644 --- a/make/autoconf/toolchain_windows.m4 +++ b/make/autoconf/toolchain_windows.m4 @@ -522,7 +522,6 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVC_DLL], 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 diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 9533493fd5c..daf56073d1d 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -905,20 +905,22 @@ define SetupNativeCompilationBody $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) \ diff --git a/make/launcher/Launcher-jdk.pack.gmk b/make/launcher/Launcher-jdk.pack.gmk index 1e7debfda32..c66bed0d4e5 100644 --- a/make/launcher/Launcher-jdk.pack.gmk +++ b/make/launcher/Launcher-jdk.pack.gmk @@ -88,6 +88,7 @@ $(eval $(call SetupJdkExecutable, BUILD_UNPACKEXE, \ 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), \ diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk index adc6c5826f8..f3205c1fcd8 100644 --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk @@ -543,7 +543,7 @@ else 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), \ )) diff --git a/make/lib/Lib-jdk.accessibility.gmk b/make/lib/Lib-jdk.accessibility.gmk index 9e899e8a773..ea35ab39293 100644 --- a/make/lib/Lib-jdk.accessibility.gmk +++ b/make/lib/Lib-jdk.accessibility.gmk @@ -45,6 +45,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows) 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 @@ ifeq ($(OPENJDK_TARGET_OS), windows) 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 \ diff --git a/make/lib/Lib-jdk.pack.gmk b/make/lib/Lib-jdk.pack.gmk index 9884818852c..35fe7a41d4d 100644 --- a/make/lib/Lib-jdk.pack.gmk +++ b/make/lib/Lib-jdk.pack.gmk @@ -40,6 +40,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBUNPACK, \ $(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, \ diff --git a/src/java.instrument/share/native/libinstrument/Reentrancy.c b/src/java.instrument/share/native/libinstrument/Reentrancy.c index 8cb69172bf7..2d923e23848 100644 --- a/src/java.instrument/share/native/libinstrument/Reentrancy.c +++ b/src/java.instrument/share/native/libinstrument/Reentrancy.c @@ -90,7 +90,7 @@ assertTLSValue( jvmtiEnv * jvmtienv, 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(