diff mbox series

[meta-java,master,scarthgap] openjdk-8: improve patch for different architecure

Message ID 20240520114044.760949-1-andrej.kozemcak@siemens.com
State Under Review
Delegated to: Tim Orling
Headers show
Series [meta-java,master,scarthgap] openjdk-8: improve patch for different architecure | expand

Commit Message

Andrej Kozemcak May 20, 2024, 11:40 a.m. UTC
Arrch64 and arm use same patch for different code. Improve
patch for arm code, so it can be apply without any warnings.

Signed-off-by: Andrej Kozemcak <andrej.kozemcak@siemens.com>
---
 .../openjdk/openjdk-8-release-common.inc      |  12 +-
 ...h32-Turn-on-the-Wreturn-type-warning.patch | 237 ++++++++++++++++++
 ...64-Turn-on-the-Wreturn-type-warning.patch} |   0
 3 files changed, 246 insertions(+), 3 deletions(-)
 create mode 100644 recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch
 rename recipes-core/openjdk/patches-openjdk-8/{1007-hotspot-Turn-on-the-Wreturn-type-warning.patch => 1007-hotspot-aarch64-Turn-on-the-Wreturn-type-warning.patch} (100%)

Comments

Jermain Horsman May 22, 2024, 9:08 a.m. UTC | #1
The mailing list was recently updated (see https://lists.yoctoproject.org/g/yocto-patches/message/9),
so this should be sent to yocto-patches@lists.yoctoproject.org.

Sincerely,

Jermain Horsman
diff mbox series

Patch

diff --git a/recipes-core/openjdk/openjdk-8-release-common.inc b/recipes-core/openjdk/openjdk-8-release-common.inc
index ff8d96e..8ef7049 100644
--- a/recipes-core/openjdk/openjdk-8-release-common.inc
+++ b/recipes-core/openjdk/openjdk-8-release-common.inc
@@ -29,7 +29,6 @@  HOTSPOT_UB_PATCH = "\
     file://1004-hotspot-fix-Wreturn-type-issues-introduced-by-806165.patch \
     file://1005-hotspot-Zero-build-requires-disabled-warnings.patch \
     file://1006-hotspot-Missing-return-statement-in-__sync_val_compa.patch \
-    file://1007-hotspot-Turn-on-the-Wreturn-type-warning.patch \
     file://1008-hotspot-handle-format-error-for-GCC-7.patch \
     file://1012-hotspot-enable-Wno-error.patch \
 "
@@ -39,10 +38,17 @@  HOTSPOT_UB_PATCH:append:class-target = "\
     file://1011-hotspot-restrict-to-staging-dir.patch \
 "
 HOTSPOT_UB_PATCH:prepend:aarch64 = "\
+    file://1007-hotspot-aarch64-Turn-on-the-Wreturn-type-warning.patch \
     file://1401-hotspot-aarch64-Add-missing-return-value-to-LIR_Asse.patch \
 "
-HOTSPOT_UB_PATCH:append:armv7a = " file://1201-hotspot-aarch32-fix-missing-return-values.patch"
-HOTSPOT_UB_PATCH:append:armv7ve = " file://1201-hotspot-aarch32-fix-missing-return-values.patch"
+HOTSPOT_UB_PATCH:append:armv7a = "\
+    file://1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch \
+    file://1201-hotspot-aarch32-fix-missing-return-values.patch \
+"
+HOTSPOT_UB_PATCH:append:armv7ve = "\
+    file://1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch \
+    file://1201-hotspot-aarch32-fix-missing-return-values.patch \
+"
 
 PATCHES_URI:append:class-target = "\
     file://1013-hotspot-add-missing-includes-for-shark-build-pt2.patch \
diff --git a/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch b/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch
new file mode 100644
index 0000000..ecd610c
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch32-Turn-on-the-Wreturn-type-warning.patch
@@ -0,0 +1,237 @@ 
+From 6758bf27e31110dc5d4c7237476c823ff05454a2 Mon Sep 17 00:00:00 2001
+From: Richard Leitner <richard.leitner@skidata.com>
+Date: Thu, 22 Oct 2020 09:41:07 +0200
+Subject: [PATCH] hotspot: Turn on the -Wreturn-type warning
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+|# HG changeset patch
+|# User stefank
+|# Date 1525453613 -3600
+|#      Fri May 04 18:06:53 2018 +0100
+|# Node ID 07a1135a327362f157955d470fad5df07cc35164
+|# Parent  de79964656fc652f2085dac4fe99bcc128b5a3b1
+8062808, PR3548: Turn on the -Wreturn-type warning
+Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett
+
+Upstream-Status: Backport
+
+Signed-off-by: André Draszik <andre.draszik@jci.com>
+Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
+
+---
+ hotspot/make/linux/makefiles/gcc.make               | 2 +-
+ hotspot/src/cpu/x86/vm/x86_32.ad                    | 1 +
+ hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp    | 1 +
+ hotspot/src/share/vm/classfile/defaultMethods.cpp   | 4 ++--
+ hotspot/src/share/vm/classfile/symbolTable.cpp      | 4 ++--
+ hotspot/src/share/vm/classfile/systemDictionary.cpp | 6 +++---
+ hotspot/src/share/vm/memory/heapInspection.hpp      | 2 +-
+ hotspot/src/share/vm/memory/metaspaceShared.hpp     | 2 +-
+ hotspot/src/share/vm/oops/constantPool.hpp          | 2 +-
+ hotspot/src/share/vm/prims/jvm.cpp                  | 2 +-
+ hotspot/src/share/vm/runtime/reflection.cpp         | 2 +-
+ hotspot/src/share/vm/runtime/sharedRuntime.cpp      | 2 +-
+ hotspot/src/share/vm/services/memTracker.hpp        | 2 +-
+ 13 files changed, 17 insertions(+), 15 deletions(-)
+
+diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
+index 76f738c6..67607fb2 100644
+--- a/hotspot/make/linux/makefiles/gcc.make
++++ b/hotspot/make/linux/makefiles/gcc.make
+@@ -212,7 +212,7 @@ ifeq ($(USE_CLANG), true)
+   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
+ endif
+ 
+-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
++WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type
+ 
+ ifeq ($(USE_CLANG),)
+   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
+index f42d1a28..c8f4ee16 100644
+--- a/hotspot/src/cpu/x86/vm/x86_32.ad
++++ b/hotspot/src/cpu/x86/vm/x86_32.ad
+@@ -1250,6 +1250,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo
+ 
+ 
+   Unimplemented();
++  return 0; // Mute compiler
+ }
+ 
+ #ifndef PRODUCT
+diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+index c35d8677..65c3165c 100644
+--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
++++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+@@ -541,6 +541,7 @@ JVM_handle_linux_signal(int sig,
+   err.report_and_die();
+ 
+   ShouldNotReachHere();
++  return true; // Mute compiler
+ }
+ 
+ void os::Linux::init_thread_fpu_state(void) {
+diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp
+index 4b4b4e25..196622ae 100644
+--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp
++++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp
+@@ -506,7 +506,7 @@ Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method
+   ss.write((const char*)name->bytes(), name->utf8_length());
+   ss.write((const char*)signature->bytes(), signature->utf8_length());
+   ss.print(" is abstract");
+-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
++  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
+ }
+ 
+ Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
+@@ -521,7 +521,7 @@ Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods
+     ss.print(".");
+     ss.write((const char*)name->bytes(), name->utf8_length());
+   }
+-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
++  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
+ }
+ 
+ 
+diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp
+index ec97077b..2621a7d6 100644
+--- a/hotspot/src/share/vm/classfile/symbolTable.cpp
++++ b/hotspot/src/share/vm/classfile/symbolTable.cpp
+@@ -249,7 +249,7 @@ Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) {
+   MutexLocker ml(SymbolTable_lock, THREAD);
+ 
+   // Otherwise, add to symbol to table
+-  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
++  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD);
+ }
+ 
+ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
+@@ -288,7 +288,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
+   // Grab SymbolTable_lock first.
+   MutexLocker ml(SymbolTable_lock, THREAD);
+ 
+-  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
++  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD);
+ }
+ 
+ Symbol* SymbolTable::lookup_only(const char* name, int len,
+diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
+index 3e64b719..b1dd335c 100644
+--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
++++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
+@@ -236,15 +236,15 @@ Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader
+                  class_name->as_C_string(),
+                  class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
+   if (FieldType::is_array(class_name)) {
+-    return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
++    return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
+   } else if (FieldType::is_obj(class_name)) {
+     ResourceMark rm(THREAD);
+     // Ignore wrapping L and ;.
+     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
+                                    class_name->utf8_length() - 2, CHECK_NULL);
+-    return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL);
++    return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
+   } else {
+-    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
++    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD);
+   }
+ }
+ 
+diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp
+index 09ee6602..c5fec15c 100644
+--- a/hotspot/src/share/vm/memory/heapInspection.hpp
++++ b/hotspot/src/share/vm/memory/heapInspection.hpp
+@@ -367,7 +367,7 @@ class HeapInspection : public StackObj {
+       _csv_format(csv_format), _print_help(print_help),
+       _print_class_stats(print_class_stats), _columns(columns) {}
+   void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
+-  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN;
++  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
+   static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
+  private:
+   void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
+diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp
+index 2f3abae6..d58ebecb 100644
+--- a/hotspot/src/share/vm/memory/metaspaceShared.hpp
++++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp
+@@ -93,7 +93,7 @@ class MetaspaceShared : AllStatic {
+   static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
+   static int preload_and_dump(const char * class_list_path,
+                               GrowableArray<Klass*>* class_promote_order,
+-                              TRAPS) NOT_CDS_RETURN;
++                              TRAPS) NOT_CDS_RETURN_(0);
+ 
+   static ReservedSpace* shared_rs() {
+     CDS_ONLY(return _shared_rs);
+diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp
+index 124c970e..dae574c0 100644
+--- a/hotspot/src/share/vm/oops/constantPool.hpp
++++ b/hotspot/src/share/vm/oops/constantPool.hpp
+@@ -353,7 +353,7 @@ class ConstantPool : public Metadata {
+ 
+   Klass* klass_at(int which, TRAPS) {
+     constantPoolHandle h_this(THREAD, this);
+-    return klass_at_impl(h_this, which, CHECK_NULL);
++    return klass_at_impl(h_this, which, THREAD);
+   }
+ 
+   Symbol* klass_name_at(int which);  // Returns the name, w/o resolving.
+diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
+index 6f2221c4..daa69f89 100644
+--- a/hotspot/src/share/vm/prims/jvm.cpp
++++ b/hotspot/src/share/vm/prims/jvm.cpp
+@@ -4368,7 +4368,7 @@ JVM_ENTRY(jlong,JVM_DTraceActivate(
+     JVM_DTraceProvider* providers))
+   JVMWrapper("JVM_DTraceActivate");
+   return DTraceJSDT::activate(
+-    version, module_name, providers_count, providers, CHECK_0);
++    version, module_name, providers_count, providers, THREAD);
+ JVM_END
+ 
+ JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
+diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp
+index d9fddbe4..a5f73793 100644
+--- a/hotspot/src/share/vm/runtime/reflection.cpp
++++ b/hotspot/src/share/vm/runtime/reflection.cpp
+@@ -1093,7 +1093,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
+   } else {
+     if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT)
+       narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
+-    return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
++    return box((jvalue*) result.get_value_addr(), rtype, THREAD);
+   }
+ }
+ 
+diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+index 013aa7a2..df4cde96 100644
+--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
++++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+@@ -1045,7 +1045,7 @@ Handle SharedRuntime::find_callee_info(JavaThread* thread, Bytecodes::Code& bc,
+   // last java frame on stack (which includes native call frames)
+   vframeStream vfst(thread, true);  // Do not skip and javaCalls
+ 
+-  return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle()));
++  return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD);
+ }
+ 
+ 
+diff --git a/hotspot/src/share/vm/services/memTracker.hpp b/hotspot/src/share/vm/services/memTracker.hpp
+index 8ea859dd..535147f8 100644
+--- a/hotspot/src/share/vm/services/memTracker.hpp
++++ b/hotspot/src/share/vm/services/memTracker.hpp
+@@ -64,7 +64,7 @@ class MemTracker : AllStatic {
+     const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
+   static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
+   static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
+-  static inline Tracker get_virtual_memory_release_tracker() { }
++  static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); }
+   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
+   static inline void record_thread_stack(void* addr, size_t size) { }
+   static inline void release_thread_stack(void* addr, size_t size) { }
diff --git a/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch b/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch64-Turn-on-the-Wreturn-type-warning.patch
similarity index 100%
rename from recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch
rename to recipes-core/openjdk/patches-openjdk-8/1007-hotspot-aarch64-Turn-on-the-Wreturn-type-warning.patch