From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id GO04K/bwR2S27gAASxT56A (envelope-from ) for ; Tue, 25 Apr 2023 17:25:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IEwiK/bwR2TeXwEAauVa8A (envelope-from ) for ; Tue, 25 Apr 2023 17:25:42 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1407C2138D for ; Tue, 25 Apr 2023 17:25:42 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prKXT-0002NS-FG; Tue, 25 Apr 2023 11:25:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prKXQ-0002Lw-3j for guix-patches@gnu.org; Tue, 25 Apr 2023 11:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prKXO-0001Vt-Rj for guix-patches@gnu.org; Tue, 25 Apr 2023 11:25:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prKXN-0001uh-Vo; Tue, 25 Apr 2023 11:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63069] [PATCH] Patch `openjdk@9` so it builds on aarch64 Resent-From: burning2007@ya.ru Original-Sender: "Debbugs-submit" Resent-CC: bjoern.hoefling@bjoernhoefling.de, guix-patches@gnu.org Resent-Date: Tue, 25 Apr 2023 15:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 63069 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63069@debbugs.gnu.org Cc: Anthony , bjoern.hoefling@bjoernhoefling.de X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: bjoern.hoefling@bjoernhoefling.de Received: via spool by submit@debbugs.gnu.org id=B.16824362547270 (code B ref -1); Tue, 25 Apr 2023 15:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 25 Apr 2023 15:24:14 +0000 Received: from localhost ([127.0.0.1]:53381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prKWa-0001tA-Vf for submit@debbugs.gnu.org; Tue, 25 Apr 2023 11:24:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:42768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prKWY-0001t2-G1 for submit@debbugs.gnu.org; Tue, 25 Apr 2023 11:24:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prKWX-00026k-OU for guix-patches@gnu.org; Tue, 25 Apr 2023 11:24:10 -0400 Received: from forward101c.mail.yandex.net ([178.154.239.212]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prKWT-0001JT-P7 for guix-patches@gnu.org; Tue, 25 Apr 2023 11:24:09 -0400 Received: from mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:4e8f:0:640:efc:0]) by forward101c.mail.yandex.net (Yandex) with ESMTP id 75F1F600D9 for ; Tue, 25 Apr 2023 18:23:59 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-29.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id tNIuBVZWw4Y0-TzQbGzYd; Tue, 25 Apr 2023 18:23:58 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ya.ru; s=mail; t=1682436239; bh=Fvs9XqPnIIut7WozrqowL6p1/z6+QZjepHgikZVlkw4=; h=Message-Id:Date:Cc:Subject:To:From; b=uLggYnsvwLHFJg4ivCQy6tPujHb9nt8qNF+ooRyYq0FnxEOmn8C08bIgRrEHNKNow +Slw/wfnnpwj8WX4+n15zn18tRCEwKxNsIlCA9HGgUpiUuB8NevroudK82/ZmdFUBC qStMRSb5odBaGAsqpxCmP2gxdVrnjE/ESKmZty5M= From: burning2007@ya.ru Date: Tue, 25 Apr 2023 19:23:53 +0400 Message-Id: <259180feeb7fa9f356b54f7edb44bce69375706d.1682435898.git.burning2007@ya.ru> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=178.154.239.212; envelope-from=burning2007@ya.ru; helo=forward101c.mail.yandex.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682436342; a=rsa-sha256; cv=none; b=urR98Ew1+q0mWiYc15QLthp65pNGG5r3LD+26RHzkD63iGPqFVMI6a6yiz7k4ovr317bX/ EqclNc7/n8qBMuMC4nx79XC4ingBXM45iPROsOQihwwNKv3xmmjkvwptZropaOhxPRxDNk VFBjxfOPii5swGvN8Xw+nw2SSWb6vqE+ICzSbaieCpDyufl1QZ6paW4hzLIcOtNfP2q+iU 20kdPWdIn8VkaxHN+LIDTSQEmdeiQ91phWuSpl7bEakivkb6BEEBgONXPy6SIsLZx8bkdU OwlP+bR3I4vY0HJ8l2L9ppKu7pPmClWU/Tqk2dJ9O7hNzqVgXCCChTUSpoF/Pw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ya.ru header.s=mail header.b=uLggYnsv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=ya.ru (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682436342; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Fvs9XqPnIIut7WozrqowL6p1/z6+QZjepHgikZVlkw4=; b=YGGc6drOqUzy0659eFlT0aCNVrbFhI19/5aANsSYn1eMnly0cKkgpWSDcLMu6fhch/RSQc obd7SDaLpGikC9Y8l88HkbkenXacJjpWkMTTdgRk1sHQnBNCDZgC8346HV1KuQJeVR/I8m j+wzV+GySjZUywKnwVKjQmX6QHdeyv9pGHP36UNMcTFGw8FeC4eAs7ZlxcCOphAfyneXUf s5dBv/QyzHytGdo4S45BfXs/kwZXHsPUkVhNhPqE3RpAMqDL1vHDRXO/baj3InMejhZ7Nt XqTybG4AAo8Z9aDmEUQSqXgzN42UFmNIkdE1lf5LWn0PeJQwLb3iYn65dRf3RA== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ya.ru header.s=mail header.b=uLggYnsv; dmarc=fail reason="SPF not aligned (relaxed)" header.from=ya.ru (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.09 X-Spam-Score: 7.09 X-Migadu-Queue-Id: 1407C2138D X-TUID: AjPLzQuB78D1 From: Anthony Patch openjdk9 so it can build on aarch64. Adapted from here: - https://bugs.openjdk.org/browse/JDK-8224851 - https://github.com/openjdk/jdk/commit/a0a919603c1546ce86fe659df3636b5a24b9caeb?diff=unified I can confirm it builds on real hardware. -- Anthony --- gnu/packages/java.scm | 3 + ...19603c1546ce86fe659df3636b5a24b9caeb.patch | 371 ++++++++++++++++++ 2 files changed, 374 insertions(+) create mode 100644 gnu/packages/patches/opendjk-9-aarch64-a0a919603c1546ce86fe659df3636b5a24b9caeb.patch diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index de3a0003e5..d389b5a902 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -856,6 +856,9 @@ (define-public openjdk9 (uri (hg-reference (url "https://hg.openjdk.org/jdk/jdk") (changeset "jdk-9+181"))) (file-name (hg-file-name name version)) + (patches + (search-patches + "opendjk-9-aarch64-a0a919603c1546ce86fe659df3636b5a24b9caeb.patch")) (modules '((guix build utils))) (snippet `(begin (for-each delete-file diff --git a/gnu/packages/patches/opendjk-9-aarch64-a0a919603c1546ce86fe659df3636b5a24b9caeb.patch b/gnu/packages/patches/opendjk-9-aarch64-a0a919603c1546ce86fe659df3636b5a24b9caeb.patch new file mode 100644 index 0000000000..c55a3253ee --- /dev/null +++ b/gnu/packages/patches/opendjk-9-aarch64-a0a919603c1546ce86fe659df3636b5a24b9caeb.patch @@ -0,0 +1,371 @@ +From a0a919603c1546ce86fe659df3636b5a24b9caeb Mon Sep 17 00:00:00 2001 +From: Nick Gasson +Date: Mon, 17 Jun 2019 15:31:49 +0800 +Subject: [PATCH] 8224851: AArch64: fix warnings and errors with Clang and GCC + 8.3 + +Reviewed-by: aph, kbarrett +--- + hotspot/src/cpu/aarch64/vm/aarch64.ad | 8 +-- + hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp | 4 +- + .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 12 ++-- + .../cpu/aarch64/c1_LIRGenerator_aarch64.cpp | 4 +- + hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 10 +-- + .../cpu/aarch64/interp_masm_aarch64.hpp | 2 - + .../cpu/aarch64/macroAssembler_aarch64.cpp | 2 +- + .../aarch64/macroAssembler_aarch64_log.cpp | 4 +- + .../aarch64/macroAssembler_aarch64_trig.cpp | 30 ++++----- + .../cpu/aarch64/vm_version_aarch64.cpp | 2 +- + .../linux_aarch64/atomic_linux_aarch64.hpp | 4 +- + .../os_cpu/linux_aarch64/copy_linux_aarch64.s | 2 +- + .../os_cpu/linux_aarch64/os_linux_aarch64.cpp | 61 ++++++------------- + 13 files changed, 62 insertions(+), 83 deletions(-) + +diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad +index e6a1bc8bba98..a5afb2a08fef 100644 +--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad ++++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad +@@ -14255,7 +14255,7 @@ instruct compF_reg_zero(rFlagsReg cr, vRegF src1, immF0 src2) + format %{ "fcmps $src1, 0.0" %} + + ins_encode %{ +- __ fcmps(as_FloatRegister($src1$$reg), 0.0D); ++ __ fcmps(as_FloatRegister($src1$$reg), 0.0); + %} + + ins_pipe(pipe_class_compare); +@@ -14284,7 +14284,7 @@ instruct compD_reg_zero(rFlagsReg cr, vRegD src1, immD0 src2) + format %{ "fcmpd $src1, 0.0" %} + + ins_encode %{ +- __ fcmpd(as_FloatRegister($src1$$reg), 0.0D); ++ __ fcmpd(as_FloatRegister($src1$$reg), 0.0); + %} + + ins_pipe(pipe_class_compare); +@@ -14360,7 +14360,7 @@ instruct compF3_reg_immF0(iRegINoSp dst, vRegF src1, immF0 zero, rFlagsReg cr) + Label done; + FloatRegister s1 = as_FloatRegister($src1$$reg); + Register d = as_Register($dst$$reg); +- __ fcmps(s1, 0.0D); ++ __ fcmps(s1, 0.0); + // installs 0 if EQ else -1 + __ csinvw(d, zr, zr, Assembler::EQ); + // keeps -1 if less or unordered else installs 1 +@@ -14387,7 +14387,7 @@ instruct compD3_reg_immD0(iRegINoSp dst, vRegD src1, immD0 zero, rFlagsReg cr) + Label done; + FloatRegister s1 = as_FloatRegister($src1$$reg); + Register d = as_Register($dst$$reg); +- __ fcmpd(s1, 0.0D); ++ __ fcmpd(s1, 0.0); + // installs 0 if EQ else -1 + __ csinvw(d, zr, zr, Assembler::EQ); + // keeps -1 if less or unordered else installs 1 +diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +index 3bb620d52e0a..a95417a467a9 100644 +--- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp ++++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +@@ -276,7 +276,7 @@ class Instruction_aarch64 { + unsigned get(int msb = 31, int lsb = 0) { + int nbits = msb - lsb + 1; + unsigned mask = ((1U << nbits) - 1) << lsb; +- assert_cond(bits & mask == mask); ++ assert_cond((bits & mask) == mask); + return (insn & mask) >> lsb; + } + +@@ -2644,7 +2644,7 @@ void mvnw(Register Rd, Register Rm, + // RBIT only allows T8B and T16B but encodes them oddly. Argh... + void rbit(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn) { + assert((ASSERTION), MSG); +- _rbit(Vd, SIMD_Arrangement(T & 1 | 0b010), Vn); ++ _rbit(Vd, SIMD_Arrangement((T & 1) | 0b010), Vn); + } + #undef ASSERTION + +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +index 100b9e9c1154..eb013eb52be4 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +@@ -1078,8 +1078,8 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { + // Assembler::EQ does not permit unordered branches, so we add + // another branch here. Likewise, Assembler::NE does not permit + // ordered branches. +- if (is_unordered && op->cond() == lir_cond_equal +- || !is_unordered && op->cond() == lir_cond_notEqual) ++ if ((is_unordered && op->cond() == lir_cond_equal) ++ || (!is_unordered && op->cond() == lir_cond_notEqual)) + __ br(Assembler::VS, *(op->ublock()->label())); + switch(op->cond()) { + case lir_cond_equal: acond = Assembler::EQ; break; +@@ -1789,18 +1789,22 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr + switch (code) { + case lir_add: __ fadds (dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break; + case lir_sub: __ fsubs (dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break; ++ case lir_mul_strictfp: // fall through + case lir_mul: __ fmuls (dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break; ++ case lir_div_strictfp: // fall through + case lir_div: __ fdivs (dest->as_float_reg(), left->as_float_reg(), right->as_float_reg()); break; + default: + ShouldNotReachHere(); + } + } else if (left->is_double_fpu()) { + if (right->is_double_fpu()) { +- // cpu register - cpu register ++ // fpu register - fpu register + switch (code) { + case lir_add: __ faddd (dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break; + case lir_sub: __ fsubd (dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break; ++ case lir_mul_strictfp: // fall through + case lir_mul: __ fmuld (dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break; ++ case lir_div_strictfp: // fall through + case lir_div: __ fdivd (dest->as_double_reg(), left->as_double_reg(), right->as_double_reg()); break; + default: + ShouldNotReachHere(); +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +index 19c9ea688f6d..185e93b99f93 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +@@ -426,7 +426,7 @@ void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) { + tmp = new_register(T_DOUBLE); + } + +- arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), NULL); ++ arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), x->is_strictfp()); + + set_result(x, round_item(reg)); + } +diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +index 08b8f2b915b7..3019cb01acc6 100644 +--- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +@@ -768,11 +768,13 @@ extern "C" void npf() { + + extern "C" void pf(unsigned long sp, unsigned long fp, unsigned long pc, + unsigned long bcx, unsigned long thread) { +- RegisterMap map((JavaThread*)thread, false); + if (!reg_map) { +- reg_map = (RegisterMap*)os::malloc(sizeof map, mtNone); ++ reg_map = NEW_C_HEAP_OBJ(RegisterMap, mtNone); ++ ::new (reg_map) RegisterMap((JavaThread*)thread, false); ++ } else { ++ *reg_map = RegisterMap((JavaThread*)thread, false); + } +- memcpy(reg_map, &map, sizeof map); ++ + { + CodeBlob *cb = CodeCache::find_blob((address)pc); + if (cb && cb->frame_size()) +diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +index 72ec4cd1e36b..8168b50ec9f1 100644 +--- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp ++++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +@@ -38,8 +38,6 @@ class InterpreterMacroAssembler: public MacroAssembler { + protected: + + protected: +- using MacroAssembler::call_VM_leaf_base; +- + // Interpreter specific version of call_VM_base + using MacroAssembler::call_VM_leaf_base; + +diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +index 5bfa8133d5bb..1c264b4df248 100644 +--- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +@@ -2681,7 +2681,7 @@ Address MacroAssembler::spill_address(int size, int offset, Register tmp) + if ((offset & (size-1)) && offset >= (1<<8)) { + add(tmp, base, offset & ((1<<12)-1)); + base = tmp; +- offset &= -1<<12; ++ offset &= -1u<<12; + } + + if (offset >= (1<<12) * size) { +diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +index b917636cb635..dbf1dcdb5409 100644 +--- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +@@ -177,7 +177,7 @@ void VM_Version::get_processor_features() { + if (FILE *f = fopen("/proc/cpuinfo", "r")) { + char buf[128], *p; + while (fgets(buf, sizeof (buf), f) != NULL) { +- if (p = strchr(buf, ':')) { ++ if ((p = strchr(buf, ':')) != NULL) { + long v = strtol(p+1, NULL, 0); + if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) { + _cpu = v; +diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.s b/hotspot/src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.s +index 25e3b054f779..4b8ed597c59f 100644 +--- a/hotspot/src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.s ++++ b/hotspot/src/os_cpu/linux_aarch64/vm/copy_linux_aarch64.s +@@ -159,7 +159,7 @@ bwd_copy_aligned: + blo bwd_copy_drain + + bwd_copy_again: +- prfm pldl1keep, [s, #-256] ++ prfum pldl1keep, [s, #-256] + stp t0, t1, [d, #-16] + ldp t0, t1, [s, #-16] + stp t2, t3, [d, #-32] +diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +index c728687a4044..e428e89baa09 100644 +--- a/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp ++++ b/hotspot/src/os_cpu/linux_aarch64/vm/os_linux_aarch64.cpp +@@ -83,19 +83,13 @@ + #define REG_SP REG_RSP + #define REG_PC REG_RIP + #define REG_FP REG_RBP +-#define SPELL_REG_SP "rsp" +-#define SPELL_REG_FP "rbp" + #else + #define REG_FP 29 + #define REG_LR 30 +- +-#define SPELL_REG_SP "sp" +-#define SPELL_REG_FP "x29" + #endif + +-address os::current_stack_pointer() { +- register void *esp __asm__ (SPELL_REG_SP); +- return (address) esp; ++NOINLINE address os::current_stack_pointer() { ++ return (address)__builtin_frame_address(0); + } + + char* os::non_memory_address_word() { +@@ -233,14 +233,8 @@ frame os::get_sender_for_C_frame(frame* fr) { + #endif + } + +-intptr_t* _get_previous_fp() { +- register intptr_t **ebp __asm__ (SPELL_REG_FP); +- return (intptr_t*) *ebp; // we want what it points to. +-} +- +- +-frame os::current_frame() { +- intptr_t* fp = _get_previous_fp(); ++NOINLINE frame os::current_frame() { ++ intptr_t *fp = *(intptr_t **)__builtin_frame_address(0); + frame myframe((intptr_t*)os::current_stack_pointer(), + (intptr_t*)fp, + CAST_FROM_FN_PTR(address, os::current_frame)); +@@ -259,12 +238,6 @@ frame os::current_frame() { + } + + // Utility functions +- +-// From IA32 System Programming Guide +-enum { +- trap_page_fault = 0xE +-}; +- + #ifdef BUILTIN_SIM + extern "C" void Fetch32PFI () ; + extern "C" void Fetch32Resume () ; +@@ -667,42 +640,42 @@ extern "C" { + return 0; + } + +- void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { ++ void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) { + if (from > to) { +- jshort *end = from + count; ++ const jshort *end = from + count; + while (from < end) + *(to++) = *(from++); + } + else if (from < to) { +- jshort *end = from; ++ const jshort *end = from; + from += count - 1; + to += count - 1; + while (from >= end) + *(to--) = *(from--); + } + } +- void _Copy_conjoint_jints_atomic(jint* from, jint* to, size_t count) { ++ void _Copy_conjoint_jints_atomic(const jint* from, jint* to, size_t count) { + if (from > to) { +- jint *end = from + count; ++ const jint *end = from + count; + while (from < end) + *(to++) = *(from++); + } + else if (from < to) { +- jint *end = from; ++ const jint *end = from; + from += count - 1; + to += count - 1; + while (from >= end) + *(to--) = *(from--); + } + } +- void _Copy_conjoint_jlongs_atomic(jlong* from, jlong* to, size_t count) { ++ void _Copy_conjoint_jlongs_atomic(volatile jlong* from, volatile jlong* to, size_t count) { + if (from > to) { +- jlong *end = from + count; ++ const jlong *end = (const jlong*)from + count; + while (from < end) + os::atomic_copy64(from++, to++); + } + else if (from < to) { +- jlong *end = from; ++ const jlong *end = (const jlong*)from; + from += count - 1; + to += count - 1; + while (from >= end) +@@ -710,22 +683,22 @@ extern "C" { + } + } + +- void _Copy_arrayof_conjoint_bytes(HeapWord* from, ++ void _Copy_arrayof_conjoint_bytes(const HeapWord* from, + HeapWord* to, + size_t count) { + memmove(to, from, count); + } +- void _Copy_arrayof_conjoint_jshorts(HeapWord* from, ++ void _Copy_arrayof_conjoint_jshorts(const HeapWord* from, + HeapWord* to, + size_t count) { + memmove(to, from, count * 2); + } +- void _Copy_arrayof_conjoint_jints(HeapWord* from, ++ void _Copy_arrayof_conjoint_jints(const HeapWord* from, + HeapWord* to, + size_t count) { + memmove(to, from, count * 4); + } +- void _Copy_arrayof_conjoint_jlongs(HeapWord* from, ++ void _Copy_arrayof_conjoint_jlongs(const HeapWord* from, + HeapWord* to, + size_t count) { + memmove(to, from, count * 8); +diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp +index 937cd47..a6c9a87 100644 +--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp ++++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp +@@ -99,18 +99,16 @@ inline int os::ftruncate(int fd, jlong length) { + inline struct dirent* os::readdir(DIR* dirp, dirent *dbuf) + { + dirent* p; +- int status; + assert(dirp != NULL, "just checking"); + + // NOTE: Linux readdir_r (on RH 6.2 and 7.2 at least) is NOT like the POSIX + // version. Here is the doc for this function: + // http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_262.html + +- if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { +- errno = status; +- return NULL; +- } else ++ if((p = ::readdir(dirp)) != NULL) { + return p; ++ } else ++ return NULL; + } + + inline int os::closedir(DIR *dirp) { base-commit: 472706ae2f9160833951a4e4bcc4c206e03097b0 -- 2.39.0