Mercurial > hg > release > icedtea7-forest-2.6 > hotspot
changeset 6444:4b50705cd316
8151841, PR3098: Build needs additional flags to compile with GCC 6
Summary: C++ standard needs to be explicitly set and some optimisations turned off to build on GCC 6
Reviewed-by: erikj, dholmes, kbarrett
author | andrew |
---|---|
date | Fri, 08 Jul 2016 01:58:45 +0100 |
parents | b40cadf40ab7 |
children | da12b61bf5a2 |
files | make/linux/makefiles/gcc.make |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/make/linux/makefiles/gcc.make Tue Jul 19 23:59:47 2016 +0100 +++ b/make/linux/makefiles/gcc.make Fri Jul 08 01:58:45 2016 +0100 @@ -83,6 +83,7 @@ CFLAGS += $(LIBFFI_CFLAGS) CFLAGS += $(LLVM_CFLAGS) endif +CFLAGS += -std=gnu++98 CFLAGS += $(VM_PICFLAG) CFLAGS += -fno-rtti CFLAGS += -fno-exceptions @@ -93,6 +94,12 @@ 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