Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Oct 2020 13:41:33 +0900 (JST)
From:      Yasuhiro KIMURA <yasu@utahime.org>
To:        freebsd-ports@freebsd.org
Subject:   Re: OpenJDK ports and 13-CURRENT
Message-ID:  <20201011.134133.2132611348164359361.yasu@utahime.org>
In-Reply-To: <20201011.083539.2263084724392057537.yasu@utahime.org>
References:  <20201010194926.jnypzmbpu33wilbl@mutt-hbsd> <EDFDEDBE-1228-4D7F-BB8B-1610F5B1A10A@FreeBSD.org> <20201011.083539.2263084724392057537.yasu@utahime.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Yasuhiro KIMURA <yasu@utahime.org>
Subject: Re: OpenJDK ports and 13-CURRENT
Date: Sun, 11 Oct 2020 08:35:39 +0900 (JST)

> From: Dimitry Andric <dim@FreeBSD.org>
> Subject: Re: OpenJDK ports and 13-CURRENT
> Date: Sun, 11 Oct 2020 00:57:33 +0200
> 
>> Can you try the attached patch? I haven't yet looked at openjdk 13 and
>> up, but I assume they will need at least the XSynchronize fix, and maybe
>> the above ones, if the upstream branches were made after 2020-02-05.
> 
> I tried your patch but it fails at patch phase as following.

I modified your patch as following and now build of java/openjdk12
succeeeds on 13-CURRENT amd64 r366578.


>From 5fb14c6b20c000f57ad975d79aed0072f142ec80 Mon Sep 17 00:00:00 2001
From: Yasuhiro KIMURA <yasu@utahime.org>
Date: Sun, 11 Oct 2020 10:28:47 +0900
Subject: [PATCH] java/openjdk12: Fix build with -fno-common (Clang 11/GCC 10)

Fix build with -fno-common (Clang 11/GCC 10)
---
 java/openjdk12/files/patch-changeset-57932    | 27 +++++++++++++++++++
 java/openjdk12/files/patch-changeset-57994    | 26 ++++++++++++++++++
 ..._unix_classes_sun_awt_X11_XlibWrapper.java | 11 ++++++++
 ...nix_native_libawt__xawt_xawt_XlibWrapper.c | 15 +++++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 java/openjdk12/files/patch-changeset-57932
 create mode 100644 java/openjdk12/files/patch-changeset-57994
 create mode 100644 java/openjdk12/files/patch-src_java.desktop_unix_classes_sun_awt_X11_XlibWrapper.java
 create mode 100644 java/openjdk12/files/patch-src_java.desktop_unix_native_libawt__xawt_xawt_XlibWrapper.c

