<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/4cb55464645e672bb68786421839a91b4f10ca17">https://github.com/macports/macports-ports/commit/4cb55464645e672bb68786421839a91b4f10ca17</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 4cb55464645e672bb68786421839a91b4f10ca17
</span>Author: Saagar Jha <saagar@saagarjha.com>
AuthorDate: Fri Apr 8 06:08:47 2022 -0700
<span style='display:block; white-space:pre;color:#404040;'> openjdk17: Fix build for arm64
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> On arm64 this patch is necessary because clang miscompiles the assembler
</span><span style='display:block; white-space:pre;color:#404040;'> without it.
</span>---
java/openjdk17/Portfile | 3 +-
...OS-hotspot-arm64-bug-exposed-by-latest-cl.patch | 36 ++++++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk17/Portfile b/java/openjdk17/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 77bac0527c4..e67d62aa119 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/java/openjdk17/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/java/openjdk17/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -24,7 +24,8 @@ depends_build port:autoconf \
</span> port:openjdk17-bootstrap
if {${configure.build_arch} eq "arm64"} {
if {${os.major} == 21} {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- patchfiles patch-openjdk17-build1.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ patchfiles patch-openjdk17-build1.diff \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 0001-8280476-macOS-hotspot-arm64-bug-exposed-by-latest-cl.patch
</span> } else {
patchfiles
}
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/java/openjdk17/files/0001-8280476-macOS-hotspot-arm64-bug-exposed-by-latest-cl.patch b/java/openjdk17/files/0001-8280476-macOS-hotspot-arm64-bug-exposed-by-latest-cl.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..93d194ae7d4
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/java/openjdk17/files/0001-8280476-macOS-hotspot-arm64-bug-exposed-by-latest-cl.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,36 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From f5d6fddc6df8c5c5456a2544b131833d5227292b Mon Sep 17 00:00:00 2001
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: "Daniel D. Daugherty" <dcubed@openjdk.org>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Date: Fri, 4 Feb 2022 17:37:01 +0000
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Subject: [PATCH] 8280476: [macOS] : hotspot arm64 bug exposed by latest clang
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Reviewed-by: kbarrett, adinn
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ src/hotspot/cpu/aarch64/immediate_aarch64.cpp | 11 ++++++++++-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 1 file changed, 10 insertions(+), 1 deletion(-)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git src/hotspot/cpu/aarch64/immediate_aarch64.cpp src/hotspot/cpu/aarch64/immediate_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 3e38b7cca04..916494605bc 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- src/hotspot/cpu/aarch64/immediate_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ src/hotspot/cpu/aarch64/immediate_aarch64.cpp
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -129,8 +129,17 @@ static inline uint32_t uimm(uint32_t val, int hi, int lo)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t replicate(uint64_t bits, int nbits, int count)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(count > 0, "must be");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(nbits > 0, "must be");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ assert(count * nbits <= 64, "must be");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // Special case nbits == 64 since the shift below with that nbits value
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ // would result in undefined behavior.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ if (nbits == 64) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return bits;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t result = 0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- // nbits may be 64 in which case we want mask to be -1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t mask = ones(nbits);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (int i = 0; i < count ; i++) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ result <<= nbits;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+2.35.1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span></pre><pre style='margin:0'>
</pre>