Skip to contentSkip to conversation

OpenJDK-8: For x86 and ARM

PATCH In review Vinay K. Awasthi 4 participants 6 messages Aug 28, 2015 – Sep 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OpenJDK-8: For x86 and ARM

From: "Vinay K. Awasthi" <[email protected]>

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

---
 .../openjdk-8-60b27/cacao-arm-ucontext.patch       |  24 +
 .../openjdk/openjdk-8-60b27/cacao-libtoolize.patch |  12 +
 .../openjdk-8-60b27/cacao-loadavg-makefile.patch   |  13 +
 .../openjdk/openjdk-8-60b27/cacao-loadavg.patch    |  27 +
 .../openjdk-8-60b27/faulty-nx-emulation.patch      |  12 +
 .../openjdk/openjdk-8-60b27/fix-checksums.patch    |  61 ++
 recipes-core/openjdk/openjdk-8-60b27/jvm.cfg       |  43 ++
 .../openjdk/openjdk-8-60b27/zero-build.patch       |  14 +
 recipes-core/openjdk/openjdk-8_60b27-2.5.4.bb      | 621 +++++++++++++++++++++
 recipes-images/images/java-test-image.bb           |   1 +
 10 files changed, 828 insertions(+)
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/cacao-arm-ucontext.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/cacao-libtoolize.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/cacao-loadavg-makefile.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/cacao-loadavg.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/faulty-nx-emulation.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/fix-checksums.patch
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/jvm.cfg
 create mode 100644 recipes-core/openjdk/openjdk-8-60b27/zero-build.patch
 create mode 100644 recipes-core/openjdk/openjdk-8_60b27-2.5.4.bb
recipes-core/openjdk/openjdk-8-60b27/cacao-arm-ucontext.patch new file +24 -0
new file mode 100644
index 0000000..c21fcf1
@@ -0,0 +1,24 @@
+Index: cacao-a567bcb7f589/src/vm/jit/arm/linux/md-os.c
+===================================================================
+--- cacao-a567bcb7f589/src/vm/jit/arm/linux/md-os.c	2013-01-26 21:30:54.206581090 +0100
++++ cacao-a567bcb7f589/src/vm/jit/arm/linux/md-os.c	2013-01-26 21:31:34.406991316 +0100
+@@ -28,19 +28,7 @@
+ 
+ #include <stdint.h>
+ 
+-#define ucontext broken_glibc_ucontext
+-#define ucontext_t broken_glibc_ucontext_t
+ #include <ucontext.h>
+-#undef ucontext
+-#undef ucontext_t
+-
+-typedef struct ucontext {
+-   unsigned long     uc_flags;
+-   struct ucontext  *uc_link;
+-   stack_t           uc_stack;
+-   struct sigcontext uc_mcontext;
+-   sigset_t          uc_sigmask;
+-} ucontext_t;
+ 
+ #define scontext_t struct sigcontext
+ 
recipes-core/openjdk/openjdk-8-60b27/cacao-libtoolize.patch new file +12 -0
new file mode 100644
index 0000000..484cb10
@@ -0,0 +1,12 @@
+Index: icedtea6/Makefile.am
+===================================================================
+--- icedtea6.orig/Makefile.am	2011-12-21 22:58:23.000000000 +0100
++++ icedtea6/Makefile.am	2011-12-21 23:00:21.405887186 +0100
+@@ -1922,6 +1922,7 @@
+ if BUILD_CACAO
+ if !USE_SYSTEM_CACAO
+ 	cd cacao/cacao && \
++	rm -f libtool && \
+ 	./autogen.sh && \
+ 	$(ARCH_PREFIX) ./configure \
+ 	  --host=$(host_alias) \
recipes-core/openjdk/openjdk-8-60b27/cacao-loadavg-makefile.patch new file +13 -0
new file mode 100644
index 0000000..a389206
@@ -0,0 +1,13 @@
+Index: icedtea-2.1.4/Makefile.am
+===================================================================
+--- icedtea-2.1.4.orig/Makefile.am	2013-01-26 18:20:55.152561203 +0100
++++ icedtea-2.1.4/Makefile.am	2013-01-26 18:41:07.637992206 +0100
+@@ -1994,6 +1994,8 @@
+ if BUILD_CACAO
+ if !USE_SYSTEM_CACAO
+ 	cd cacao/cacao && \
++	patch -p1 -N < $(abs_top_srcdir)/patches/cacao-loadavg.patch && \
++	patch -p1 -N < $(abs_top_srcdir)/patches/cacao-arm-ucontext.patch && \
+ 	rm -f libtool && \
+ 	./autogen.sh && \
+ 	$(ARCH_PREFIX) ./configure \
recipes-core/openjdk/openjdk-8-60b27/cacao-loadavg.patch new file +27 -0
new file mode 100644
index 0000000..0fc1a81
@@ -0,0 +1,27 @@
+Index: cacao-cff92704c4e0/src/vm/os.hpp
+===================================================================
+--- cacao-cff92704c4e0/src/vm/os.hpp	2011-12-08 13:40:45.000000000 +0100
++++ cacao-cff92704c4e0/src/vm/os.hpp	2011-12-20 11:42:36.985633921 +0100
+@@ -425,7 +425,21 @@
+ #if defined(HAVE_GETLOADAVG)
+ 	return ::getloadavg(loadavg, nelem);
+ #else
+-# error getloadavg not available
++        FILE *LOADAVG;
++        double avg[3] = { 0.0, 0.0, 0.0 };
++        int i, res = -1;;
++
++        if ((LOADAVG = fopen("/proc/loadavg", "r"))) {
++                fscanf(LOADAVG, "%lf %lf %lf", &avg[0], &avg[1], &avg[2]);
++                res = 0;
++                fclose(LOADAVG);
++        }
++
++        for (i = 0; (i < nelem) && (i < 3); i++) {
++                loadavg[i] = avg[i];
++        }
++
++        return res;
+ #endif
+ }
+ 
recipes-core/openjdk/openjdk-8-60b27/faulty-nx-emulation.patch new file +12 -0
new file mode 100644
index 0000000..4d65917
@@ -0,0 +1,12 @@
+--- hotspot/src/os/linux/vm/os_linux.cpp	2015-03-07 10:25:19.000000000 -0800
++++ hotspot/src/os/linux/vm/os_linux.cpp	2015-03-07 10:25:19.000000000 -0800
++++ a.cpp	2015-07-23 11:45:17.666243540 -0700
+@@ -4847,7 +4847,7 @@
+   Linux::capture_initial_stack(JavaThread::stack_size_at_create());
+ 
+ #if defined(IA32)
+-  workaround_expand_exec_shield_cs_limit();
++//  workaround_expand_exec_shield_cs_limit();
+ #endif
+ 
+   Linux::libpthread_init();
recipes-core/openjdk/openjdk-8-60b27/fix-checksums.patch new file +61 -0

