mirror of
https://github.com/openbsd/ports.git
synced 2026-06-17 23:13:55 +02:00
devel/jdk/{11,17,21,25}: fix build with llvm22, ok kurt (maintainer)
All the jdks have a -Wuninitialized-const-pointer error due to passing the uninitialized pict_attr to XRenderCreatePicture() for which this is a const argument. This should be harmless because the valuemask is 0, so none of the attributes are read in _XRenderProcessPictureAttributes(). Initializing the attributes to 0 doesn't change that but makes the compiler happy. Same fix is already upstream: https://github.com/bsdkurt/jdk/commit/0dd5b59194f32f54c2ec6572833f45e1402515ba On top of that jdk/25 has -Wnontrivial-memcall errors, with an annotation that suggests an explicit cast to void *, which probably just papers over the actual problem... https://github.com/llvm/llvm-project/pull/111434 https://gcc.gnu.org/legacy-ml/gcc-patches/2017-04/msg01571.html Better fix here, but kurt thinks it's not worth backporting: https://github.com/bsdkurt/jdk/commit/66fb015267058f9b5e6788eaeaa758be56ba553e
This commit is contained in:
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
|
||||
PKGSTEM= jdk-11
|
||||
EPOCH= 0
|
||||
|
||||
REVISION= 0
|
||||
|
||||
DIST_SUBDIR= jdk
|
||||
DISTNAME= jdk-${VERSION_STR}
|
||||
WRKDIST= ${WRKDIR}/jdk11u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
error: variable 'pict_attr' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
|
||||
|
||||
Index: src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
--- src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c.orig
|
||||
+++ src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
@@ -398,7 +398,7 @@ Java_sun_java2d_xr_XRBackendNative_createPixmap(JNIEnv
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_sun_java2d_xr_XRBackendNative_createPictureNative
|
||||
(JNIEnv *env, jclass cls, jint drawable, jlong formatPtr) {
|
||||
- XRenderPictureAttributes pict_attr;
|
||||
+ XRenderPictureAttributes pict_attr = { 0 };
|
||||
return XRenderCreatePicture(awt_display, (Drawable) drawable,
|
||||
(XRenderPictFormat *) jlong_to_ptr(formatPtr),
|
||||
0, &pict_attr);
|
||||
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
|
||||
PKGSTEM= jdk-17
|
||||
EPOCH= 0
|
||||
|
||||
REVISION= 0
|
||||
|
||||
DIST_SUBDIR= jdk
|
||||
DISTNAME= jdk-${VERSION_STR}
|
||||
WRKDIST= ${WRKDIR}/jdk17u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
error: variable 'pict_attr' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
|
||||
|
||||
Index: src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
--- src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c.orig
|
||||
+++ src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
@@ -339,7 +339,7 @@ Java_sun_java2d_xr_XRBackendNative_createPixmap(JNIEnv
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_sun_java2d_xr_XRBackendNative_createPictureNative
|
||||
(JNIEnv *env, jclass cls, jint drawable, jlong formatPtr) {
|
||||
- XRenderPictureAttributes pict_attr;
|
||||
+ XRenderPictureAttributes pict_attr = { 0 };
|
||||
return XRenderCreatePicture(awt_display, (Drawable) drawable,
|
||||
(XRenderPictFormat *) jlong_to_ptr(formatPtr),
|
||||
0, &pict_attr);
|
||||
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
|
||||
PKGSTEM= jdk-21
|
||||
EPOCH= 0
|
||||
|
||||
REVISION= 0
|
||||
|
||||
DIST_SUBDIR= jdk
|
||||
DISTNAME= jdk-${VERSION_STR}
|
||||
WRKDIST= ${WRKDIR}/jdk21u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
error: variable 'pict_attr' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
|
||||
|
||||
Index: src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
--- src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c.orig
|
||||
+++ src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
@@ -339,7 +339,7 @@ Java_sun_java2d_xr_XRBackendNative_createPixmap(JNIEnv
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_sun_java2d_xr_XRBackendNative_createPictureNative
|
||||
(JNIEnv *env, jclass cls, jint drawable, jlong formatPtr) {
|
||||
- XRenderPictureAttributes pict_attr;
|
||||
+ XRenderPictureAttributes pict_attr = { 0 };
|
||||
return XRenderCreatePicture(awt_display, (Drawable) drawable,
|
||||
(XRenderPictFormat *) jlong_to_ptr(formatPtr),
|
||||
0, &pict_attr);
|
||||
@@ -13,6 +13,8 @@ PKGNAME= jdk-${PACKAGE_VER}
|
||||
PKGSTEM= jdk-25
|
||||
EPOCH= 0
|
||||
|
||||
REVISION= 0
|
||||
|
||||
DIST_SUBDIR= jdk
|
||||
DISTNAME= jdk-${VERSION_STR}
|
||||
WRKDIST= ${WRKDIR}/jdk25u-jdk-${BASE_VER}-${BUILD_VER}-${BSD_PORT_REL}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
error: first argument in call to 'memset' is a pointer to non-trivially copyable type 'ResolvedFieldEntry' [-Werror,-Wnontrivial-memcall]
|
||||
|
||||
Index: src/hotspot/share/oops/resolvedFieldEntry.cpp
|
||||
--- src/hotspot/share/oops/resolvedFieldEntry.cpp.orig
|
||||
+++ src/hotspot/share/oops/resolvedFieldEntry.cpp
|
||||
@@ -46,7 +46,7 @@ void ResolvedFieldEntry::print_on(outputStream* st) co
|
||||
#if INCLUDE_CDS
|
||||
void ResolvedFieldEntry::remove_unshareable_info() {
|
||||
u2 saved_cpool_index = _cpool_index;
|
||||
- memset(this, 0, sizeof(*this));
|
||||
+ memset((void *)this, 0, sizeof(*this));
|
||||
_cpool_index = saved_cpool_index;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
error: first argument in call to 'memset' is a pointer to non-trivially copyable type 'ResolvedMethodEntry' [-Werror,-Wnontrivial-memcall]
|
||||
|
||||
Index: src/hotspot/share/oops/resolvedMethodEntry.cpp
|
||||
--- src/hotspot/share/oops/resolvedMethodEntry.cpp.orig
|
||||
+++ src/hotspot/share/oops/resolvedMethodEntry.cpp
|
||||
@@ -40,12 +40,12 @@ void ResolvedMethodEntry::reset_entry() {
|
||||
if (has_resolved_references_index()) {
|
||||
u2 saved_resolved_references_index = _entry_specific._resolved_references_index;
|
||||
u2 saved_cpool_index = _cpool_index;
|
||||
- memset(this, 0, sizeof(*this));
|
||||
+ memset((void *)this, 0, sizeof(*this));
|
||||
set_resolved_references_index(saved_resolved_references_index);
|
||||
_cpool_index = saved_cpool_index;
|
||||
} else {
|
||||
u2 saved_cpool_index = _cpool_index;
|
||||
- memset(this, 0, sizeof(*this));
|
||||
+ memset((void *)this, 0, sizeof(*this));
|
||||
_cpool_index = saved_cpool_index;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
error: variable 'pict_attr' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
|
||||
|
||||
Index: src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
--- src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c.orig
|
||||
+++ src/java.desktop/unix/native/libawt_xawt/java2d/x11/XRBackendNative.c
|
||||
@@ -339,7 +339,7 @@ Java_sun_java2d_xr_XRBackendNative_createPixmap(JNIEnv
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_sun_java2d_xr_XRBackendNative_createPictureNative
|
||||
(JNIEnv *env, jclass cls, jint drawable, jlong formatPtr) {
|
||||
- XRenderPictureAttributes pict_attr;
|
||||
+ XRenderPictureAttributes pict_attr = { 0 };
|
||||
return XRenderCreatePicture(awt_display, (Drawable) drawable,
|
||||
(XRenderPictFormat *) jlong_to_ptr(formatPtr),
|
||||
0, &pict_attr);
|
||||
Reference in New Issue
Block a user