diff --git a/java/openjdk12/files/patch-changeset-57932 b/java/openjdk12/files/patch-changeset-57932
new file mode 100644
index 000000000000..24b929d5ac08
--- /dev/null
+++ b/java/openjdk12/files/patch-changeset-57932
@@ -0,0 +1,27 @@
+changeset:   57932:9e54ea7d9cd9
+user:        qpzhang
+date:        Wed Feb 05 20:31:09 2020 +0800
+summary:     8238388: libj2gss/NativeFunc.o "multiple definition" link errors with GCC10
+
+--- src/java.security.jgss/share/native/libj2gss/NativeFunc.c.orig	2020-04-17 22:35:42 UTC
++++ src/java.security.jgss/share/native/libj2gss/NativeFunc.c
+@@ -27,6 +27,9 @@
+ #include <stdlib.h>
+ #include "NativeFunc.h"
+ 
++/* global GSS function table */
++GSS_FUNCTION_TABLE_PTR ftab;
++
+ /* standard GSS method names (ordering is from mapfile) */
+ static const char RELEASE_NAME[]                = "gss_release_name";
+ static const char IMPORT_NAME[]                 = "gss_import_name";
+--- src/java.security.jgss/share/native/libj2gss/NativeFunc.h.orig	2020-04-17 22:35:42 UTC
++++ src/java.security.jgss/share/native/libj2gss/NativeFunc.h
+@@ -277,6 +277,6 @@ typedef struct GSS_FUNCTION_TABLE {
+ typedef GSS_FUNCTION_TABLE *GSS_FUNCTION_TABLE_PTR;
+ 
+ /* global GSS function table */
+-GSS_FUNCTION_TABLE_PTR ftab;
++extern GSS_FUNCTION_TABLE_PTR ftab;
+ 
+ #endif
diff --git a/java/openjdk12/files/patch-changeset-57994 b/java/openjdk12/files/patch-changeset-57994
new file mode 100644
index 000000000000..ac5ef8190d89
--- /dev/null
+++ b/java/openjdk12/files/patch-changeset-57994
@@ -0,0 +1,26 @@
+changeset:   57994:6925fca95959
+user:        qpzhang
+date:        Tue Feb 04 21:27:10 2020 +0800
+summary:     8238380: java.base/unix/native/libjava/childproc.c "multiple definition" link errors with GCC10
+
+--- src/java.base/unix/native/libjava/childproc.c.orig	2020-04-17 22:35:42 UTC
++++ src/java.base/unix/native/libjava/childproc.c
+@@ -33,6 +33,7 @@
+ 
+ #include "childproc.h"
+ 
++const char * const *parentPathv;
+ 
+ ssize_t
+ restartableWrite(int fd, const void *buf, size_t count)
+--- src/java.base/unix/native/libjava/childproc.h.orig	2020-04-17 22:35:42 UTC
++++ src/java.base/unix/native/libjava/childproc.h
+@@ -118,7 +118,7 @@ typedef struct _SpawnInfo {
+  * The cached and split version of the JDK's effective PATH.
+  * (We don't support putenv("PATH=...") in native code)
+  */
+-const char * const *parentPathv;
++extern const char * const *parentPathv;
+ 
+ ssize_t restartableWrite(int fd, const void *buf, size_t count);
+ int restartableDup2(int fd_from, int fd_to);
diff --git a/java/openjdk12/files/patch-src_java.desktop_unix_classes_sun_awt_X11_XlibWrapper.java b/java/openjdk12/files/patch-src_java.desktop_unix_classes_sun_awt_X11_XlibWrapper.java
new file mode 100644
index 000000000000..4f3913a95410
--- /dev/null
+++ b/java/openjdk12/files/patch-src_java.desktop_unix_classes_sun_awt_X11_XlibWrapper.java
@@ -0,0 +1,11 @@
+--- src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java.orig	2020-04-17 22:35:42 UTC
++++ src/java.desktop/unix/classes/sun/awt/X11/XlibWrapper.java
+@@ -529,7 +529,7 @@ static native String XSetLocaleModifiers(String modifi
+           display   Specifies the connection to the X server.
+           onoff     Specifies a Boolean value that indicates whether to enable or disable synchronization.
+      */
+-    static native int XSynchronize(long display, boolean onoff);
++    static native long XSynchronize(long display, boolean onoff);
+ 
+     /**
+      * Extracts an X event that can be processed in a secondary loop.
diff --git a/java/openjdk12/files/patch-src_java.desktop_unix_native_libawt__xawt_xawt_XlibWrapper.c b/java/openjdk12/files/patch-src_java.desktop_unix_native_libawt__xawt_xawt_XlibWrapper.c
new file mode 100644
index 000000000000..b4d602993ab9
--- /dev/null
+++ b/java/openjdk12/files/patch-src_java.desktop_unix_native_libawt__xawt_xawt_XlibWrapper.c
@@ -0,0 +1,15 @@
+--- src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c.orig	2020-04-17 22:35:42 UTC
++++ src/java.desktop/unix/native/libawt_xawt/xawt/XlibWrapper.c
+@@ -2180,10 +2180,10 @@ Java_sun_awt_X11_XlibWrapper_copyLongArray(JNIEnv *env
+     }
+ }
+ 
+-JNIEXPORT jint JNICALL
++JNIEXPORT jlong JNICALL
+ Java_sun_awt_X11_XlibWrapper_XSynchronize(JNIEnv *env, jclass clazz, jlong display, jboolean onoff)
+ {
+-    return (jint) XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False));
++    return ptr_to_jlong(XSynchronize((Display*)jlong_to_ptr(display), (onoff == JNI_TRUE ? True : False)));
+ }
+ 
+ JNIEXPORT jboolean JNICALL
-- 
2.28.0

---
Yasuhiro KIMURA



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201011.134133.2132611348164359361.yasu>