61 lines not on this page · raw message

recipes-core/openjdk/openjdk-8-60b27/jvm.cfg new file +43 -0

43 lines not on this page · raw message

recipes-core/openjdk/openjdk-8-60b27/zero-build.patch new file +14 -0
new file mode 100644
index 0000000..1c07102
@@ -0,0 +1,14 @@
+---  hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	2015-03-07 10:25:19.000000000 -0800
++++  hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	2015-03-07 10:25:19.000000000 -0800
+@@ -407,7 +407,11 @@
+     // during deoptimization so the interpreter needs to skip it when
+     // the frame is popped.
+     thread->set_do_not_unlock_if_synchronized(true);
++#ifdef CC_INTERP
++    return (address) -1;
++#else
+     return Interpreter::remove_activation_entry();
++#endif
+   }
+ 
+   // Need to do this check first since when _do_not_unlock_if_synchronized
recipes-core/openjdk/openjdk-8_60b27-2.5.4.bb new file +621 -0

621 lines not on this page · raw message

recipes-images/images/java-test-image.bb +1 -0
index 22c7bdf..3c241e6 100644
@@ -9,6 +9,7 @@ IMAGE_INSTALL = "busybox modutils-initscripts initscripts opkg udev sysvinit net
                  ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL} \
                  openjdk-7-jre openjdk-7-vm-zero openjdk-7-vm-jamvm openjdk-7-vm-cacao \
                  openjdk-6-jre openjdk-6-vm-zero openjdk-6-vm-jamvm openjdk-6-vm-cacao \
+                 openjdk-8-jre \
                  strace dropbear binutils \
                  classpath \
                  classpath-common \
Signature · 1 line
1.8.1.2
#1 lore raw

Hi Vinay,
thanks for working on that!

Quoted 9 lines · Vinay K. Awasthi

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

I successfully compiled and tested it for/on an ARMv7 Cortex A9 CPU:

# /usr/lib/jvm/java-8-openjdk/jre/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-leri_2015_08_28_08_47-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

Also X11/awt/swing works fine! Only problem for me is that ZeroVM is running in "interpreted mode". Therefore my programs are running really slow.

Was the "mixed mode" available/working in your tests?

IMHO a working JIT (=> mixed-mode) is a must-have for merging this patch upstream. What do you think Otavio?

thanks & regards,
Richard L

#2 lore raw

Thank you for trying out! At present hotspot does not compile for arm32 ...Various compilation issues in code that may requires Oracles assistance...

Yes mixed mode is working for x86....

Thanks,
-Vinay
408-765-9407
415-770-3385 (cell)

Quoted 33 lines · Richard Leitner

