openjdk17: fix build on armv7l-musl

This commit is contained in:
classabbyamp 2023-09-12 19:16:30 -04:00
parent 2296452200
commit 7973d7a445
No known key found for this signature in database
GPG key ID: 6BE0755918A4C7F5

View file

@ -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 <simon-alpine@fraho.eu>
@ -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;
}