[oe] [meta-java][PATCH 1/2] openjdk-8: undefined behaviour in src/os_cpu/linux_zero/vm/os_linux_zero.cpp

Attie Grande attie.grande at argentum-systems.co.uk
Fri Nov 30 13:10:19 UTC 2018


Fixes potential UB that can be exposed by newer GCC versions.

The original patch (below) has been modified to work with jdk8.

Further information:
  https://bugs.openjdk.java.net/browse/JDK-8202600
  http://hg.openjdk.java.net/jdk8u/jdk8u/hotspot/rev/ca4663e58916

Signed-off-by: Attie Grande <attie.grande at argentum-systems.co.uk>
---
 recipes-core/openjdk/openjdk-8-release-16xbyy.inc              |  1 +
 .../JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch | 10 ++++++++++
 2 files changed, 11 insertions(+)
 create mode 100644
recipes-core/openjdk/patches-openjdk-8/JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch

diff --git a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
index bd4a349..23c99fe 100644
--- a/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
+++ b/recipes-core/openjdk/openjdk-8-release-16xbyy.inc
@@ -16,6 +16,7 @@ PATCHES_URI = "\
     file://0008-jdk-use-correct-include-for-signal.patch \
     file://0009-jdk-disable-backtrace-musl-build-fix.patch \
     file://0010-build-fix-build-on-as-needed-toolchains-generic.patch \
+    file://JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch \
 "
 # some patches extracted from
http://cr.openjdk.java.net/~rkennke/shark-build-hotspot/webrev.01/hotspot.patch
 # reported via
http://mail.openjdk.java.net/pipermail/build-dev/2015-January/013972.html
diff --git a/recipes-core/openjdk/patches-openjdk-8/JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch
b/recipes-core/openjdk/patches-openjdk-8/JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch
new file mode 100644
index 0000000..f01fea3
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-8/JDK-8202600-undefined-behaviour-in-os_linux_zero.cpp.patch
@@ -0,0 +1,10 @@
+--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Tue Apr 14
11:40:13 2015 +0200
++++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Thu May 03
18:59:48 2018 +0200
+@@ -408,6 +408,7 @@
+
+ extern "C" {
+   int SpinPause() {
++    return 0; // Shouldn't matter.
+   }
+
+
-- 
2.7.4


More information about the Openembedded-devel mailing list