From 65bd3d6eaa6ae4e06f1c04efb493f448cf6d619b Mon Sep 17 00:00:00 2001 From: Richard Leitner Date: Mon, 8 Jan 2018 12:49:17 +0100 Subject: openjdk-7: fix compile errors with current poky master (gcc6) 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 Signed-off-by: Maxin B. John Signed-off-by: Jose Diaz de Grenu --- .../icedtea-flags-to-compile-with-GCC-6.patch | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch (limited to 'recipes-core/openjdk/patches-openjdk-7/icedtea-flags-to-compile-with-GCC-6.patch') 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 @@ +From 732aab80cb1505ef2f4d8a6e141f835aa9f6d985 Mon Sep 17 00:00:00 2001 +From: Abdur Rehman +Date: Mon, 24 Oct 2016 20:24:32 +0500 +Subject: [PATCH] icedtea flags to compile with GCC 6 + +Upstream bug filed here: +https://bugs.openjdk.java.net/browse/JDK-8163032 + +This patch combines the changes introduced by following commits: +* http://hg.openjdk.java.net/jdk7u/jdk7u/hotspot/rev/e34324d73cd5 +* http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/9e1264f51bae + +Upstream-Status: Backport + +Signed-off-by: Abdur Rehman +--- + openjdk/hotspot/make/linux/makefiles/gcc.make | 7 +++++++ + openjdk/jdk/make/common/Defs-linux.gmk | 8 +++++++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git openjdk/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make +index 4ef0e49..bca3c5c 100644 +--- openjdk/hotspot/make/linux/makefiles/gcc.make ++++ openjdk/hotspot/make/linux/makefiles/gcc.make +@@ -83,6 +83,7 @@ ifeq ($(TYPE),SHARK) + CFLAGS += $(LIBFFI_CFLAGS) + CFLAGS += $(LLVM_CFLAGS) + endif ++CFLAGS += -std=gnu++98 + CFLAGS += $(VM_PICFLAG) + CFLAGS += -fno-rtti + CFLAGS += -fno-exceptions +@@ -93,6 +94,12 @@ CFLAGS += -fcheck-new + ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" + CFLAGS += -fvisibility=hidden + endif ++# GCC 6 has more aggressive dead-store elimination which causes the VM to crash ++# It also optimises away null pointer checks which are still needed. ++# We turn both of these optimisations off. ++ifneq "$(shell expr \( $(CC_VER_MAJOR) \>= 6 \))" "0" ++CFLAGS += -fno-delete-null-pointer-checks -fno-lifetime-dse ++endif + + ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) + ARCHFLAG/i486 = -m32 -march=i586 +diff --git openjdk/jdk/make/common/Defs-linux.gmk openjdk/jdk/make/common/Defs-linux.gmk +index f64042c..727593c 100644 +--- openjdk/jdk/make/common/Defs-linux.gmk ++++ openjdk/jdk/make/common/Defs-linux.gmk +@@ -217,6 +217,12 @@ CFLAGS_REQUIRED_ppc64 += -fno-tree-vectorize + CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH)) + LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH)) + endif ++# GCC 6 has more aggressive dead-store elimination which causes the VM to crash ++# It also optimises away null pointer checks which are still needed. ++# We turn both of these optimisations off. ++ifeq ($(shell $(EXPR) $(CC_MAJORVER) \>= 6 ),1) ++ CFLAGS_REQUIRED += -fno-delete-null-pointer-checks -fno-lifetime-dse ++endif + + # If this is a --hash-style=gnu system, use --hash-style=both + # The gnu .hash section won't work on some Linux systems like SuSE 10. +@@ -281,7 +287,7 @@ CFLAGS_OPT = $(CC_OPT) + CFLAGS_DBG = $(DEBUG_FLAG) + CFLAGS_COMMON += $(CFLAGS_REQUIRED) + +-CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) ++CXXFLAGS_COMMON = -std=gnu++98 $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS) + CXXFLAGS_OPT = $(CC_OPT) + CXXFLAGS_DBG = $(DEBUG_FLAG) + CXXFLAGS_COMMON += $(CFLAGS_REQUIRED) +-- +2.8.1 + -- cgit v1.2.3-54-g00ecf