Alex Kashchenko d6f9d06
# HG changeset patch
Alex Kashchenko d6f9d06
# User sgehwolf
Alex Kashchenko d6f9d06
# Date 1525714161 -3600
Alex Kashchenko d6f9d06
#      Mon May 07 18:29:21 2018 +0100
Alex Kashchenko d6f9d06
# Node ID afb31413c73cbc06420fdb447aa90a7a38258904
Alex Kashchenko d6f9d06
# Parent  bcbc64dfb629c5f188bbf59b8f986ad95963ed60
Alex Kashchenko d6f9d06
8143245, PR3548: Zero build requires disabled warnings
Alex Kashchenko d6f9d06
Reviewed-by: dholmes, coleenp
Alex Kashchenko d6f9d06
Alex Kashchenko d6f9d06
diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
Alex Kashchenko 8795728
diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
Alex Kashchenko d6f9d06
--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make
Alex Kashchenko d6f9d06
+++ openjdk/hotspot/make/linux/makefiles/zeroshark.make
Alex Kashchenko d6f9d06
@@ -1,5 +1,5 @@
Alex Kashchenko d6f9d06
 #
Alex Kashchenko d6f9d06
-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
+# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
 # Copyright 2007, 2008 Red Hat, Inc.
Alex Kashchenko d6f9d06
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Alex Kashchenko d6f9d06
 #
Alex Kashchenko d6f9d06
@@ -29,11 +29,6 @@
Alex Kashchenko d6f9d06
 ifeq ($(USE_CLANG), true)
Alex Kashchenko d6f9d06
   WARNING_FLAGS += -Wno-undef
Alex Kashchenko d6f9d06
 endif
Alex Kashchenko d6f9d06
-# Suppress some warning flags that are normally turned on for hotspot,
Alex Kashchenko d6f9d06
-# because some of the zero code has not been updated accordingly.
Alex Kashchenko d6f9d06
-WARNING_FLAGS += -Wno-return-type \
Alex Kashchenko d6f9d06
-  -Wno-format-nonliteral -Wno-format-security \
Alex Kashchenko d6f9d06
-  -Wno-maybe-uninitialized
Alex Kashchenko d6f9d06
 
Alex Kashchenko 8795728
 # If FDLIBM_CFLAGS is non-empty it holds CFLAGS needed to be passed to
Alex Kashchenko 8795728
 # the compiler so as to be able to produce optimized objects
Alex Kashchenko d6f9d06
diff --git openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
Alex Kashchenko d6f9d06
--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
Alex Kashchenko d6f9d06
+++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
Alex Kashchenko d6f9d06
@@ -100,7 +100,7 @@
Alex Kashchenko d6f9d06
     case T_DOUBLE:
Alex Kashchenko d6f9d06
     case T_VOID:
Alex Kashchenko d6f9d06
       return result;