Hi Vinay,
thanks for working on that!

Quoted 10 lines · Vinay K. Awasthi

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

I successfully compiled and tested it for/on an ARMv7 Cortex A9 CPU:

# /usr/lib/jvm/java-8-openjdk/jre/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-leri_2015_08_28_08_47-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

Also X11/awt/swing works fine! Only problem for me is that ZeroVM is running in "interpreted mode". Therefore my programs are running really slow.

Was the "mixed mode" available/working in your tests?

IMHO a working JIT (=> mixed-mode) is a must-have for merging this patch upstream. What do you think Otavio?

thanks & regards,
Richard L

#3 lore raw
In reply to Richard Leitner
Quoted 17 lines · Richard Leitner
Quoted 9 lines · Vinay K. Awasthi

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

I successfully compiled and tested it for/on an ARMv7 Cortex A9 CPU:

# /usr/lib/jvm/java-8-openjdk/jre/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-leri_2015_08_28_08_47-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)
Quoted 8 lines

Also X11/awt/swing works fine! Only problem for me is that ZeroVM is running in "interpreted mode". Therefore my programs are running really slow.

Was the "mixed mode" available/working in your tests?

IMHO a working JIT (=> mixed-mode) is a must-have for merging this patch upstream. What do you think Otavio?

Yes, I agree. There are other people working in OpenJDK 8 here[1] (at ml) it seems so maybe we could share some ideas on how to fix it.

1. https://github.com/rehsack/meta-java

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#4 lore raw
Quoted 23 lines · Otavio Salvador
Quoted 21 lines · Richard Leitner
Quoted 9 lines · Vinay K. Awasthi

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

I successfully compiled and tested it for/on an ARMv7 Cortex A9 CPU:

# /usr/lib/jvm/java-8-openjdk/jre/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-leri_2015_08_28_08_47-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

Also X11/awt/swing works fine! Only problem for me is that ZeroVM is running in "interpreted mode". Therefore my programs are running really slow.

Quoted 7 lines
Quoted 4 lines

Was the "mixed mode" available/working in your tests?

IMHO a working JIT (=> mixed-mode) is a must-have for merging this patch upstream. What do you think Otavio?

Yes, I agree. There are other people working in OpenJDK 8 here[1] (at ml) it seems so maybe we could share some ideas on how to fix it.

I'm hearing there is a little frustration about moving forward with this. I'd like to suggest that a staged approach might be better in this case, for example if OpenJDK-8 is working on IA, how about adding it with:

# mixed-mode isn't working on ARM yet
COMPATIBLE_HOST = '(i.86|x86_64).*-linux'

With a large change like this, I think its perhaps ok to take a staged approach, as long as its clear what is/isn't expected to work? If/as/when the ARM people have time to make it work there, patches can be sent to change that? This way it unblocks people and doesn't hold keen contributors back.

Cheers,

Richard

#5 lore raw
Quoted 37 lines · Richard Purdie
Quoted 23 lines · Otavio Salvador
Quoted 21 lines · Richard Leitner
Quoted 9 lines · Vinay K. Awasthi

Rebased it again with latest change-set and tested it on oe-core master with latest mate-openembedded.

There is no change in recipe.

This enables OpenJDK-8 jre/jdk for x86 and ARM.

This recipe is tested for arm (zero VM) and x86 (hotspot vm).

To build just use bitbake openjdk-8.

I successfully compiled and tested it for/on an ARMv7 Cortex A9 CPU:

# /usr/lib/jvm/java-8-openjdk/jre/bin/java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-leri_2015_08_28_08_47-b00)
OpenJDK Zero VM (build 25.60-b23, interpreted mode)

Also X11/awt/swing works fine! Only problem for me is that ZeroVM is running in "interpreted mode". Therefore my programs are running really slow.

Quoted 7 lines
Quoted 4 lines

Was the "mixed mode" available/working in your tests?

IMHO a working JIT (=> mixed-mode) is a must-have for merging this patch upstream. What do you think Otavio?

Yes, I agree. There are other people working in OpenJDK 8 here[1] (at ml) it seems so maybe we could share some ideas on how to fix it.

I'm hearing there is a little frustration about moving forward with this. I'd like to suggest that a staged approach might be better in this case, for example if OpenJDK-8 is working on IA, how about adding it with:

Quoted 8 lines
# mixed-mode isn't working on ARM yet
COMPATIBLE_HOST = '(i.86|x86_64).*-linux'

With a large change like this, I think its perhaps ok to take a staged approach, as long as its clear what is/isn't expected to work? If/as/when the ARM people have time to make it work there, patches can be sent to change that? This way it unblocks people and doesn't hold keen contributors back.

I am without much time to look at this and do a proper testing. If any other maintainer wants to handle this I would be thankful.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750