From 43b3f9533af32445b60231b75e056533229422b1 Mon Sep 17 00:00:00 2001 From: Jiri Vanek Date: Apr 18 2018 13:16:11 +0000 Subject: Sync from f28 --- diff --git a/.gitignore b/.gitignore index 072f2ef..f0288e1 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,5 @@ /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u161-b14.tar.xz /aarch64-port-jdk8u-aarch64-jdk8u162-b12.tar.xz /aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u162-b12.tar.xz +/aarch64-port-jdk8u-aarch64-jdk8u171-b10.tar.xz +/aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u171-b10.tar.xz diff --git a/8167200.hotspotAarch64.patch b/8167200.hotspotAarch64.patch deleted file mode 100644 index 754df89..0000000 --- a/8167200.hotspotAarch64.patch +++ /dev/null @@ -1,37 +0,0 @@ - -# HG changeset patch -# User aph -# Date 1475745921 0 -# Node ID 60a8cbf7030e4de40050472705776509fa9cb960 -# Parent d9960bd9fb6d3a5ac0450a47d70f3a3afd7f515d -8167200: AArch64: Broken stack pointer adjustment in interpreter -Summary: Always adjust SP unconditionally -Reviewed-by: dlong, kbarrett - -diff -r d9960bd9fb6d -r 60a8cbf7030e src/cpu/aarch64/vm/templateTable_aarch64.cpp ---- openjdk/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp Tue May 24 08:47:37 2016 -0700 -+++ openjdk/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp Thu Oct 06 09:25:21 2016 +0000 -@@ -3717,19 +3717,15 @@ - - // allocate one if there's no free slot - { -- Label entry, loop, no_adjust; -+ Label entry, loop; - // 1. compute new pointers // rsp: old expression stack top - __ ldr(c_rarg1, monitor_block_bot); // c_rarg1: old expression stack bottom -- __ sub(esp, esp, entry_size); // move expression stack top -+ __ sub(esp, esp, entry_size); // move expression stack top - __ sub(c_rarg1, c_rarg1, entry_size); // move expression stack bottom - __ mov(c_rarg3, esp); // set start value for copy loop - __ str(c_rarg1, monitor_block_bot); // set new monitor block bottom - -- __ cmp(sp, c_rarg3); // Check if we need to move sp -- __ br(Assembler::LO, no_adjust); // to allow more stack space -- // for our new esp -- __ sub(sp, sp, 2 * wordSize); -- __ bind(no_adjust); -+ __ sub(sp, sp, entry_size); // make room for the monitor - - __ b(entry); - // 2. move expression stack contents - diff --git a/8197429-pr3456-rh1536622.patch b/8197429-pr3456-rh1536622.patch new file mode 100644 index 0000000..fc60cd3 --- /dev/null +++ b/8197429-pr3456-rh1536622.patch @@ -0,0 +1,93 @@ +diff -r eecfc14e66ee src/os/linux/vm/os_linux.cpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -674,6 +674,10 @@ + } + } + ++void os::Linux::expand_stack_to(address bottom) { ++ _expand_stack_to(bottom); ++} ++ + bool os::Linux::manually_expand_stack(JavaThread * t, address addr) { + assert(t!=NULL, "just checking"); + assert(t->osthread()->expanding_stack(), "expand should be set"); +diff -r eecfc14e66ee src/os/linux/vm/os_linux.hpp +--- openjdk/hotspot/src/os/linux/vm/os_linux.hpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -245,6 +245,8 @@ + static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime); + + private: ++ static void expand_stack_to(address bottom); ++ + typedef int (*sched_getcpu_func_t)(void); + typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); + typedef int (*numa_max_node_func_t)(void); +diff -r eecfc14e66ee src/os_cpu/linux_x86/vm/os_linux_x86.cpp +--- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Mon Jan 22 16:25:24 2018 +0000 ++++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Feb 21 13:52:31 2018 +0000 +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it +@@ -892,6 +892,25 @@ + void os::workaround_expand_exec_shield_cs_limit() { + #if defined(IA32) + size_t page_size = os::vm_page_size(); ++ ++ /* ++ * JDK-8197429 ++ * ++ * Expand the stack mapping to the end of the initial stack before ++ * attempting to install the codebuf. This is needed because newer ++ * Linux kernels impose a distance of a megabyte between stack ++ * memory and other memory regions. If we try to install the ++ * codebuf before expanding the stack the installation will appear ++ * to succeed but we'll get a segfault later if we expand the stack ++ * in Java code. ++ * ++ */ ++ if (os::Linux::is_initial_thread()) { ++ address limit = Linux::initial_thread_stack_bottom(); ++ limit += (StackYellowPages + StackRedPages) * page_size; ++ os::Linux::expand_stack_to(limit); ++ } ++ + /* + * Take the highest VA the OS will give us and exec + * +@@ -910,6 +929,16 @@ + char* hint = (char*) (Linux::initial_thread_stack_bottom() - + ((StackYellowPages + StackRedPages + 1) * page_size)); + char* codebuf = os::attempt_reserve_memory_at(page_size, hint); ++ ++ if (codebuf == NULL) { ++ // JDK-8197429: There may be a stack gap of one megabyte between ++ // the limit of the stack and the nearest memory region: this is a ++ // Linux kernel workaround for CVE-2017-1000364. If we failed to ++ // map our codebuf, try again at an address one megabyte lower. ++ hint -= 1 * M; ++ codebuf = os::attempt_reserve_memory_at(page_size, hint); ++ } ++ + if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { + return; // No matter, we tried, best effort. + } diff --git a/8200556-pr3566.patch b/8200556-pr3566.patch new file mode 100644 index 0000000..ccd2f49 --- /dev/null +++ b/8200556-pr3566.patch @@ -0,0 +1,14 @@ +diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp +--- openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000 ++++ openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100 +@@ -343,7 +343,7 @@ + CodeBuffer cb(code_pos, instruction_size); + MacroAssembler a(&cb); + +- a.mov(rscratch1, entry); ++ a.movptr(rscratch1, (uintptr_t)entry); + a.br(rscratch1); + + ICache::invalidate_range(code_pos, instruction_size); + + diff --git a/aarch64BuildFailure.patch b/aarch64BuildFailure.patch deleted file mode 100644 index ccd2f49..0000000 --- a/aarch64BuildFailure.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -r 214a94e9366c src/cpu/aarch64/vm/nativeInst_aarch64.cpp ---- openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 17 12:11:32 2017 +0000 -+++ openjdk/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.cpp Mon Jul 24 16:23:14 2017 +0100 -@@ -343,7 +343,7 @@ - CodeBuffer cb(code_pos, instruction_size); - MacroAssembler a(&cb); - -- a.mov(rscratch1, entry); -+ a.movptr(rscratch1, (uintptr_t)entry); - a.br(rscratch1); - - ICache::invalidate_range(code_pos, instruction_size); - - diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index 60d6626..1002649 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -204,7 +204,7 @@ # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. %global project aarch64-port %global repo jdk8u -%global revision aarch64-jdk8u162-b12 +%global revision aarch64-jdk8u171-b10 # eg # jdk8u60-b27 -> jdk8u60 or # aarch64-jdk8u60-b27 -> aarch64-jdk8u60 (dont forget spec escape % by %%) %global whole_update %(VERSION=%{revision}; echo ${VERSION%%-*}) # eg jdk8u60 -> 60 or aarch64-jdk8u60 -> 60 @@ -556,6 +556,9 @@ exit 0 %{_jvmdir}/%{jredir -- %{?1}}/bin/servertool %{_jvmdir}/%{jredir -- %{?1}}/bin/tnameserv %{_jvmdir}/%{jredir -- %{?1}}/bin/unpack200 +%dir %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/unlimited/ +%dir %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/limited/ +%dir %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/ %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/unlimited/US_export_policy.jar %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/unlimited/local_policy.jar %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/policy/limited/US_export_policy.jar @@ -579,8 +582,8 @@ exit 0 %config(noreplace) %{_jvmdir}/%{jredir -- %{?1}}/lib/security/nss.cfg %ifarch %{jit_arches} %ifnarch %{power64} -%attr(664, root, root) %ghost %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/server/classes.jsa -%attr(664, root, root) %ghost %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/client/classes.jsa +%ghost %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/server/classes.jsa +%ghost %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/client/classes.jsa %endif %endif %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/server/ @@ -937,7 +940,7 @@ Obsoletes: java-1.7.0-openjdk-accessibility%{?1} Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever} -Release: 3.%{buildver}%{?dist} +Release: 1.%{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 @@ -952,7 +955,17 @@ Epoch: 1 Summary: OpenJDK Runtime Environment Group: Development/Languages -License: ASL 1.1 and ASL 2.0 and GPL+ and GPLv2 and GPLv2 with exceptions and LGPL+ and LGPLv2 and MPLv1.0 and MPLv1.1 and Public Domain and W3C +# HotSpot code is licensed under GPLv2 +# JDK library code is licensed under GPLv2 with the Classpath exception +# The Apache license is used in code taken from Apache projects (primarily JAXP & JAXWS) +# DOM levels 2 & 3 and the XML digital signature schemas are licensed under the W3C Software License +# The JSR166 concurrency code is in the public domain +# The BSD and MIT licenses are used for a number of third-party libraries (see THIRD_PARTY_README) +# The OpenJDK source tree includes the JPEG library (IJG), zlib & libpng (zlib), giflib and LCMS (MIT) +# The test code includes copies of NSS under the Mozilla Public License v2.0 +# The PCSClite headers are under a BSD with advertising license +# The elliptic curve cryptography (ECC) source code is licensed under the LGPLv2.1 or any later version +License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib URL: http://openjdk.java.net/ # aarch64-port now contains integration forest of both aarch64 and normal jdk @@ -963,7 +976,7 @@ URL: http://openjdk.java.net/ Source0: %{project}-%{repo}-%{revision}.tar.xz # Shenandoah HotSpot -Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u162-b12.tar.xz +Source1: aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u171-b10.tar.xz # Custom README for -src subpackage Source2: README.src @@ -1035,19 +1048,18 @@ Patch509: rh1176206-root.patch Patch523: pr2974-rh1337583.patch # PR3083, RH1346460: Regression in SSL debug output without an ECC provider Patch528: pr3083-rh1346460.patch +# 8196516, RH1538767: libfontmanager.so needs to be built with LDFLAGS so as to allow +# linking with unresolved symbols. +Patch529: rhbz_1538767_fix_linking2.patch + +# Upstreamable debugging patches # Patches 204 and 205 stop the build adding .gnu_debuglink sections to unstripped files Patch204: hotspot-remove-debuglink.patch Patch205: dont-add-unnecessary-debug-links.patch # Enable debug information for assembly code files Patch206: hotspot-assembler-debuginfo.patch -# 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present -Patch560: 8188030-pr3459-rh1484079.patch -# 8196218, RH1538767: libfontmanager.so needs to link against headless awt library -Patch561: rhbz_1538767_fix_linking.patch -# fixing aarch64 segfault when boostraping after compiled by gcc8 -Patch562: rhbz_1540242.patch -# rhbz1536622 - 32 bit java app started via JNI crashes with larger stack sizes -Patch563: rhbz_1536622-JDK8197429-jdk8.patch +# 8200556, PR3566: AArch64 port crashes on slowdebug builds +Patch207: 8200556-pr3566.patch # Arch-specific upstreamable patches # PR2415: JVM -Xmx requirement is too high on s390 @@ -1056,6 +1068,8 @@ Patch100: %{name}-s390-java-opts.patch Patch102: %{name}-size_t.patch # Use "%z" for size_t on s390 as size_t != intptr_t Patch103: s390-size_t_format_flags.patch +# Fix more cases of missing return statements on AArch64 +Patch104: pr3458-rh1540242.patch # Patches which need backporting to 8u # S8073139, RH1191652; fix name of ppc64le architecture @@ -1081,16 +1095,18 @@ Patch526: 6260348-pr3066.patch # 8061305, PR3335, RH1423421: Javadoc crashes when method name ends with "Property" Patch538: 8061305-pr3335-rh1423421.patch Patch540: rhbz1548475-LDFLAGSusage.patch +# 8188030, PR3459, RH1484079: AWT java apps fail to start when some minimal fonts are present +Patch560: 8188030-pr3459-rh1484079.patch +# 8197429, PR3456, RH153662{2,3}: 32 bit java app started via JNI crashes with larger stack sizes +Patch561: 8197429-pr3456-rh1536622.patch # Patches ineligible for 8u # 8043805: Allow using a system-installed libjpeg Patch201: system-libjpeg.patch -# custom securities -Patch207: PR3183.patch -# ustreamed aarch64 fixes -Patch208: aarch64BuildFailure.patch Patch209: 8035496-hotspot.patch Patch210: suse_linuxfilestore.patch +# custom securities +Patch300: PR3183.patch # Local fixes # PR1834, RH1022017: Reduce curves reported by SSL to those in NSS @@ -1100,6 +1116,10 @@ Patch534: always_assumemp.patch # PR2888: OpenJDK should check for system cacerts database (e.g. /etc/pki/java/cacerts) Patch539: pr2888.patch +# Shenandoah fixes +# PR3573: Fix TCK crash with Shenandoah +Patch700: pr3573.patch + # Non-OpenJDK fixes Patch1000: enableCommentedOutSystemNss.patch @@ -1133,7 +1153,7 @@ BuildRequires: zip # Use OpenJDK 7 where available (on RHEL) to avoid # having to use the rhel-7.x-java-unsafe-candidate hack %if ! 0%{?fedora} && 0%{?rhel} <= 7 -BuildRequires: java-1.7.0-openjdk-devel +BuildRequires: java-1.7.0-openjdk-devel >= 1.7.0.151-2.6.11.3 %else BuildRequires: java-1.8.0-openjdk-devel %endif @@ -1438,10 +1458,11 @@ sh %{SOURCE12} %patch205 %patch206 %patch207 -%patch208 %patch209 %patch210 +%patch300 + %patch1 %patch3 %patch5 @@ -1452,8 +1473,10 @@ sh %{SOURCE12} %patch102 %patch103 -# ppc64le fixes +# AArch64 fixes +%patch104 +# ppc64le fixes %patch603 %patch601 %patch602 @@ -1484,10 +1507,9 @@ sh %{SOURCE12} %patch540 %patch560 pushd openjdk/jdk -%patch561 -p1 +%patch529 -p1 popd -%patch562 -%patch563 +%patch561 # RPM-only fixes %patch525 @@ -1498,6 +1520,11 @@ popd %patch534 %endif +# Shenandoah-only patches +%if %{use_shenandoah_hotspot} +%patch700 +%endif + %patch1000 # Extract systemtap tapsets @@ -2120,6 +2147,22 @@ require "copy_jdk_configs.lua" %endif %changelog +* Wed Apr 18 2018 Jiri Vanek - 1:1.8.0.171-1.b10 +- Update to aarch64-jdk8u171-b10 and aarch64-shenandoah-jdk8u171-b10. +- Fix jconsole.desktop.in subcategory, replacing "Monitor" with "Profiling" (PR3550) (gnu_andrew) +- Fix invalid license 'LGPL+' (should be LGPLv2+ for ECC code) and add misisng ones (gnu_andrew) + +* Wed Apr 18 2018 Jiri Vanek - 1:1.8.0.162-7.b12 +- added ownership of policy dir and subdirs +- removed ignored attributes for classes.jsa + +* Tue Apr 10 2018 Severin Gehwolf - 1:1.8.0.162-6.b12 +- Use correct patch for RHBZ#1538767 (JDK-8196516) + +* Mon Apr 02 2018 Andrew Hughes - 1:1.8.0.162-5.b12 +- Cleanup from previous commit. +- Remove unused upstream patch 8167200.hotspotAarch64.patch. + * Thu Mar 29 2018 Jiri Vanek - 1:1.8.0.162-3.b12 - returned patch562 rhbz_1540242.patch - added Patch563 rhbz_1536622-JDK8197429-jdk8.patch diff --git a/jconsole.desktop.in b/jconsole.desktop.in index a096349..82a5c4c 100644 --- a/jconsole.desktop.in +++ b/jconsole.desktop.in @@ -6,5 +6,5 @@ Icon=java-1.8.0 Terminal=false Type=Application StartupWMClass=sun-tools-jconsole-JConsole -Categories=Development;Monitor;Java; +Categories=Development;Profiling;Java; Version=1.0 diff --git a/pr3458-rh1540242.patch b/pr3458-rh1540242.patch new file mode 100644 index 0000000..2419b3d --- /dev/null +++ b/pr3458-rh1540242.patch @@ -0,0 +1,22 @@ +diff --git a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +--- openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ++++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +@@ -698,6 +698,7 @@ + + extern "C" { + int SpinPause() { ++ return 0; + } + + void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { +diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +--- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ++++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +@@ -408,6 +408,7 @@ + + extern "C" { + int SpinPause() { ++ return 0; + } + + diff --git a/pr3573.patch b/pr3573.patch new file mode 100644 index 0000000..07b9f10 --- /dev/null +++ b/pr3573.patch @@ -0,0 +1,25 @@ +# HG changeset patch +# User roland +# Date 1506520357 -7200 +# Wed Sep 27 15:52:37 2017 +0200 +# Node ID c307975d0800f8da5cc8e82cd8f1fdadbd745357 +# Parent ab0c101fa16e4cd97ac8ceff4f5ff72e2f4d5776 +[backport] fix TCK crash with shenandoah + +diff --git a/src/share/vm/opto/shenandoahSupport.cpp b/src/share/vm/opto/shenandoahSupport.cpp +--- openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp ++++ openjdk/hotspot/src/share/vm/opto/shenandoahSupport.cpp +@@ -472,9 +472,11 @@ + Node* input = in(Memory); + if (input->Opcode() == Op_ShenandoahWBMemProj) { + Node* wb = input->in(0); +- if (wb->is_top()) return NULL; // Dead path. ++ const Type* in_type = phase->type(wb); ++ // is_top() test not sufficient here: we can come here after CCP ++ // in a dead branch of the graph that has not yet been removed. ++ if (in_type == Type::TOP) return NULL; // Dead path. + assert(wb->Opcode() == Op_ShenandoahWriteBarrier, "expect write barrier"); +- const Type* in_type = phase->type(wb); + if (is_independent(in_type, _type)) { + if (phase->is_IterGVN()) { + phase->is_IterGVN()->rehash_node_delayed(wb); diff --git a/rhbz_1536622-JDK8197429-jdk8.patch b/rhbz_1536622-JDK8197429-jdk8.patch deleted file mode 100644 index fc60cd3..0000000 --- a/rhbz_1536622-JDK8197429-jdk8.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff -r eecfc14e66ee src/os/linux/vm/os_linux.cpp ---- openjdk/hotspot/src/os/linux/vm/os_linux.cpp Mon Jan 22 16:25:24 2018 +0000 -+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp Wed Feb 21 13:52:31 2018 +0000 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -674,6 +674,10 @@ - } - } - -+void os::Linux::expand_stack_to(address bottom) { -+ _expand_stack_to(bottom); -+} -+ - bool os::Linux::manually_expand_stack(JavaThread * t, address addr) { - assert(t!=NULL, "just checking"); - assert(t->osthread()->expanding_stack(), "expand should be set"); -diff -r eecfc14e66ee src/os/linux/vm/os_linux.hpp ---- openjdk/hotspot/src/os/linux/vm/os_linux.hpp Mon Jan 22 16:25:24 2018 +0000 -+++ openjdk/hotspot/src/os/linux/vm/os_linux.hpp Wed Feb 21 13:52:31 2018 +0000 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -245,6 +245,8 @@ - static int safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime); - - private: -+ static void expand_stack_to(address bottom); -+ - typedef int (*sched_getcpu_func_t)(void); - typedef int (*numa_node_to_cpus_func_t)(int node, unsigned long *buffer, int bufferlen); - typedef int (*numa_max_node_func_t)(void); -diff -r eecfc14e66ee src/os_cpu/linux_x86/vm/os_linux_x86.cpp ---- openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Mon Jan 22 16:25:24 2018 +0000 -+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Wed Feb 21 13:52:31 2018 +0000 -@@ -1,5 +1,5 @@ - /* -- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it -@@ -892,6 +892,25 @@ - void os::workaround_expand_exec_shield_cs_limit() { - #if defined(IA32) - size_t page_size = os::vm_page_size(); -+ -+ /* -+ * JDK-8197429 -+ * -+ * Expand the stack mapping to the end of the initial stack before -+ * attempting to install the codebuf. This is needed because newer -+ * Linux kernels impose a distance of a megabyte between stack -+ * memory and other memory regions. If we try to install the -+ * codebuf before expanding the stack the installation will appear -+ * to succeed but we'll get a segfault later if we expand the stack -+ * in Java code. -+ * -+ */ -+ if (os::Linux::is_initial_thread()) { -+ address limit = Linux::initial_thread_stack_bottom(); -+ limit += (StackYellowPages + StackRedPages) * page_size; -+ os::Linux::expand_stack_to(limit); -+ } -+ - /* - * Take the highest VA the OS will give us and exec - * -@@ -910,6 +929,16 @@ - char* hint = (char*) (Linux::initial_thread_stack_bottom() - - ((StackYellowPages + StackRedPages + 1) * page_size)); - char* codebuf = os::attempt_reserve_memory_at(page_size, hint); -+ -+ if (codebuf == NULL) { -+ // JDK-8197429: There may be a stack gap of one megabyte between -+ // the limit of the stack and the nearest memory region: this is a -+ // Linux kernel workaround for CVE-2017-1000364. If we failed to -+ // map our codebuf, try again at an address one megabyte lower. -+ hint -= 1 * M; -+ codebuf = os::attempt_reserve_memory_at(page_size, hint); -+ } -+ - if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { - return; // No matter, we tried, best effort. - } diff --git a/rhbz_1538767_fix_linking.patch b/rhbz_1538767_fix_linking.patch index 10c2cc2..b321611 100644 --- a/rhbz_1538767_fix_linking.patch +++ b/rhbz_1538767_fix_linking.patch @@ -1,21 +1,33 @@ +# HG changeset patch +# User sgehwolf +# Date 1523360781 -7200 +# Tue Apr 10 13:46:21 2018 +0200 +# Node ID 5f2401aef9acb6998f06cb82fdd8a84eda3e63ad +# Parent 656ab3b39178c1e4de644d490613bfd8212ae924 +8196516: libfontmanager must be built with LDFLAGS allowing unresolved symbols +Summary: Fixes build failures on some sustems with custom LDFLAGS settings. + diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk --- a/make/lib/Awt2dLibraries.gmk +++ b/make/lib/Awt2dLibraries.gmk -@@ -921,7 +921,7 @@ - LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ - $(call SET_SHARED_LIBRARY_ORIGIN), \ - LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ -- LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ -+ LDFLAGS_SUFFIX_linux := -lawt_headless -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ - LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \ - LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\ - LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \ -@@ -938,7 +938,7 @@ - - $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT) - --ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix)) -+ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix linux)) - $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS) +@@ -927,6 +927,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow endif ++# LDFLAGS clarification: ++# Filter relevant linker flags disallowing unresolved symbols as we cannot ++# build-time decide to which library to link against (libawt_headless or ++# libawt_xawt). See JDK-8196516 for details. + $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + LIBRARY := fontmanager, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ +@@ -941,7 +945,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + -DCC_NOEX, \ + MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ +- LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ ++ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ ++ $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ + LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ diff --git a/rhbz_1538767_fix_linking2.patch b/rhbz_1538767_fix_linking2.patch new file mode 100644 index 0000000..42032aa --- /dev/null +++ b/rhbz_1538767_fix_linking2.patch @@ -0,0 +1,34 @@ +# HG changeset patch +# User sgehwolf +# Date 1523360781 -7200 +# Tue Apr 10 13:46:21 2018 +0200 +# Node ID 5f2401aef9acb6998f06cb82fdd8a84eda3e63ad +# Parent 656ab3b39178c1e4de644d490613bfd8212ae924 +8196516: libfontmanager must be built with LDFLAGS allowing unresolved symbols +Summary: Fixes build failures on some sustems with custom LDFLAGS settings. + +diff --git a/make/lib/Awt2dLibraries.gmk b/make/lib/Awt2dLibraries.gmk +--- a/make/lib/Awt2dLibraries.gmk ++++ b/make/lib/Awt2dLibraries.gmk +@@ -927,6 +927,10 @@ ifeq ($(OPENJDK_TARGET_OS), linux) + BUILD_LIBFONTMANAGER_IndicRearrangementProcessor2.cpp_CXXFLAGS := -fno-strict-overflow + endif + ++# LDFLAGS clarification: ++# Filter relevant linker flags disallowing unresolved symbols as we cannot ++# build-time decide to which library to link against (libawt_headless or ++# libawt_xawt). See JDK-8196516 for details. + $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + LIBRARY := fontmanager, \ + OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ +@@ -941,7 +945,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \ + CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \ + -DCC_NOEX, \ + MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \ +- LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \ ++ LDFLAGS := $(subst -Xlinker -z -Xlinker defs,, \ ++ $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB))) $(LDFLAGS_CXX_JDK) \ + $(call SET_SHARED_LIBRARY_ORIGIN), \ + LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \ + LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \ + diff --git a/rhbz_1540242.patch b/rhbz_1540242.patch deleted file mode 100644 index 2419b3d..0000000 --- a/rhbz_1540242.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ---- openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp -+++ openjdk/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp -@@ -698,6 +698,7 @@ - - extern "C" { - int SpinPause() { -+ return 0; - } - - void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { -diff --git a/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/src/os_cpu/linux_zero/vm/os_linux_zero.cpp ---- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp -@@ -408,6 +408,7 @@ - - extern "C" { - int SpinPause() { -+ return 0; - } - - diff --git a/sources b/sources index 696fdf0..cdc7ff6 100644 --- a/sources +++ b/sources @@ -1,3 +1,3 @@ SHA512 (systemtap-tapset-3.6.0pre02.tar.xz) = d59858bbe9e927bdf47711e3c71c88f93567596aea3e1736b33b436a7a2cb38af25a9b4b4224ca513454b3f2d0371d14e753176c1810d9745a7e4af8edae7fb8 -SHA512 (aarch64-port-jdk8u-aarch64-jdk8u162-b12.tar.xz) = 5bb05e931a57c25c627fa0b588b74ab89e050e6d0a0b7073ba1d65aa3a3ee9f5d5e62e1fbfe3da55a472ecb3dad9cec3a6faf73b5d95b59bcefa2246caddcab3 -SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u162-b12.tar.xz) = 833a4516fc3b68fedb78feddd272d7f52e9af90aeebc3eb95aa4a86d69b4540e14ad73fdd913b7201c9663c2f136cfe3ec2e2d3b8d39cf1e99ec1c7711079740 +SHA512 (aarch64-port-jdk8u-aarch64-jdk8u171-b10.tar.xz) = f27ac541bb6b058becbfa1e56d7215ee789fca3021718f0944a3e143218a5d1e3276dc8a972d6dafa28c7a860209fa3406ad5161f6dc2d480198bbc34629c5db +SHA512 (aarch64-port-jdk8u-shenandoah-aarch64-shenandoah-jdk8u171-b10.tar.xz) = e5e356aff131bbaaffdd816ba4e7e13e1f267bc981469cd84a267959db5620e74ea9ae81f69c09457c3aff3f041195afe0e4dccb944971eb005392c3bda3d4f5