Alex Kashchenko d6f9d06
-    default  : ShouldNotReachHere();
Alex Kashchenko d6f9d06
+    default  : ShouldNotReachHere(); return NULL_WORD;
Alex Kashchenko d6f9d06
   }
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
diff --git openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
Alex Kashchenko d6f9d06
--- openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
Alex Kashchenko d6f9d06
+++ openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
Alex Kashchenko d6f9d06
@@ -1,5 +1,5 @@
Alex Kashchenko d6f9d06
 /*
Alex Kashchenko d6f9d06
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
Alex Kashchenko d6f9d06
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Alex Kashchenko d6f9d06
  *
Alex Kashchenko d6f9d06
@@ -62,7 +62,7 @@
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) {
Alex Kashchenko d6f9d06
-  ffi_type *ftype;
Alex Kashchenko d6f9d06
+  ffi_type *ftype = NULL;
Alex Kashchenko d6f9d06
   switch (type) {
Alex Kashchenko d6f9d06
   case T_VOID:
Alex Kashchenko d6f9d06
     ftype = &ffi_type_void;
Alex Kashchenko 8795728
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
Alex Kashchenko d6f9d06
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
Alex Kashchenko d6f9d06
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
Alex Kashchenko d6f9d06
@@ -1,6 +1,6 @@
Alex Kashchenko d6f9d06
 /*
Alex Kashchenko af80df1
  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
- * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
Alex Kashchenko d6f9d06
+ * Copyright 2016 Red Hat, Inc.
Alex Kashchenko d6f9d06
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Alex Kashchenko d6f9d06
  *
Alex Kashchenko d6f9d06
  * This code is free software; you can redistribute it and/or modify it
Alex Kashchenko d6f9d06
@@ -61,6 +61,7 @@
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 frame os::get_sender_for_C_frame(frame* fr) {
Alex Kashchenko d6f9d06
   ShouldNotCallThis();
Alex Kashchenko d6f9d06
+  return frame(NULL, NULL); // silence compile warning.
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 frame os::current_frame() {
Alex Kashchenko d6f9d06
@@ -98,16 +99,19 @@
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 address os::Linux::ucontext_get_pc(ucontext_t* uc) {
Alex Kashchenko d6f9d06
   ShouldNotCallThis();
Alex Kashchenko d6f9d06
+  return NULL; // silence compile warnings
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
Alex Kashchenko d6f9d06
                                         intptr_t** ret_sp,
Alex Kashchenko d6f9d06
                                         intptr_t** ret_fp) {
Alex Kashchenko d6f9d06
   ShouldNotCallThis();
Alex Kashchenko d6f9d06
+  return NULL; // silence compile warnings
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 frame os::fetch_frame_from_context(void* ucVoid) {
Alex Kashchenko d6f9d06
   ShouldNotCallThis();
Alex Kashchenko d6f9d06
+  return frame(NULL, NULL); // silence compile warnings
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 extern "C" JNIEXPORT int
Alex Kashchenko d6f9d06
@@ -247,11 +251,16 @@
Alex Kashchenko d6f9d06
   }
Alex Kashchenko d6f9d06
 #endif // !PRODUCT
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
-  const char *fmt = "caught unhandled signal %d";
Alex Kashchenko d6f9d06
   char buf[64];
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
-  sprintf(buf, fmt, sig);
Alex Kashchenko d6f9d06
+  sprintf(buf, "caught unhandled signal %d", sig);
Alex Kashchenko d6f9d06
+
Alex Kashchenko d6f9d06
+// Silence -Wformat-security warning for fatal()
Alex Kashchenko d6f9d06
+PRAGMA_DIAG_PUSH
Alex Kashchenko d6f9d06
+PRAGMA_FORMAT_NONLITERAL_IGNORED
Alex Kashchenko d6f9d06
   fatal(buf);
Alex Kashchenko d6f9d06
+PRAGMA_DIAG_POP
Alex Kashchenko d6f9d06
+  return true; // silence compiler warnings
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 void os::Linux::init_thread_fpu_state(void) {
Alex Kashchenko d6f9d06
@@ -260,6 +269,7 @@
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 int os::Linux::get_fpu_control_word() {
Alex Kashchenko d6f9d06
   ShouldNotCallThis();
Alex Kashchenko d6f9d06
+  return -1; // silence compile warnings
Alex Kashchenko d6f9d06
 }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
 void os::Linux::set_fpu_control_word(int fpu) {
Alex Kashchenko d6f9d06
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
Alex Kashchenko d6f9d06
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
Alex Kashchenko d6f9d06
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
Alex Kashchenko d6f9d06
@@ -1,5 +1,5 @@
Alex Kashchenko d6f9d06
 /*
Alex Kashchenko d6f9d06
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Alex Kashchenko d6f9d06
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
Alex Kashchenko d6f9d06
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Alex Kashchenko d6f9d06
  *
Alex Kashchenko d6f9d06
@@ -110,6 +110,7 @@
Alex Kashchenko d6f9d06
                                            void* ucontext,
Alex Kashchenko d6f9d06
                                            bool isInJava) {
Alex Kashchenko d6f9d06
     ShouldNotCallThis();
Alex Kashchenko d6f9d06
+    return false; // silence compile warning
Alex Kashchenko d6f9d06
   }
Alex Kashchenko d6f9d06
 
Alex Kashchenko d6f9d06
   // These routines are only used on cpu architectures that