[java-1.8.0-openjdk/f21] Sync with rhel7

jiri vanek jvanek at fedoraproject.org
Thu Sep 25 10:00:41 UTC 2014


commit fe8e6bfede4c92b7d2b647b52ab008b44381fb1f
Author: Jiri Vanek <jvanek at redhat.com>
Date:   Thu Sep 25 12:00:16 2014 +0200

    Sync with rhel7

 1015432.patch                             |   23 --------------
 atomic_linux_zero.inline.hpp.patch        |   45 +++++++++++++++++++++++++++
 fix_ZERO_ARCHDEF_ppc.patch                |   13 ++++++++
 java-1.8.0-openjdk-ppc-zero-hotspot.patch |   18 -----------
 java-1.8.0-openjdk.spec                   |   43 ++++++++++++++------------
 ppc_stack_overflow_fix.patch              |   48 +++++++++++++++++++++++++++++
 stackoverflow-ppc32_64-20140828.patch     |   37 ----------------------
 7 files changed, 129 insertions(+), 98 deletions(-)
---
diff --git a/atomic_linux_zero.inline.hpp.patch b/atomic_linux_zero.inline.hpp.patch
new file mode 100644
index 0000000..78be93e
--- /dev/null
+++ b/atomic_linux_zero.inline.hpp.patch
@@ -0,0 +1,45 @@
+diff --git a/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp b/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
+--- jdk8/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
++++ jdk8/hotspot/src/os_cpu/linux_zero/vm/atomic_linux_zero.inline.hpp
+@@ -222,31 +222,35 @@
+ 
+ inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) {
+ #ifdef ARM
+-  return arm_lock_test_and_set(dest, exchange_value);
++  jint result = arm_lock_test_and_set(dest, exchange_value);
+ #else
+ #ifdef M68K
+-  return m68k_lock_test_and_set(dest, exchange_value);
++  jint result = m68k_lock_test_and_set(dest, exchange_value);
+ #else
+   // __sync_lock_test_and_set is a bizarrely named atomic exchange
+   // operation.  Note that some platforms only support this with the
+   // limitation that the only valid value to store is the immediate
+   // constant 1.  There is a test for this in JNI_CreateJavaVM().
+-  return __sync_lock_test_and_set (dest, exchange_value);
++  jint result = __sync_lock_test_and_set (dest, exchange_value);
++  __sync_synchronize();
+ #endif // M68K
+ #endif // ARM
++  return result;
+ }
+ 
+ inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value,
+                                  volatile intptr_t* dest) {
+ #ifdef ARM
+-  return arm_lock_test_and_set(dest, exchange_value);
++  intptr_t result = arm_lock_test_and_set(dest, exchange_value);
+ #else
+ #ifdef M68K
+-  return m68k_lock_test_and_set(dest, exchange_value);
++  intptr_t result = m68k_lock_test_and_set(dest, exchange_value);
+ #else
+-  return __sync_lock_test_and_set (dest, exchange_value);
++  intptr_t result = __sync_lock_test_and_set (dest, exchange_value);
++  __sync_synchronize();
+ #endif // M68K
+ #endif // ARM
++  return result;
+ }
+ 
+ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) {
diff --git a/fix_ZERO_ARCHDEF_ppc.patch b/fix_ZERO_ARCHDEF_ppc.patch
new file mode 100644
index 0000000..e7724ae
--- /dev/null
+++ b/fix_ZERO_ARCHDEF_ppc.patch
@@ -0,0 +1,13 @@
+diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
+--- jdk8/common/autoconf/platform.m4
++++ jdk8/common/autoconf/platform.m4
+@@ -367,7 +367,8 @@
+ 
+   # ZERO_ARCHDEF is used to enable architecture-specific code
+   case "${OPENJDK_TARGET_CPU}" in
+-    ppc*)    ZERO_ARCHDEF=PPC   ;;
++    ppc)     ZERO_ARCHDEF=PPC32 ;;
++    ppc64)   ZERO_ARCHDEF=PPC64 ;;
+     s390*)   ZERO_ARCHDEF=S390  ;;
+     sparc*)  ZERO_ARCHDEF=SPARC ;;
+     x86_64*) ZERO_ARCHDEF=AMD64 ;;
diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec
index 73c49c7..e4ac292 100644
--- a/java-1.8.0-openjdk.spec
+++ b/java-1.8.0-openjdk.spec
@@ -123,7 +123,7 @@
 
 Name:    java-%{javaver}-%{origin}
 Version: %{javaver}.%{updatever}
-Release: 9.%{buildver}%{?dist}
+Release: 10.%{buildver}%{?dist}
 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons,
 # and this change was brought into RHEL-4.  java-1.5.0-ibm packages
 # also included the epoch in their virtual provides.  This created a
@@ -177,8 +177,6 @@ Source101: config.sub
 # Ignore AWTError when assistive technologies are loaded 
 Patch1:   %{name}-accessible-toolkit.patch
 
-# RHBZ 1015432
-Patch2: 1015432.patch
 # Restrict access to java-atk-wrapper classes
 Patch3: java-atk-wrapper-security.patch
 # RHBZ 808293
@@ -195,8 +193,6 @@ Patch11: hotspot-build-j-directive.patch
 #
 # OpenJDK specific patches
 #
-Patch666: stackoverflow-ppc32_64-20140828.patch
-
 # Allow icedtea-web to build
 Patch99: applet-hole.patch
 
@@ -205,15 +201,16 @@ Patch100: %{name}-s390-java-opts.patch
 # Type fixing for s390
 Patch102: %{name}-size_t.patch
 
-# Patch for PPC/PPC64
-Patch103: %{name}-ppc-zero-hotspot.patch
-
 Patch201: system-libjpeg.patch
 Patch202: system-libpng.patch
 Patch203: system-lcms.patch
 
 Patch300: jstack-pr1845.patch
 
