From github.com+40482367+khanhduytran0 at openjdk.java.net Sun Nov 1 00:31:58 2020 From: github.com+40482367+khanhduytran0 at openjdk.java.net (Tran Khanh Duy) Date: Sun, 1 Nov 2020 00:31:58 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 26 Oct 2020 08:47:51 GMT, Magnus Ihse Bursie wrote: >> Johan Vos has updated the pull request incrementally with one additional commit since the last revision: >> >> fix fi/endif issue > > Changes requested by ihse (no project role). Excuse me, but why don't you port jdk8 instead? Also, I succeed to port jdk8 to Android, but stuck at static jboolean InitSimpleTypes ^ Please submit a full bug report, with preprocessed source if appropriate. See for instructions. make[2]: *** [/home/runner/work/android-openjdk-build-multiarch/android-openjdk-build-multiarch/openjdk/build/linux-aarch64-normal-server-release/jdk/objs/libawt/GraphicsPrimitiveMgr.o] Error 1 lib/Awt2dLibraries.gmk:468: recipe for target '/home/runner/work/android-openjdk-build-multiarch/android-openjdk-build-multiarch/openjdk/build/linux-aarch64-normal-server-release/jdk/objs/libawt/GraphicsPrimitiveMgr.o' failed make[2]: *** Waiting for unfinished jobs.... BuildJdk.gmk:70: recipe for target 'libs-only' failed make[1]: *** [libs-only] Error 2 make: *** [jdk-only] Error 2 At for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) { If I comment out the check `pHdr < pEnd`, then it built. But I want it to complete headless AWT to get [Caciocavallo project working](https://openjdk.java.net/projects/caciocavallo/) or [wrap `Graphics2D` to Android `Canvas`](https://android.googlesource.com/platform/frameworks/native/+/1c07fd511df873d9c4b6dcd066529959f7809ff6/awt/com/android/internal/awt/AndroidGraphics2D.java). ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Mon Nov 2 15:10:13 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Mon, 2 Nov 2020 15:10:13 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v4] In-Reply-To: References: Message-ID: > exclude some modules that are not relevant on Mobile. > Fix for JDK-8255240 Johan Vos has updated the pull request incrementally with one additional commit since the last revision: Fix OS/CPU mistake to not include SA on mobile include hotspot.agent, management and management.agent ------------- Changes: - all: https://git.openjdk.java.net/mobile/pull/10/files - new: https://git.openjdk.java.net/mobile/pull/10/files/f9040c97..91302188 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=mobile&pr=10&range=03 - incr: https://webrevs.openjdk.java.net/?repo=mobile&pr=10&range=02-03 Stats: 10 lines in 3 files changed: 4 ins; 3 del; 3 mod Patch: https://git.openjdk.java.net/mobile/pull/10.diff Fetch: git fetch https://git.openjdk.java.net/mobile pull/10/head:pull/10 PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Mon Nov 2 15:10:14 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Mon, 2 Nov 2020 15:10:14 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Sun, 1 Nov 2020 00:26:21 GMT, Tran Khanh Duy wrote: > Excuse me, but why don't you port jdk8 instead? This repository is auto-synced from upstream openjdk/jdk which is 16-ea currently. I don't see a reason why we want Java 8 on Android/ios while we have 15 and beyond on desktop? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Mon Nov 2 15:10:15 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Mon, 2 Nov 2020 15:10:15 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Sat, 24 Oct 2020 13:14:47 GMT, Bob Vandette wrote: >> Johan Vos has updated the pull request incrementally with one additional commit since the last revision: >> >> fix fi/endif issue > > make/common/Modules.gmk line 235: > >> 233: >> 234: ################################################################################ >> 235: # Filter out specific modules for mobile platforms > > Is there a reason why you want to excluded these modules? I would think that it might be nice to be able to manage a mobile application remotely. If these modules are incompatible with native-image, then just remove them from your built images when you create a GraalVM builder image. They are included again now. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Mon Nov 2 15:10:17 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Mon, 2 Nov 2020 15:10:17 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 26 Oct 2020 08:40:44 GMT, Magnus Ihse Bursie wrote: >> Johan Vos has updated the pull request incrementally with one additional commit since the last revision: >> >> fix fi/endif issue > > make/autoconf/jdk-options.m4 line 191: > >> 189: INCLUDE_SA=false >> 190: fi >> 191: if test "x$OPENJDK_TARGET_CPU" = xios ; then > > You mean OPENJDK_TARGET_OS, android/ios are not CPUs. :-) Oops, indeed. Fixed. > make/common/Modules.gmk line 241: > >> 239: MODULES_FILTER += jdk.management >> 240: MODULES_FILTER += jdk.management.agent >> 241: MODULES_FILTER += jdk.sctp > > While technically correct, I agree with Bob that there seem to be not much point in disabling these, if the reason is just "don't think we need them". Is there an issue with compiling these modules on mobile? The compile issues were minimal, and they are solved now. > make/common/modules/LauncherCommon.gmk line 54: > >> 52: ifeq ($(call isTargetOs, ios), true) >> 53: LAUNCHER_CFLAGS += -I$(TOPDIR)/src/java.base/macosx/native/libjli >> 54: endif > > Did the original file in mobile have a broken if statement? So this is like a separate bug fix? Otherwise I don't understand what I'm seeing here. That was indeed broken in the mobile build. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Mon Nov 2 16:57:13 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Mon, 2 Nov 2020 16:57:13 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 26 Oct 2020 08:47:35 GMT, Magnus Ihse Bursie wrote: >> make/modules/java.desktop/Lib.gmk line 38: >> >>> 36: >>> 37: ifeq ($(call isTargetOs, android ios), false) >>> 38: include lib/Awt2dLibraries.gmk >> >> This change seems too extreme. You'll have access to the desktop module but any use of the java code in this module will fail since libawt will be missing. The real fix is to configure the sources and makefiles so the entire code path java.desktop -> native libraries is available but only for the headless toolkit. The libawt_lwawt should not be included. This may be difficult since the fontmanager is dependent this native code. >> >> If this is too difficult, you should just go back and not support the java.desktop module like you had in your first PR version. Although, every time you add a change like this which moves away from full JRE JCK compatibility, you make it more difficult to upstream these changes. > > It would be possible to fix configure so mobile always use headless mode. From my PoV, it seems like the natural approach. Let me know if you need help with fixing that. The problem with awt_headless is that this depends on X11 (which we don't have on iOS/Android). I'm not sure what the best approach is. It would need lots of changes to make that work on mobile. Any help is much appreciated. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Mon Nov 2 22:32:02 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 2 Nov 2020 22:32:02 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> On Mon, 2 Nov 2020 15:04:24 GMT, Johan Vos wrote: >> make/common/Modules.gmk line 235: >> >>> 233: >>> 234: ################################################################################ >>> 235: # Filter out specific modules for mobile platforms >> >> Is there a reason why you want to excluded these modules? I would think that it might be nice to be able to manage a mobile application remotely. If these modules are incompatible with native-image, then just remove them from your built images when you create a GraalVM builder image. > > They are included again now. But jdk.sctp is still left out on ios? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From github.com+40482367+khanhduytran0 at openjdk.java.net Mon Nov 2 22:37:03 2020 From: github.com+40482367+khanhduytran0 at openjdk.java.net (Tran Khanh Duy) Date: Mon, 2 Nov 2020 22:37:03 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 15:07:39 GMT, Johan Vos wrote: >> Excuse me, but why don't you port jdk8 instead? >> Also, I succeed to port jdk8 to Android, but stuck at >> >> >> static jboolean InitSimpleTypes >> ^ >> Please submit a full bug report, >> with preprocessed source if appropriate. >> See for instructions. >> make[2]: *** [/home/runner/work/android-openjdk-build-multiarch/android-openjdk-build-multiarch/openjdk/build/linux-aarch64-normal-server-release/jdk/objs/libawt/GraphicsPrimitiveMgr.o] Error 1 >> lib/Awt2dLibraries.gmk:468: recipe for target '/home/runner/work/android-openjdk-build-multiarch/android-openjdk-build-multiarch/openjdk/build/linux-aarch64-normal-server-release/jdk/objs/libawt/GraphicsPrimitiveMgr.o' failed >> make[2]: *** Waiting for unfinished jobs.... >> BuildJdk.gmk:70: recipe for target 'libs-only' failed >> make[1]: *** [libs-only] Error 2 >> make: *** [jdk-only] Error 2 >> >> At >> for (pHdr = pStart; pHdr < pEnd; pHdr = PtrAddBytes(pHdr, size)) { >> If I comment out the check `pHdr < pEnd`, then it built. But I want it to complete headless AWT to get [Caciocavallo project working](https://openjdk.java.net/projects/caciocavallo/) or [wrap `Graphics2D` to Android `Canvas`](https://android.googlesource.com/platform/frameworks/native/+/1c07fd511df873d9c4b6dcd066529959f7809ff6/awt/com/android/internal/awt/AndroidGraphics2D.java). > >> Excuse me, but why don't you port jdk8 instead? > > This repository is auto-synced from upstream openjdk/jdk which is 16-ea currently. I don't see a reason why we want Java 8 on Android/ios while we have 15 and beyond on desktop? Simple reason for porting Java 8 is LTS available, but Java 11 have LTS too. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Mon Nov 2 22:37:03 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 2 Nov 2020 22:37:03 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 16:54:36 GMT, Johan Vos wrote: >> It would be possible to fix configure so mobile always use headless mode. From my PoV, it seems like the natural approach. Let me know if you need help with fixing that. > > The problem with awt_headless is that this depends on X11 (which we don't have on iOS/Android). > I'm not sure what the best approach is. It would need lots of changes to make that work on mobile. > Any help is much appreciated. Now that you mention it, I do remember some fuss long time ago about headless requiring X11. Hmmm. That means that any attempt to use headless is definitely out of bounds for this patch. Maybe the best way for this patch is then to exclude the java.desktop module for iOS and Android in Modules.gmk. But I'll look into headless once more to see if I can figure out if it *really* needs X11 or if it's just some sloppy programming. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Mon Nov 2 23:58:54 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Mon, 2 Nov 2020 23:58:54 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 22:32:38 GMT, Magnus Ihse Bursie wrote: >> The problem with awt_headless is that this depends on X11 (which we don't have on iOS/Android). >> I'm not sure what the best approach is. It would need lots of changes to make that work on mobile. >> Any help is much appreciated. > > Now that you mention it, I do remember some fuss long time ago about headless requiring X11. Hmmm. That means that any attempt to use headless is definitely out of bounds for this patch. Maybe the best way for this patch is then to exclude the java.desktop module for iOS and Android in Modules.gmk. > > But I'll look into headless once more to see if I can figure out if it *really* needs X11 or if it's just some sloppy programming. Good news! It turned out that java.desktop can build just fine without X11 if you just want headless. A quick and dirty hack to confirm that this works for you too: diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 index 5120918aed2..42a641c3228 100644 --- a/make/autoconf/libraries.m4 +++ b/make/autoconf/libraries.m4 @@ -46,7 +46,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], else # All other instances need X11, even if building headless only, libawt still # needs X11 headers. - NEEDS_LIB_X11=true + NEEDS_LIB_X11=false fi # Check if fontconfig is needed I'll open a separate bug to get a fix in mainline so that X11 is not required for headless builds. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Tue Nov 3 00:35:57 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Tue, 3 Nov 2020 00:35:57 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Mon, 2 Nov 2020 23:55:41 GMT, Magnus Ihse Bursie wrote: >> Now that you mention it, I do remember some fuss long time ago about headless requiring X11. Hmmm. That means that any attempt to use headless is definitely out of bounds for this patch. Maybe the best way for this patch is then to exclude the java.desktop module for iOS and Android in Modules.gmk. >> >> But I'll look into headless once more to see if I can figure out if it *really* needs X11 or if it's just some sloppy programming. > > Good news! It turned out that java.desktop can build just fine without X11 if you just want headless. > > A quick and dirty hack to confirm that this works for you too: > diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 > index 5120918aed2..42a641c3228 100644 > --- a/make/autoconf/libraries.m4 > +++ b/make/autoconf/libraries.m4 > @@ -46,7 +46,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], > else > # All other instances need X11, even if building headless only, libawt still > # needs X11 headers. > - NEEDS_LIB_X11=true > + NEEDS_LIB_X11=false > fi > > # Check if fontconfig is needed > > I'll open a separate bug to get a fix in mainline so that X11 is not required for headless builds. See. https://bugs.openjdk.java.net/browse/JDK-8255785 ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Tue Nov 3 13:58:58 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Tue, 3 Nov 2020 13:58:58 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Tue, 3 Nov 2020 00:33:36 GMT, Magnus Ihse Bursie wrote: >> Good news! It turned out that java.desktop can build just fine without X11 if you just want headless. >> >> A quick and dirty hack to confirm that this works for you too: >> diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4 >> index 5120918aed2..42a641c3228 100644 >> --- a/make/autoconf/libraries.m4 >> +++ b/make/autoconf/libraries.m4 >> @@ -46,7 +46,7 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES], >> else >> # All other instances need X11, even if building headless only, libawt still >> # needs X11 headers. >> - NEEDS_LIB_X11=true >> + NEEDS_LIB_X11=false >> fi >> >> # Check if fontconfig is needed >> >> I'll open a separate bug to get a fix in mainline so that X11 is not required for headless builds. > > See. https://bugs.openjdk.java.net/browse/JDK-8255785 Thanks for the suggestion. `NEEDS_LIB_X11` was already false for ios/android (same file, in the if clause) but there were a few places where an X11 header was still required. I could easily fix those, but there are more issues when building libawt.a. For example, font.c relies on fontconfig/fontconfig.h which we don't have on android. Actually, the whole font handling is something that is already done in JavaFX (in OpenJFX), and for Android we leverage freetype. I'm a bit puzzled, as I think it would be a huge overkill to somehow port the font code from OpenJDK to android, but never using it as it is already done in OpenJFX. Another area is the dependency on X11 in the java2d/opengl/J2D_GL files. To me, it seems the main issue is that I don't think this code belongs in the core of OpenJDK. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 09:32:01 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 09:32:01 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Tue, 3 Nov 2020 13:56:34 GMT, Johan Vos wrote: >> See. https://bugs.openjdk.java.net/browse/JDK-8255785 > > Thanks for the suggestion. > `NEEDS_LIB_X11` was already false for ios/android (same file, in the if clause) but there were a few places where an X11 header was still required. I could easily fix those, but there are more issues when building libawt.a. For example, font.c relies on fontconfig/fontconfig.h which we don't have on android. > Actually, the whole font handling is something that is already done in JavaFX (in OpenJFX), and for Android we leverage freetype. > I'm a bit puzzled, as I think it would be a huge overkill to somehow port the font code from OpenJDK to android, but never using it as it is already done in OpenJFX. > Another area is the dependency on X11 in the java2d/opengl/J2D_GL files. > > To me, it seems the main issue is that I don't think this code belongs in the core of OpenJDK. Fine. If you don't need or want java.desktop, then I suggest you exclude that module for iOS/Android. I still agree with Bob that keeping java.desktop but not building the native libs sounds problematic, since it will make stuff fail surprisingly at runtime. If you need part, but not all, of java.desktop, then for this patch I don't really care, but if so, that is something that needs to be discussed seriously on how to handle before we can start thinking about upstreaming mobile into mainline. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 09:32:01 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 09:32:01 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 09:28:24 GMT, Magnus Ihse Bursie wrote: >> Thanks for the suggestion. >> `NEEDS_LIB_X11` was already false for ios/android (same file, in the if clause) but there were a few places where an X11 header was still required. I could easily fix those, but there are more issues when building libawt.a. For example, font.c relies on fontconfig/fontconfig.h which we don't have on android. >> Actually, the whole font handling is something that is already done in JavaFX (in OpenJFX), and for Android we leverage freetype. >> I'm a bit puzzled, as I think it would be a huge overkill to somehow port the font code from OpenJDK to android, but never using it as it is already done in OpenJFX. >> Another area is the dependency on X11 in the java2d/opengl/J2D_GL files. >> >> To me, it seems the main issue is that I don't think this code belongs in the core of OpenJDK. > > Fine. If you don't need or want java.desktop, then I suggest you exclude that module for iOS/Android. > > I still agree with Bob that keeping java.desktop but not building the native libs sounds problematic, since it will make stuff fail surprisingly at runtime. > > If you need part, but not all, of java.desktop, then for this patch I don't really care, but if so, that is something that needs to be discussed seriously on how to handle before we can start thinking about upstreaming mobile into mainline. Also, I'm a bit curious of what other places the X11 headers were needed? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From github.com+40482367+khanhduytran0 at openjdk.java.net Wed Nov 4 09:38:00 2020 From: github.com+40482367+khanhduytran0 at openjdk.java.net (Tran Khanh Duy) Date: Wed, 4 Nov 2020 09:38:00 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 09:29:03 GMT, Magnus Ihse Bursie wrote: >> Fine. If you don't need or want java.desktop, then I suggest you exclude that module for iOS/Android. >> >> I still agree with Bob that keeping java.desktop but not building the native libs sounds problematic, since it will make stuff fail surprisingly at runtime. >> >> If you need part, but not all, of java.desktop, then for this patch I don't really care, but if so, that is something that needs to be discussed seriously on how to handle before we can start thinking about upstreaming mobile into mainline. > > Also, I'm a bit curious of what other places the X11 headers were needed? Maybe try add missing includes before exclude? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Wed Nov 4 09:44:56 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Wed, 4 Nov 2020 09:44:56 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 09:34:51 GMT, Tran Khanh Duy wrote: >> Also, I'm a bit curious of what other places the X11 headers were needed? > > Maybe try add missing includes before exclude? I'd like to include as much as possible, but if that results in ending up complete implementations between #ifndef IOS #endif statements, I worry that we are moving away from the platform-independent idea as well. The GLX code is a problem since glx.h has an include to X11/Xlib.h and X11/Xutil.h and it really depends on what is defined there. That header is included in e.g. GLXGraphicsConfig.c (via GLXGraphicsConfig.h) There is a check on HEADLESS in that file, but it's after the includes. I can move that #ifdef before the includes, but that basically rules out the whole file, and then we are closer to the scenario were everything is included, but all implementations are removed via #ifndef IOS (or #ifndef ANDROID) I ran into a small build issue, where the -DHEADLESS was not passed to LIBAWT_CFLAGS but that is an easy fix. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 10:28:00 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 10:28:00 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 09:42:29 GMT, Johan Vos wrote: >> Maybe try add missing includes before exclude? > > I'd like to include as much as possible, but if that results in ending up complete implementations between > #ifndef IOS > #endif > statements, I worry that we are moving away from the platform-independent idea as well. > > The GLX code is a problem since glx.h has an include to X11/Xlib.h and X11/Xutil.h and it really depends on what is defined there. That header is included in e.g. GLXGraphicsConfig.c (via GLXGraphicsConfig.h) > > There is a check on HEADLESS in that file, but it's after the includes. I can move that #ifdef before the includes, but that basically rules out the whole file, and then we are closer to the scenario were everything is included, but all implementations are removed via #ifndef IOS (or #ifndef ANDROID) > > I ran into a small build issue, where the -DHEADLESS was not passed to LIBAWT_CFLAGS but that is an easy fix. I think the include of GLXGraphicsConfig.h should really be inside the ifdefs. It does not make sense as it is now. If you look at the GLX code, it is basically split in two, a "dummy" implementation for headless which just does: JNIEXPORT jint JNICALL Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities(JNIEnv *env, jclass glxgc, jlong configInfo) { return CAPS_EMPTY; } and the real implementation for non-headless. But this got me worried about my fix of building headless without X11. I wonder how I could compile this without X11, or if the compiler dragged up X11 from a local installation without me noticing it. :( ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From github.com+40482367+khanhduytran0 at openjdk.java.net Wed Nov 4 10:53:01 2020 From: github.com+40482367+khanhduytran0 at openjdk.java.net (Tran Khanh Duy) Date: Wed, 4 Nov 2020 10:53:01 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> References: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> Message-ID: On Mon, 2 Nov 2020 22:29:05 GMT, Magnus Ihse Bursie wrote: >> They are included again now. > > But jdk.sctp is still left out on ios? Why don't just exclude GLX (Desktop OpenGL), or port to EGL with OpenGL ES because both Android and iOS does not have Desktop OpenGL (althought GL4ES is a solution). ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Wed Nov 4 11:33:54 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Wed, 4 Nov 2020 11:33:54 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> Message-ID: On Wed, 4 Nov 2020 10:50:09 GMT, Tran Khanh Duy wrote: >> But jdk.sctp is still left out on ios? > > Why don't just exclude GLX (Desktop OpenGL), or port to EGL with OpenGL ES because both Android and iOS does not have Desktop OpenGL (althought GL4ES is a solution). Excluding GLX would be good. I'm looking into that, but there are other files that need to be excluded as well (java2d/x11). The port to EGL/OpenGL ES is exactly what is done in the OpenJFX project, and therefore it seems a bit redundant to me to re-introduce that here. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Wed Nov 4 13:14:16 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Wed, 4 Nov 2020 13:14:16 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v5] In-Reply-To: References: Message-ID: > exclude some modules that are not relevant on Mobile. > Fix for JDK-8255240 Johan Vos has updated the pull request incrementally with one additional commit since the last revision: Allow to build Awt 2d libs for ios/android ------------- Changes: - all: https://git.openjdk.java.net/mobile/pull/10/files - new: https://git.openjdk.java.net/mobile/pull/10/files/91302188..1d516413 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=mobile&pr=10&range=04 - incr: https://webrevs.openjdk.java.net/?repo=mobile&pr=10&range=03-04 Stats: 36 lines in 6 files changed: 27 ins; 4 del; 5 mod Patch: https://git.openjdk.java.net/mobile/pull/10.diff Fetch: git fetch https://git.openjdk.java.net/mobile pull/10/head:pull/10 PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Wed Nov 4 13:18:57 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Wed, 4 Nov 2020 13:18:57 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 10:25:05 GMT, Magnus Ihse Bursie wrote: >> I'd like to include as much as possible, but if that results in ending up complete implementations between >> #ifndef IOS >> #endif >> statements, I worry that we are moving away from the platform-independent idea as well. >> >> The GLX code is a problem since glx.h has an include to X11/Xlib.h and X11/Xutil.h and it really depends on what is defined there. That header is included in e.g. GLXGraphicsConfig.c (via GLXGraphicsConfig.h) >> >> There is a check on HEADLESS in that file, but it's after the includes. I can move that #ifdef before the includes, but that basically rules out the whole file, and then we are closer to the scenario were everything is included, but all implementations are removed via #ifndef IOS (or #ifndef ANDROID) >> >> I ran into a small build issue, where the -DHEADLESS was not passed to LIBAWT_CFLAGS but that is an easy fix. > > I think the include of GLXGraphicsConfig.h should really be inside the ifdefs. It does not make sense as it is now. If you look at the GLX code, it is basically split in two, a "dummy" implementation for headless which just does: > JNIEXPORT jint JNICALL > Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities(JNIEnv *env, jclass glxgc, jlong configInfo) { > return CAPS_EMPTY; > } > > and the real implementation for non-headless. > > But this got me worried about my fix of building headless without X11. I wonder how I could compile this without X11, or if the compiler dragged up X11 from a local installation without me noticing it. :( I fixed the issues, and with the latest commit, the awt libs are built for ios/android. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From jvos at openjdk.java.net Wed Nov 4 13:28:02 2020 From: jvos at openjdk.java.net (Johan Vos) Date: Wed, 4 Nov 2020 13:28:02 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> Message-ID: On Wed, 4 Nov 2020 11:31:35 GMT, Johan Vos wrote: >> Why don't just exclude GLX (Desktop OpenGL), or port to EGL with OpenGL ES because both Android and iOS does not have Desktop OpenGL (althought GL4ES is a solution). > > Excluding GLX would be good. I'm looking into that, but there are other files that need to be excluded as well (java2d/x11). > The port to EGL/OpenGL ES is exactly what is done in the OpenJFX project, and therefore it seems a bit redundant to me to re-introduce that here. correct, that one is still failing on ios (Sctp.h includes linux/types.h) ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 19:23:57 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 19:23:57 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> Message-ID: On Wed, 4 Nov 2020 13:25:08 GMT, Johan Vos wrote: >> Excluding GLX would be good. I'm looking into that, but there are other files that need to be excluded as well (java2d/x11). >> The port to EGL/OpenGL ES is exactly what is done in the OpenJFX project, and therefore it seems a bit redundant to me to re-introduce that here. > > correct, that one is still failing on ios (Sctp.h includes linux/types.h) @johanvos If you look at make/modules/jdk.sctp/Lib.gmk, you see that the native library is excluded on macosx and aix. I'm not sure about the details here, maybe sctp support is not possible on iOS, but maybe the macos pure java implementation is what's needed on iOS as well? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 19:23:59 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 19:23:59 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v5] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 13:14:16 GMT, Johan Vos wrote: >> exclude some modules that are not relevant on Mobile. >> Fix for JDK-8255240 > > Johan Vos has updated the pull request incrementally with one additional commit since the last revision: > > Allow to build Awt 2d libs for ios/android make/modules/java.desktop/lib/Awt2dLibraries.gmk line 131: > 129: LIBAWT_CFLAGS += -DHEADLESS > 130: endif > 131: ifeq ($(call isTargetOs, ios), android) This looks wrong. Maybe you meant `ifeq ($(call isTargetOs, android), true)`? ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Wed Nov 4 19:23:57 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 4 Nov 2020 19:23:57 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: Message-ID: On Wed, 4 Nov 2020 13:15:44 GMT, Johan Vos wrote: >> I think the include of GLXGraphicsConfig.h should really be inside the ifdefs. It does not make sense as it is now. If you look at the GLX code, it is basically split in two, a "dummy" implementation for headless which just does: >> JNIEXPORT jint JNICALL >> Java_sun_java2d_opengl_GLXGraphicsConfig_getOGLCapabilities(JNIEnv *env, jclass glxgc, jlong configInfo) { >> return CAPS_EMPTY; >> } >> >> and the real implementation for non-headless. >> >> But this got me worried about my fix of building headless without X11. I wonder how I could compile this without X11, or if the compiler dragged up X11 from a local installation without me noticing it. :( > > I fixed the issues, and with the latest commit, the awt libs are built for ios/android. Cool! :) ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From ihse at openjdk.java.net Thu Nov 5 13:15:58 2020 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Thu, 5 Nov 2020 13:15:58 GMT Subject: RFR: 8255240: Mobile builds need to exclude some modules [v3] In-Reply-To: References: <7jhSfL9jc1fTQTU1q7wSPShbcF0uyLWqgyeOvcBL8Qo=.f22356ea-9743-414c-bb8c-2e5f446529a2@github.com> Message-ID: On Wed, 4 Nov 2020 19:18:49 GMT, Magnus Ihse Bursie wrote: >> correct, that one is still failing on ios (Sctp.h includes linux/types.h) > > @johanvos If you look at make/modules/jdk.sctp/Lib.gmk, you see that the native library is excluded on macosx and aix. > > I'm not sure about the details here, maybe sctp support is not possible on iOS, but maybe the macos pure java implementation is what's needed on iOS as well? Heh. I just had a look at the macos implementation, or should I say "implementation". It's basically: private static final String message = "SCTP not supported on this platform"; public SctpChannelImpl(SelectorProvider provider) { super(provider); throw new UnsupportedOperationException(message); } so I dunno, maybe it's just as well to skip the entire module. ------------- PR: https://git.openjdk.java.net/mobile/pull/10 From 8287441421r at gmail.com Tue Nov 17 09:36:26 2020 From: 8287441421r at gmail.com (Sharon Renee Duncan) Date: Tue, 17 Nov 2020 04:36:26 -0500 Subject: No subject Message-ID: Hello we not had a chance to meet yet.but I feel that we will real soon Sharon R Duncan