From 7973d7a44522ffa893af1ed128659e9482687c5a Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 12 Sep 2023 19:16:30 -0400 Subject: [PATCH] openjdk17: fix build on armv7l-musl --- srcpkgs/openjdk17/patches/FixNullPtrCast.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/srcpkgs/openjdk17/patches/FixNullPtrCast.patch b/srcpkgs/openjdk17/patches/FixNullPtrCast.patch index 7699327e1c2..6f051587927 100644 --- a/srcpkgs/openjdk17/patches/FixNullPtrCast.patch +++ b/srcpkgs/openjdk17/patches/FixNullPtrCast.patch @@ -1,5 +1,7 @@ Patch taken from Alpine: https://git.alpinelinux.org/aports/tree/community/openjdk17/FixNullPtrCast.patch +same fix for armv7l-musl added + Subject: Fix cast errors with latest GCC Upstream: No Author: Simon Frankenberger @@ -17,3 +19,18 @@ This patch fixes one remaining casting error reported by GCC 12 for aarch64 if (pass_gpr(value) < 0) { pass_stack<>(value); } + +--- old/src/hotspot/cpu/arm/interpreterRT_arm.cpp ++++ new/src/hotspot/cpu/arm/interpreterRT_arm.cpp +@@ -306,8 +306,8 @@ + virtual void pass_object() { + intptr_t from_addr = (intptr_t)(_from + Interpreter::local_offset_in_bytes(0)); + if(_last_gp < GPR_PARAMS) { +- _toGP[_last_gp++] = (*(intptr_t*)from_addr == 0) ? NULL : from_addr; ++ _toGP[_last_gp++] = (*(intptr_t*)from_addr == 0) ? (intptr_t) 0 : (intptr_t)from_addr; + } else { +- *_to++ = (*(intptr_t*)from_addr == 0) ? NULL : from_addr; ++ *_to++ = (*(intptr_t*)from_addr == 0) ? (intptr_t) 0 : (intptr_t)from_addr; + } + _from -= Interpreter::stackElementSize; + }