Skip to content

Commit

Permalink
openjdk17: fix build on armv7l-musl
Browse files Browse the repository at this point in the history
  • Loading branch information
classabbyamp committed Sep 12, 2023
1 parent 2296452 commit 7973d7a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions srcpkgs/openjdk17/patches/FixNullPtrCast.patch
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -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;
}

0 comments on commit 7973d7a

Please sign in to comment.