+Patch400: ppc_stack_overflow_fix.patch 
+Patch401: fix_ZERO_ARCHDEF_ppc.patch
+Patch402: atomic_linux_zero.inline.hpp.patch
+
 Patch9999: enableArm64.patch
 
 BuildRequires: autoconf
@@ -446,16 +443,11 @@ sh %{SOURCE12}
 %patch9999
 %endif
 
-%ifnarch %{aarch64}
-%patch666
-%endif
-
 %patch201
 %patch202
 %patch203
 
 %patch1
-#%%patch2
 %patch3
 %patch4
 %patch5
@@ -471,10 +463,11 @@ sh %{SOURCE12}
 %patch102
 %endif
 
-%ifarch ppc %{power64}
-# PPC fixes
-%patch103
-%endif
+# Zero PPC fixes.
+#  TODO: propose them upstream
+%patch400
+%patch401
+%patch402
 
 # Extract systemtap tapsets
 %if %{with_systemtap}
@@ -521,7 +514,13 @@ export ARCH_DATA_MODEL=64
 export CFLAGS="$CFLAGS -mieee"
 %endif
 
-export CFLAGS="$CFLAGS -fstack-protector-strong"
+EXTRA_CFLAGS="-fstack-protector-strong"
+# PPC/PPC64 needs -fno-tree-vectorize since -O3 would
+# otherwise generate wrong code producing segfaults.
+%ifarch %{power64} ppc
+EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-tree-vectorize"
+%endif
+export EXTRA_CFLAGS
 
 (cd jdk8/common/autoconf
  bash ./autogen.sh
@@ -554,9 +553,10 @@ bash ../../configure \
     --with-libpng=system \
     --with-lcms=system \
     --with-stdc++lib=dynamic \
-    --with-num-cores="$NUM_PROC" \
     --with-extra-cflags="-fno-devirtualize" \
-    --with-extra-cxxflags="-fno-devirtualize"
+    --with-extra-cxxflags="-fno-devirtualize" \
+    --with-extra-cflags="$EXTRA_CFLAGS" \
+    --with-num-cores="$NUM_PROC"
 
 # The combination of FULL_DEBUG_SYMBOLS=0 and ALT_OBJCOPY=/does_not_exist
 # disables FDS for all build configs and reverts to pre-FDS make logic.
@@ -1330,6 +1330,9 @@ exit 0
 %{_jvmdir}/%{jredir}/lib/accessibility.properties
 
 %changelog
+* Thu Sep 25 2014 Jiri Vanek <jvanek at redhat.com> - 1:1.8.0.20-10.b26
+- sync with rhel7
+
 * Wed Sep 17 2014 Omair Majid <omajid at redhat.com> - 1:1.8.0.20-9.b26
 - Remove LIBDIR and funny definition of _libdir.
 - Fix rpmlint warnings about macros in comments.
diff --git a/ppc_stack_overflow_fix.patch b/ppc_stack_overflow_fix.patch
new file mode 100644
index 0000000..754797a
--- /dev/null
+++ b/ppc_stack_overflow_fix.patch
@@ -0,0 +1,48 @@
+diff --git a/src/cpu/zero/vm/stack_zero.hpp b/src/cpu/zero/vm/stack_zero.hpp
+--- jdk8/hotspot/src/cpu/zero/vm/stack_zero.hpp
++++ jdk8/hotspot/src/cpu/zero/vm/stack_zero.hpp
+@@ -99,7 +99,7 @@
+   int shadow_pages_size() const {
+     return _shadow_pages_size;
+   }
+-  int abi_stack_available(Thread *thread) const;
++  ssize_t abi_stack_available(Thread *thread) const;
+ 
+  public:
+   void overflow_check(int required_words, TRAPS);
+diff --git a/src/cpu/zero/vm/stack_zero.inline.hpp b/src/cpu/zero/vm/stack_zero.inline.hpp
+--- jdk8/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
++++ jdk8/hotspot/src/cpu/zero/vm/stack_zero.inline.hpp
+@@ -47,10 +47,11 @@
+ // This method returns the amount of ABI stack available for us
+ // to use under normal circumstances.  Note that the returned
+ // value can be negative.
+-inline int ZeroStack::abi_stack_available(Thread *thread) const {
+-  int stack_used = thread->stack_base() - (address) &stack_used;
+-  int stack_free = thread->stack_size() - stack_used;
+-  return stack_free - shadow_pages_size();
++inline ssize_t ZeroStack::abi_stack_available(Thread *thread) const {
++  ssize_t stack_used = thread->stack_base() - (address) &stack_used
++    + (StackYellowPages+StackRedPages+StackShadowPages) * os::vm_page_size();
++  ssize_t stack_free = thread->stack_size() - stack_used;
++  return stack_free;
+ }
+ 
+ #endif // CPU_ZERO_VM_STACK_ZERO_INLINE_HPP
+diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp
+--- jdk8/hotspot/src/os/linux/vm/os_linux.cpp
++++ jdk8/hotspot/src/os/linux/vm/os_linux.cpp
+@@ -4700,6 +4700,13 @@
+   os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
+             (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() +
+                     (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size());
++#ifdef ZERO
++  // If this is Zero, allow at the very minimum one page each for the
++  // Zero stack and the native stack.  This won't make any difference
++  // for 4k pages, but is significant for large pages.
++  os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed,
++             (size_t)(StackYellowPages+StackRedPages+StackShadowPages+2) * Linux::page_size());
++#endif
+ 
+   size_t threadStackSizeInBytes = ThreadStackSize * K;
+   if (threadStackSizeInBytes != 0 &&


More information about the scm-commits mailing list