RFR: JDK-8201349 build broken when configured with --with-zlib=bundled on gcc 7.3

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Wed Feb 5 11:33:55 UTC 2020


 From the bug report:

"I'm seeing errors like this now:

/ws/dev1/open/src/java.base/share/native/libzip/zlib/inflate.c:766:25: 
error: this statement may fall through [-Werror=implicit-fallthrough=]
    state->mode = EXLEN;

It suspect it is related to the new gcc 7.3 devkit combined with 
--with-zlib=bundled."

The patch belows disables the warning. It is needed twice, since not 
only libzip but also libjli includes the bundleed zlib code.

Bug: https://bugs.openjdk.java.net/browse/JDK-8201349
Patch inline:
diff --git a/make/lib/CoreLibraries.gmk b/make/lib/CoreLibraries.gmk
--- a/make/lib/CoreLibraries.gmk
+++ b/make/lib/CoreLibraries.gmk
@@ -144,7 +144,7 @@
      CFLAGS := $(CFLAGS_JDKLIB) \
          $(LIBZ_CFLAGS), \
      CFLAGS_unix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
-    DISABLED_WARNINGS_gcc := unused-function, \
+    DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \
      LIBS_unix := -ljvm -ljava $(LIBZ_LIBS), \
@@ -210,7 +210,7 @@
      EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
      OPTIMIZATION := HIGH, \
      CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
-    DISABLED_WARNINGS_gcc := unused-function, \
+    DISABLED_WARNINGS_gcc := unused-function implicit-fallthrough, \
      DISABLED_WARNINGS_clang := sometimes-uninitialized 
format-nonliteral, \
      LDFLAGS := $(LDFLAGS_JDKLIB) \
          $(call SET_SHARED_LIBRARY_ORIGIN), \

/Magnus



More information about the build-dev mailing list