summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Leitner <richard.leitner@skidata.com>2018-01-08 11:49:17 (GMT)
committerMaxin B. John <maxin.john@intel.com>2018-01-08 12:59:02 (GMT)
commit65bd3d6eaa6ae4e06f1c04efb493f448cf6d619b (patch)
tree89d6c8b2a9d159d486b76e6fed90f0c4ee25dc47
parent67e48693501bddb80745b9735b7b3d4d28dce9a1 (diff)
downloadmeta-java-morty.tar.gz
openjdk-7: fix compile errors with current poky master (gcc6)morty
Using the current poky master openjdk-7 wasn't buildable. This patch fixes those problems by adding three more patches to openjdk-7. These patches basically add/fix GCC6 support. Furthermore the LDFLAGS_HASH_STYLE variable (which was removed by the icedtea-crosscompile-fix.patch) is re-introduced and set to "both" for compatibility reasons. Following two patches were originally written by Abdur Rehman and taken from meta-mentor [1]: icedtea-flags-to-compile-with-GCC-6.patch icedtea-specify-overloaded-variant-of-fmod.patch [1] https://github.com/MentorEmbedded/meta-mentor Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Jose Diaz de Grenu <Jose.DiazdeGrenu@digi.com>
-rw-r--r--recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb12
-rw-r--r--recipes-core/openjdk/patches-openjdk-7/icedtea-crosscompile-fix.patch3
-rw-r--r--recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch74
-rw-r--r--recipes-core/openjdk/patches-openjdk-7/icedtea-hotspot-fix-string-literal-marcos.patch26
-rw-r--r--recipes-core/openjdk/patches-openjdk-7/icedtea-specify-overloaded-variant-of-fmod.patch28
5 files changed, 141 insertions, 2 deletions
diff --git a/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb b/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
index eba353e..aa165f5 100644
--- a/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
+++ b/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
@@ -51,6 +51,9 @@ ICEDTEAPATCHES = "\
51 file://icedtea-xawt-crosscompile-fix.patch;apply=no \ 51 file://icedtea-xawt-crosscompile-fix.patch;apply=no \
52 file://icedtea-jdk-unzip.patch;apply=no \ 52 file://icedtea-jdk-unzip.patch;apply=no \
53 file://icedtea-dtrace-std_h.patch;apply=no \ 53 file://icedtea-dtrace-std_h.patch;apply=no \
54 file://icedtea-hotspot-fix-string-literal-marcos.patch;apply=no \
55 file://icedtea-flags-to-compile-with-GCC-6.patch;apply=no \
56 file://icedtea-specify-overloaded-variant-of-fmod.patch;apply=no \
54" 57"
55 58
56DISTRIBUTION_PATCHES = "\ 59DISTRIBUTION_PATCHES = "\
@@ -61,10 +64,17 @@ DISTRIBUTION_PATCHES = "\
61 patches/icedtea-xawt-crosscompile-fix.patch \ 64 patches/icedtea-xawt-crosscompile-fix.patch \
62 patches/icedtea-jdk-unzip.patch \ 65 patches/icedtea-jdk-unzip.patch \
63 patches/icedtea-dtrace-std_h.patch \ 66 patches/icedtea-dtrace-std_h.patch \
67 patches/icedtea-hotspot-fix-string-literal-marcos.patch \
68 patches/icedtea-flags-to-compile-with-GCC-6.patch \
69 patches/icedtea-specify-overloaded-variant-of-fmod.patch \
64" 70"
65 71
66export DISTRIBUTION_PATCHES 72export DISTRIBUTION_PATCHES
67 73
68# readdir_r was deprecated in glibc-2.24. Ignore the error for now 74# readdir_r was deprecated in glibc-2.24. Ignore the error for now
75#
76# Furthermore shifting negative values produces an error in current gcc versions
77# to avoid this error add -fpermissive
78#
69# NOTE: When updating the recipe, please check if this is still needed 79# NOTE: When updating the recipe, please check if this is still needed
70CFLAGS_append = " -Wno-error=deprecated-declarations" 80CFLAGS_append = " -Wno-error=deprecated-declarations -Wno-error=narrowing -fpermissive"
diff --git a/recipes-core/openjdk/patches-openjdk-7/icedtea-crosscompile-fix.patch b/recipes-core/openjdk/patches-openjdk-7/icedtea-crosscompile-fix.patch
index e957d1e..5d93dbd 100644
--- a/recipes-core/openjdk/patches-openjdk-7/icedtea-crosscompile-fix.patch
+++ b/recipes-core/openjdk/patches-openjdk-7/icedtea-crosscompile-fix.patch
@@ -53,7 +53,7 @@ index 6fe5191..765fc6d 100644
53 53
54 # Hotspot uses very unstrict aliasing turn this optimization off 54 # Hotspot uses very unstrict aliasing turn this optimization off
55 OPT_CFLAGS += -fno-strict-aliasing 55 OPT_CFLAGS += -fno-strict-aliasing
56@@ -208,15 +208,7 @@ LFLAGS += -Wl,-relax 56@@ -208,15 +208,8 @@ LFLAGS += -Wl,-relax
57 endif 57 endif
58 58
59 # Enable linker optimization 59 # Enable linker optimization
@@ -66,6 +66,7 @@ index 6fe5191..765fc6d 100644
66- LDFLAGS_HASH_STYLE = -Wl,--hash-style=both 66- LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
67-endif 67-endif
68-LFLAGS += $(LDFLAGS_HASH_STYLE) 68-LFLAGS += $(LDFLAGS_HASH_STYLE)
69+LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
69+LFLAGS += $(OE_LDFLAGS) 70+LFLAGS += $(OE_LDFLAGS)
70 71
71 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file. 72 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
diff --git a/recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch b/recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch
new file mode 100644
index 0000000..062c6bf
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch
@@ -0,0 +1,74 @@
1From 732aab80cb1505ef2f4d8a6e141f835aa9f6d985 Mon Sep 17 00:00:00 2001
2From: Abdur Rehman <abdur_rehman@mentor.com>
3Date: Mon, 24 Oct 2016 20:24:32 +0500
4Subject: [PATCH] icedtea flags to compile with GCC 6
5
6Upstream bug filed here:
7https://bugs.openjdk.java.net/browse/JDK-8163032
8
9This patch combines the changes introduced by following commits:
10* http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/e34324d73cd5
11* http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/9e1264f51bae
12
13Upstream-Status: Backport
14
15Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
16---
17 openjdk/hotspot/make/linux/makefiles/gcc.make | 7 +++++++
18 openjdk/jdk/make/common/Defs-linux.gmk | 8 +++++++-
19 2 files changed, 14 insertions(+), 1 deletion(-)
20
21diff --git openjdk/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
22index 4ef0e49..bca3c5c 100644
23--- openjdk/hotspot/make/linux/makefiles/gcc.make
24+++ openjdk/hotspot/make/linux/makefiles/gcc.make
25@@ -83,6 +83,7 @@ ifeq ($(TYPE),SHARK)
26 CFLAGS += $(LIBFFI_CFLAGS)
27 CFLAGS += $(LLVM_CFLAGS)
28 endif
29+CFLAGS += -std=gnu++98
30 CFLAGS += $(VM_PICFLAG)
31 CFLAGS += -fno-rtti
32 CFLAGS += -fno-exceptions
33@@ -93,6 +94,12 @@ CFLAGS += -fcheck-new
34 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
35 CFLAGS += -fvisibility=hidden
36 endif
37+# GCC 6 has more aggressive dead-store elimination which causes the VM to crash
38+# It also optimises away null pointer checks which are still needed.
39+# We turn both of these optimisations off.
40+ifneq "$(shell expr \( $(CC_VER_MAJOR) \>= 6 \))" "0"
41+CFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse
42+endif
43
44 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
45 ARCHFLAG/i486 = -m32 -march=i586
46diff --git openjdk/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk
47index f64042c..727593c 100644
48--- openjdk/jdk/make/common/Defs-linux.gmk
49+++ openjdk/jdk/make/common/Defs-linux.gmk
50@@ -217,6 +217,12 @@ CFLAGS_REQUIRED_ppc64 += -fno-tree-vectorize
51 CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
52 LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
53 endif
54+# GCC 6 has more aggressive dead-store elimination which causes the VM to crash
55+# It also optimises away null pointer checks which are still needed.
56+# We turn both of these optimisations off.
57+ifeq ($(shell $(EXPR) $(CC_MAJORVER) \>= 6 ),1)
58+ CFLAGS_REQUIRED += -fno-delete-null-pointer-checks -fno-lifetime-dse
59+endif
60
61 # If this is a --hash-style=gnu system, use --hash-style=both
62 # The gnu .hash section won't work on some Linux systems like SuSE 10.
63@@ -281,7 +287,7 @@ CFLAGS_OPT = $(CC_OPT)
64 CFLAGS_DBG = $(DEBUG_FLAG)
65 CFLAGS_COMMON += $(CFLAGS_REQUIRED)
66
67-CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
68+CXXFLAGS_COMMON = -std=gnu++98 $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
69 CXXFLAGS_OPT = $(CC_OPT)
70 CXXFLAGS_DBG = $(DEBUG_FLAG)
71 CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
72--
732.8.1
74
diff --git a/recipes-core/openjdk/patches-openjdk-7/icedtea-hotspot-fix-string-literal-marcos.patch b/recipes-core/openjdk/patches-openjdk-7/icedtea-hotspot-fix-string-literal-marcos.patch
new file mode 100644
index 0000000..533a04a
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-7/icedtea-hotspot-fix-string-literal-marcos.patch
@@ -0,0 +1,26 @@
1--- openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
2+++ openjdk/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
3@@ -4378,9 +4378,9 @@
4 #define G1PPRL_DOUBLE_H_FORMAT " %14s"
5
6 // For summary info
7-#define G1PPRL_SUM_ADDR_FORMAT(tag) " "tag":"G1PPRL_ADDR_BASE_FORMAT
8-#define G1PPRL_SUM_BYTE_FORMAT(tag) " "tag": "SIZE_FORMAT
9-#define G1PPRL_SUM_MB_FORMAT(tag) " "tag": %1.2f MB"
10+#define G1PPRL_SUM_ADDR_FORMAT(tag) " " tag ":"G1PPRL_ADDR_BASE_FORMAT
11+#define G1PPRL_SUM_BYTE_FORMAT(tag) " " tag ": "SIZE_FORMAT
12+#define G1PPRL_SUM_MB_FORMAT(tag) " " tag ": %1.2f MB"
13 #define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag)" / %1.2f %%"
14
15 G1PrintRegionLivenessInfoClosure::
16--- openjdk/hotspot/src/share/vm/prims/unsafe.cpp
17+++ openjdk/hotspot/src/share/vm/prims/unsafe.cpp
18@@ -950,7 +950,7 @@
19 }
20 UNSAFE_END
21
22-#define DAC_Args CLS"[B["OBJ
23+#define DAC_Args CLS "[B[" OBJ
24 // define a class but do not make it known to the class loader or system dictionary
25 // - host_class: supplies context for linkage, access control, protection domain, and class loader
26 // - data: bytes of a class file, a raw memory address (length gives the number of bytes)
diff --git a/recipes-core/openjdk/patches-openjdk-7/icedtea-specify-overloaded-variant-of-fmod.patch b/recipes-core/openjdk/patches-openjdk-7/icedtea-specify-overloaded-variant-of-fmod.patch
new file mode 100644
index 0000000..09fbffe
--- /dev/null
+++ b/recipes-core/openjdk/patches-openjdk-7/icedtea-specify-overloaded-variant-of-fmod.patch
@@ -0,0 +1,28 @@
1From 64a8800cd4efa15bf625227b7cd3a2e15ebfa359 Mon Sep 17 00:00:00 2001
2From: Abdur Rehman <abdur_rehman@mentor.com>
3Date: Tue, 25 Oct 2016 13:29:51 +0500
4Subject: [PATCH] arm32JIT.cpp: specify overloaded variant of fmod
5
6Upstream-Status: Pending
7
8Signed-off-by: Abdur Rehman <abdur_rehman@mentor.com>
9---
10 openjdk/hotspot/src/cpu/zero/vm/arm32JIT.cpp | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git openjdk/hotspot/src/cpu/zero/vm/arm32JIT.cpp openjdk/hotspot/src/cpu/zero/vm/arm32JIT.cpp
14index 089a1c9..4482fd6 100644
15--- openjdk/hotspot/src/cpu/zero/vm/arm32JIT.cpp
16+++ openjdk/hotspot/src/cpu/zero/vm/arm32JIT.cpp
17@@ -8185,7 +8185,7 @@ handlers[H_INVOKEINTERFACE] = (unsigned)(cb->hp + INVOKEINTERFACE_STUB);
18
19 handlers[H_DREM] = out_pos(&codebuf);
20 stm(&codebuf, (1<<ARM_LR), ARM_SP, PUSH_FD, 1);
21- mov_imm(&codebuf, ARM_IP, (u32)fmod);
22+ mov_imm(&codebuf, ARM_IP, (u32)(double (*)(double, double))fmod);
23 #ifdef __ARM_PCS_VFP
24 vmov_reg_d_toVFP(&codebuf, VFP_D0, ARM_R0, ARM_R1);
25 vmov_reg_d_toVFP(&codebuf, VFP_D1, ARM_R2, ARM_R3);
26--
272.8.1
28