RFR: 8025673: Disable X11 AWT toolkit

Artem Ananiev artem.ananiev at oracle.com
Mon Oct 21 02:35:39 PDT 2013


Hi, David,

the changes look fine to me. See more comments below.

On 10/21/2013 3:56 AM, David DeHaven wrote:
>
> CCing: build-dev, macosx-port-dev, hotspot-dev
>
> Request for review of JDK-8025673:
> https://bugs.openjdk.java.net/browse/JDK-8025673
>
> Proposed changes:
> http://cr.openjdk.java.net/~ddehaven/8025673/
>
> This change disables building libawt_xawt.dylib and libawt_headless.dylib on Mac since they are not used and not supported. There are too many challenges (and not enough time) in removing all X11 code from the Mac build at this time, so we're deferring complete removal for later (will be covered by JDK-8003900).
>
> A small change to hotspot is required as it was looking for libawt_xawt.dylib and if not found would set java.awt.headless to true. Since we don't build a headless only JRE on Mac I just have that method return false. I'm not sure how to handle changes to hotspot, can it be pushed along with the jdk changes? Without that change the Mac builds will be broken.
>
> Significant build system changes, build-dev guys are encouraged to comment...
>
> I tried excluding all sun/awt/X11 classes in CompileJavaClasses.gmk but that broke JNI header generation on platforms still using X11 and I couldn't use the big list of excluded files on Mac as that resulted in Java compilation errors, so I just added some logic to exclude everything on Mac and left the list in place everywhere else.
>
> The changes to CompileNativeLibraries.gmk will port to libs/AwtJava2dLibraries.gmk in jdk8/build, however there is a problem in the jdk8/build workspace where the build cannot find symbols in JNI libs so that issue needs to be resolved first. I've not had time to investigate that problem.
>
>
> Question for the AWT team, we still have this in java_props_md.c:
>   458     PreferredToolkit prefToolkit = getPreferredToolkit();
>   459     if (prefToolkit == CToolkit) {
>   460         sprops.awt_toolkit = "sun.lwawt.macosx.LWCToolkit";
>   461     } else {
>   462         // TODO: do we still need this?
>   463         sprops.awt_toolkit = "sun.awt.HToolkit";
>   464     }
>
> Is that necessary? Since we're now using libawt_lwawt in both headless and headful modes I would think we could remove the HToolkit option, but I'm not 100% certain about that.

This question is for SE embedded team and for people who are responsible 
for reduced JRE builds, when some native libraries (including 
libawt_lwawt) are stripped. If these reduced builds are only for 
Solaris/Linux, then we don't need HToolkit stuff on Mac.

Thanks,

Artem

> I've built and tested on Mac and a Linux VM (Ubuntu 12.04) and both seem to be working fine.
>
> JPRT run for Mac is in progress, I will submit one for all other platforms when it finishes building.
>
> -DrD-
>


More information about the hotspot-dev mailing list