summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2012-07-20 05:18:56 +0000
committerHenning Heinold <heinold@inf.fu-berlin.de>2012-07-21 11:38:40 +0200
commitec2f9bc7162b124ab87795ac8e80b9fee777b5ce (patch)
treedbc14245abfb9af83a83dbc2ffc2dbe1e7d03b49
parent4b17ec8dfff02090e54ae6385d5f2c0fe5501e86 (diff)
downloadmeta-java-ec2f9bc7162b124ab87795ac8e80b9fee777b5ce.tar.gz
openjdk-6: Fix build on ppc
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de>
-rw-r--r--recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch65
-rw-r--r--recipes-core/openjdk/openjdk-6-common.inc2
-rw-r--r--recipes-core/openjdk/openjdk-6-release-6b24.inc2
3 files changed, 68 insertions, 1 deletions
diff --git a/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch b/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch
new file mode 100644
index 0000000..cc5e4e8
--- /dev/null
+++ b/recipes-core/openjdk/openjdk-6-6b24/icedtea-jdk-powerpc-atomic64.patch
@@ -0,0 +1,65 @@
1http://mail.openjdk.java.net/pipermail/zero-dev/2010-June/000346.html
2
3this cute C code does the same thing on powerpc as the assembly code that
4was here before. If the compiler was built with the SPE extensions instead
5of traditional FPU and double operations are performed in HW then we are
6one step further: The compiler turns this into evldd & evstdd. Voila :)
7
8This C code could also be activated on s390. The compiler turns this into
9a single mvc instruction which does the copy operation. I don't know if
10mvc's copy ability is atomic _or_ not and therefore I leave it as it.
11
12Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
13
14./openjdk-src-dir/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
15Index: openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp
16===================================================================
17--- openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp.org 2011-11-14 14:07:32.000000000 -0800
18+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.hpp 2012-07-19 07:28:26.208405923 -0700
19@@ -25,6 +25,16 @@
20
21 #ifndef OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
22 #define OS_CPU_LINUX_ZERO_VM_OS_LINUX_ZERO_HPP
23+#if defined(PPC) && !defined(_LP64)
24+
25+#ifndef __NO_FPRS__
26+#define ATOMIC64_COPY_THROUGH_DOUBLE 1
27+
28+#elif defined(__SPE__) && !defined(_SOFT_DOUBLE)
29+#define ATOMIC64_COPY_THROUGH_DOUBLE 1
30+
31+#endif
32+#endif
33
34 static void setup_fpu() {}
35
36@@ -36,12 +46,23 @@
37
38 // Atomically copy 64 bits of data
39 static void atomic_copy64(volatile void *src, volatile void *dst) {
40-#if defined(PPC) && !defined(_LP64)
41- double tmp;
42- asm volatile ("lfd %0, 0(%1)\n"
43- "stfd %0, 0(%2)\n"
44- : "=f"(tmp)
45- : "b"(src), "b"(dst));
46+#if ATOMIC64_COPY_THROUGH_DOUBLE
47+ /*
48+ * In order to copy 8 bytes atomicly we rely on the trick that some
49+ * architectures can load and store a double as a single operation.
50+ * gcc picks the correct opcode here and with optimization turned on
51+ * all temporary assignments are gone. - bigeasy
52+ */
53+ union {
54+ double *d;
55+ volatile void *v;
56+ } s, d;
57+
58+ s.v = src;
59+ d.v = dst;
60+
61+ *d.d = *s.d;
62+
63 #elif defined(S390) && !defined(_LP64)
64 double tmp;
65 asm volatile ("ld %0, 0(%1)\n"
diff --git a/recipes-core/openjdk/openjdk-6-common.inc b/recipes-core/openjdk/openjdk-6-common.inc
index c1861b6..6e984f6 100644
--- a/recipes-core/openjdk/openjdk-6-common.inc
+++ b/recipes-core/openjdk/openjdk-6-common.inc
@@ -10,7 +10,7 @@ ICEDTEA = "NEEDS TO BE SET"
10S = "${WORKDIR}/${ICEDTEA}" 10S = "${WORKDIR}/${ICEDTEA}"
11B = "${S}/build" 11B = "${S}/build"
12 12
13INC_PR = "r18" 13INC_PR = "r19"
14 14
15SRC_URI = "\ 15SRC_URI = "\
16 ${ICEDTEA_URI} \ 16 ${ICEDTEA_URI} \
diff --git a/recipes-core/openjdk/openjdk-6-release-6b24.inc b/recipes-core/openjdk/openjdk-6-release-6b24.inc
index 00a14c2..b867fb3 100644
--- a/recipes-core/openjdk/openjdk-6-release-6b24.inc
+++ b/recipes-core/openjdk/openjdk-6-release-6b24.inc
@@ -81,6 +81,7 @@ ICEDTEAPATCHES = "\
81 file://icedtea-fix-xrender.patch;apply=no \ 81 file://icedtea-fix-xrender.patch;apply=no \
82 file://icedtea-shark-arm-linux-cpu-detection.patch;apply=no \ 82 file://icedtea-shark-arm-linux-cpu-detection.patch;apply=no \
83 file://icedtea-zero-hotspotfix.patch;apply=no \ 83 file://icedtea-zero-hotspotfix.patch;apply=no \
84 file://icedtea-jdk-powerpc-atomic64.patch;apply=no \
84 " 85 "
85 86
86ICEDTEAPATCHES_append_libc-uclibc = " \ 87ICEDTEAPATCHES_append_libc-uclibc = " \
@@ -105,6 +106,7 @@ DISTRIBUTION_PATCHES = "\
105 patches/icedtea-fix-xrender.patch \ 106 patches/icedtea-fix-xrender.patch \
106 patches/icedtea-shark-arm-linux-cpu-detection.patch \ 107 patches/icedtea-shark-arm-linux-cpu-detection.patch \
107 patches/icedtea-zero-hotspotfix.patch \ 108 patches/icedtea-zero-hotspotfix.patch \
109 patches/icedtea-jdk-powerpc-atomic64.patch \
108 " 110 "
109 111
110DISTRIBUTION_PATCHES_append_libc-uclibc = "\ 112DISTRIBUTION_PATCHES_append_libc-uclibc = "\