summaryrefslogtreecommitdiffstats
path: root/recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch')
-rw-r--r--recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch140
1 files changed, 140 insertions, 0 deletions
diff --git a/recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch b/recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch
new file mode 100644
index 0000000..36eefe5
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/1005-hotspot-Zero-build-requires-disabled-warnings.patch
@@ -0,0 +1,140 @@
1From 9ae232a21a7c2cec88cdb4ff7e6cf7092f1578ab Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <andre.draszik@jci.com>
3Date: Mon, 13 Aug 2018 16:45:24 +0100
4Subject: [PATCH] hotspot: Zero build requires disabled warnings
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9|# HG changeset patch
10|# User sgehwolf
11|# Date 1525714161 -3600
12|# Mon May 07 18:29:21 2018 +0100
13|# Node ID afb31413c73cbc06420fdb447aa90a7a38258904
14|# Parent bcbc64dfb629c5f188bbf59b8f986ad95963ed60
158143245, PR3548: Zero build requires disabled warnings
16Reviewed-by: dholmes, coleenp
17
18Upstream-Status: Backport
19
20Signed-off-by: André Draszik <andre.draszik@jci.com>
21Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
22
23---
24 hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp | 2 +-
25 hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp | 4 ++--
26 hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp | 14 ++++++++++++--
27 .../src/os_cpu/linux_zero/vm/thread_linux_zero.hpp | 3 ++-
28 4 files changed, 17 insertions(+), 6 deletions(-)
29
30diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
31index 525031eb..d47422b8 100644
32--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
33+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
34@@ -100,7 +100,7 @@ intptr_t narrow(BasicType type, intptr_t result) {
35 case T_DOUBLE:
36 case T_VOID:
37 return result;
38- default : ShouldNotReachHere();
39+ default : ShouldNotReachHere(); return NULL_WORD;
40 }
41 }
42
43diff --git a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
44index e23e3eaa..061ed8ce 100644
45--- a/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
46+++ b/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
47@@ -1,5 +1,5 @@
48 /*
49- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
50+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
51 * Copyright 2007, 2008, 2010 Red Hat, Inc.
52 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
53 *
54@@ -62,7 +62,7 @@ void InterpreterRuntime::SignatureHandlerGeneratorBase::pass_object() {
55 }
56
57 void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) {
58- ffi_type *ftype;
59+ ffi_type *ftype = NULL;
60 switch (type) {
61 case T_VOID:
62 ftype = &ffi_type_void;
63diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
64index d22ea114..cbee43ba 100644
65--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
66+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
67@@ -61,6 +61,7 @@ address os::current_stack_pointer() {
68
69 frame os::get_sender_for_C_frame(frame* fr) {
70 ShouldNotCallThis();
71+ return frame(NULL, NULL); // silence compile warning.
72 }
73
74 frame os::current_frame() {
75@@ -98,16 +99,19 @@ void os::initialize_thread(Thread * thr){
76
77 address os::Linux::ucontext_get_pc(ucontext_t* uc) {
78 ShouldNotCallThis();
79+ return NULL; // silence compile warnings
80 }
81
82 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
83 intptr_t** ret_sp,
84 intptr_t** ret_fp) {
85 ShouldNotCallThis();
86+ return NULL; // silence compile warnings
87 }
88
89 frame os::fetch_frame_from_context(void* ucVoid) {
90 ShouldNotCallThis();
91+ return frame(NULL, NULL); // silence compile warnings
92 }
93
94 extern "C" JNIEXPORT int
95@@ -247,11 +251,16 @@ JVM_handle_linux_signal(int sig,
96 }
97 #endif // !PRODUCT
98
99- const char *fmt = "caught unhandled signal %d";
100 char buf[64];
101
102- sprintf(buf, fmt, sig);
103+ sprintf(buf, "caught unhandled signal %d", sig);
104+
105+// Silence -Wformat-security warning for fatal()
106+PRAGMA_DIAG_PUSH
107+PRAGMA_FORMAT_NONLITERAL_IGNORED
108 fatal(buf);
109+PRAGMA_DIAG_POP
110+ return true; // silence compiler warnings
111 }
112
113 void os::Linux::init_thread_fpu_state(void) {
114@@ -260,6 +269,7 @@ void os::Linux::init_thread_fpu_state(void) {
115
116 int os::Linux::get_fpu_control_word() {
117 ShouldNotCallThis();
118+ return -1; // silence compile warnings
119 }
120
121 void os::Linux::set_fpu_control_word(int fpu) {
122diff --git a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
123index 94bc83a3..b3ba526f 100644
124--- a/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
125+++ b/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
126@@ -1,5 +1,5 @@
127 /*
128- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
129+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
130 * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
131 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
132 *
133@@ -110,6 +110,7 @@
134 void* ucontext,
135 bool isInJava) {
136 ShouldNotCallThis();
137+ return false; // silence compile warning
138 }
139
140 bool pd_get_top_frame_for_profiling(frame* fr_addr,