RFR: 8148302: Initial Bringup of Android in mobile/dev

Bob Vandette bob.vandette at oracle.com
Wed Jan 27 16:15:13 UTC 2016


> On Jan 27, 2016, at 4:56 AM, Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> wrote:
> 
> On 2016-01-26 20:50, Bob Vandette wrote:
>> Please review the changes for two improvements for the Mobile Dev Forest.
>> 
>> With these changes, the mobile/dev forest can successfully build x86 and ARM Android
>> JDK 9 binaries.   The ARM binaries use the Zero ARM interpreter while the x86
>> implementation uses standard x86 Hotspot VMs.
>> 
>> The webrev also includes 1 fix for iOS BSD builds in hotspot/make/bsd/makefiles/vm.make.
>> 
>> JDK-8148304	 Mobile: iOS builds fail on assembler files
>>                          https://bugs.openjdk.java.net/browse/JDK-8148304
>> 
>> JDK-8148302	 Mobile: Initial bring of Android x86 and ARM
>>                          https://bugs.openjdk.java.net/browse/JDK-8148302
>> 
>> Here’s the webrev:
>> 
>> http://cr.openjdk.java.net/~bobv/8148302/webrev
> 
> Hi Bob,
> 
> Some comments:
> 
> * In jni_util_md.c, you have accidentally lost a trailing ).
Thanks for catching that.  Fixed.

> 
> * In spec.gmk.in, please use ":=" instead of "=". The former is assignment, the latter is used for macro expansion. (As a rule of thumb, := should always be used unless you have explicit reasons.)
Fixed.
> 
> * In CompileJavaModules.gmk, why do you remove the exclude for BUILD_HEADLESS_ONLY? This change affects all platforms, not only android.

I don’t believe BUILD_HEADLESS_ONLY works for any platform without this fix.  Although I specify —disable-headful and set BUILD_HEADLESS_ONLY,
the desktop module is still built and fails compiling several files due to these missing classes. 

* For target java.desktop:
/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/awt/www/content/audio/aiff.java:34: error: package sun.applet does not exist
import sun.applet.AppletAudioClip;
                 ^
/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/awt/www/content/audio/basic.java:34: error: package sun.applet does not exist
import sun.applet.AppletAudioClip;

/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/awt/www/content/audio/wav.java:34: error: package sun.applet does not exist
import sun.applet.AppletAudioClip;
                 ^
/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/awt/www/content/audio/x_aiff.java:34: error: package sun.applet does not exist
import sun.applet.AppletAudioClip;
                 ^
/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/awt/www/content/audio/x_wav.java:34: error: package sun.applet does not exist
import sun.applet.AppletAudioClip;
                 ^
/export/users/bobv/mobile-dev/jdk/src/java.desktop/share/classes/sun/font/SunFontManager.java:2843: error: package sun.applet does not exist
                            return sm instanceof sun.applet.AppletSecurity;

> 
> * In lib-x11.m4, I *really* don't like adding X11 paths when we should not have X11! (And it's even worse since you do not check for Android but do so for all platforms.) What files are needed, and for what library? Can you not fix this dependency by removing the #include statements in the source code instead? Otherwise, I'd say that android *is* indeed dependent on X11, and you need to express this properly.

I removed this change.  It’s no longer necessary. 

The change that most likely fixed this is the setting of BUILD_HEADLESS_ONLY.

Shouldn’t BUILD_HEADLESS_ONLY be set when —disable-headful is set to true or maybe the uses of BUILD_HEADLESS_ONLY
should be changed to SUPPORT_HEADFUL?


> 
> * In lib-ffi.m4 and Copy-java.base.gmk: I think this a bit problematic. I believe what you're trying to achieve is similar to what we do for freetype, where we "bundle" the library with the resulting product. I'd rather see this libffi bundling based on that behavior. More concretely:
> - The name of the variable should be like LIBFFI_BUNDLE_LIB_PATH, to clearly show that this is used only when bundling the product, not when compiling it.
Ok.
> - Whether to bundle or not should be determined in lib-ffi.m4. The default value should be "bundle if android+zero, otherwise not". If you want to, you can add a --enable-libffi-bundling to override this. I won't require it, but I generally find such things useful since you can test that bundling works even without building for a specific target. The code in Copy-java.base.gmk should then only test if this variable is present, compare with freetype in Copy-java.desktop. Finally, the configure code must check for the case that libffi bundling is enabled but no explicit libffi path is set (e.g. it is autodetected). It's okay to abort with an error, but it must be detected.
Yes, I was trying to model this after the freetype library.

Ok, I’ll make that change.


> 
> And finally, a note of appreciation. :-) I'm really happy to see the ugly solution with the hard-coded linker scripts go away in flags.m4!

They are also removed from the VM makefiles.

I’m happy that we don’t need this anymore.  This happened when we started generating devkits from the Android NDK.
The NDK toolchain generation script generates toolchains that handle the ldscripts for us.

Thanks for the review,
Bob.

> 
> /Magnus




More information about the build-dev mailing list